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

Side by Side Diff: content/browser/webui/web_ui_message_handler_unittest.cc

Issue 108603005: Update uses of Value in chromeos/, cloud_print/, components/, content/ to use the base:: namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/browser/webui/web_ui_message_handler.cc ('k') | content/common/font_list_android.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/public/browser/web_ui_message_handler.h" 5 #include "content/public/browser/web_ui_message_handler.h"
6 6
7 #include "base/strings/string16.h" 7 #include "base/strings/string16.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
11 11
12 namespace content { 12 namespace content {
13 13
14 TEST(WebUIMessageHandlerTest, ExtractIntegerValue) { 14 TEST(WebUIMessageHandlerTest, ExtractIntegerValue) {
15 ListValue list; 15 base::ListValue list;
16 int value, zero_value = 0, neg_value = -1234, pos_value = 1234; 16 int value, zero_value = 0, neg_value = -1234, pos_value = 1234;
17 base::string16 zero_string(UTF8ToUTF16("0")); 17 base::string16 zero_string(UTF8ToUTF16("0"));
18 base::string16 neg_string(UTF8ToUTF16("-1234")); 18 base::string16 neg_string(UTF8ToUTF16("-1234"));
19 base::string16 pos_string(UTF8ToUTF16("1234")); 19 base::string16 pos_string(UTF8ToUTF16("1234"));
20 20
21 list.Append(new base::FundamentalValue(zero_value)); 21 list.Append(new base::FundamentalValue(zero_value));
22 EXPECT_TRUE(WebUIMessageHandler::ExtractIntegerValue(&list, &value)); 22 EXPECT_TRUE(WebUIMessageHandler::ExtractIntegerValue(&list, &value));
23 EXPECT_EQ(value, zero_value); 23 EXPECT_EQ(value, zero_value);
24 list.Clear(); 24 list.Clear();
25 25
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 TEST(WebUIMessageHandlerTest, ExtractStringValue) { 88 TEST(WebUIMessageHandlerTest, ExtractStringValue) {
89 base::ListValue list; 89 base::ListValue list;
90 base::string16 in_string(UTF8ToUTF16( 90 base::string16 in_string(UTF8ToUTF16(
91 "The facts, though interesting, are irrelevant.")); 91 "The facts, though interesting, are irrelevant."));
92 list.Append(new base::StringValue(in_string)); 92 list.Append(new base::StringValue(in_string));
93 base::string16 out_string = WebUIMessageHandler::ExtractStringValue(&list); 93 base::string16 out_string = WebUIMessageHandler::ExtractStringValue(&list);
94 EXPECT_EQ(in_string, out_string); 94 EXPECT_EQ(in_string, out_string);
95 } 95 }
96 96
97 } // namespace content 97 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/webui/web_ui_message_handler.cc ('k') | content/common/font_list_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698