Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(176)

Unified Diff: content/browser/webui/web_ui_unittest.cc

Issue 9150021: Rename WebUI to WebUIImpl. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/webui/web_ui_message_handler_unittest.cc ('k') | content/content_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/webui/web_ui_unittest.cc
===================================================================
--- content/browser/webui/web_ui_unittest.cc (revision 118186)
+++ content/browser/webui/web_ui_unittest.cc (working copy)
@@ -1,74 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "content/browser/webui/web_ui.h"
-
-#include "base/string16.h"
-#include "base/values.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-class TestWebUIMessageHandler : public WebUIMessageHandler {
- public:
- TestWebUIMessageHandler() {}
- virtual ~TestWebUIMessageHandler() {}
-
- protected:
- virtual void RegisterMessages() {}
-
- private:
- DISALLOW_COPY_AND_ASSIGN(TestWebUIMessageHandler);
-};
-
-TEST(WebUIMessageHandlerTest, ExtractIntegerValue) {
- TestWebUIMessageHandler handler;
-
- ListValue list;
- int value, zero_value = 0, neg_value = -1234, pos_value = 1234;
-
- list.Append(Value::CreateIntegerValue(zero_value));
- EXPECT_TRUE(handler.ExtractIntegerValue(&list, &value));
- EXPECT_EQ(value, zero_value);
- list.Clear();
-
- list.Append(Value::CreateIntegerValue(neg_value));
- EXPECT_TRUE(handler.ExtractIntegerValue(&list, &value));
- EXPECT_EQ(value, neg_value);
- list.Clear();
-
- list.Append(Value::CreateIntegerValue(pos_value));
- EXPECT_TRUE(handler.ExtractIntegerValue(&list, &value));
- EXPECT_EQ(value, pos_value);
-}
-
-TEST(WebUIMessageHandlerTest, ExtractDoubleValue) {
- TestWebUIMessageHandler handler;
-
- ListValue list;
- double value, zero_value = 0.0, neg_value = -1234.5, pos_value = 1234.5;
-
- list.Append(Value::CreateDoubleValue(zero_value));
- EXPECT_TRUE(handler.ExtractDoubleValue(&list, &value));
- EXPECT_EQ(value, zero_value);
- list.Clear();
-
- list.Append(Value::CreateDoubleValue(neg_value));
- EXPECT_TRUE(handler.ExtractDoubleValue(&list, &value));
- EXPECT_EQ(value, neg_value);
- list.Clear();
-
- list.Append(Value::CreateDoubleValue(pos_value));
- EXPECT_TRUE(handler.ExtractDoubleValue(&list, &value));
- EXPECT_EQ(value, pos_value);
-}
-
-TEST(WebUIMessageHandlerTest, ExtractStringValue) {
- TestWebUIMessageHandler handler;
-
- ListValue list;
- string16 in_string = "The facts, though interesting, are irrelevant."
- list.Append(Value::CreateStringValue(string));
- string16 out_string = handler.ExtractStringValue(&list);
- EXPECT_STREQ(in_string.c_str(), out_string.c_str());
-}
-
« no previous file with comments | « content/browser/webui/web_ui_message_handler_unittest.cc ('k') | content/content_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698