| OLD | NEW |
| 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/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 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 string16 zero_string(UTF8ToUTF16("0")); | 17 string16 zero_string(UTF8ToUTF16("0")); |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 TEST(WebUIMessageHandlerTest, ExtractStringValue) { | 88 TEST(WebUIMessageHandlerTest, ExtractStringValue) { |
| 89 base::ListValue list; | 89 base::ListValue list; |
| 90 string16 in_string(UTF8ToUTF16( | 90 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 string16 out_string = WebUIMessageHandler::ExtractStringValue(&list); | 93 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 |
| OLD | NEW |