Chromium Code Reviews| Index: chrome/browser/ui/webui/history_ui_unittest.cc |
| =================================================================== |
| --- chrome/browser/ui/webui/history_ui_unittest.cc (revision 216076) |
| +++ chrome/browser/ui/webui/history_ui_unittest.cc (working copy) |
| @@ -4,6 +4,8 @@ |
| #include "chrome/browser/ui/webui/history_ui.h" |
| +#include <string> |
| + |
| #include "base/strings/utf_string_conversions.h" |
| #include "testing/gtest/include/gtest/gtest.h" |
| @@ -128,3 +130,18 @@ |
| EXPECT_EQ(1u, results[1].all_timestamps.size()); |
| } |
| } |
| + |
| +TEST(HistoryUITest, SetDisplayableDomain) { |
|
Patrick Dubroy
2013/08/20 14:26:37
I think it would be much more valuable to add a te
|
| + const std::string key = "displayableDomain"; |
| + BrowsingHistoryHandler::HistoryEntry history_entry; |
| + DictionaryValue dict_value; |
| + history_entry.url = GURL("http://xn--d1abbgf6aiiy.xn--p1ai/"); |
| + history_entry.SetDisplayableDomain(&dict_value); |
| + EXPECT_TRUE(dict_value.HasKey(key)); |
| + string16 str16; |
| + dict_value.GetString(key, &str16); |
| + const std::string str = base::UTF16ToUTF8(str16); |
| + EXPECT_EQ(str, "\xD0\xBF\xD1\x80\xD0\xB5\xD0\xB7\xD0\xB8\xD0\xB4" |
| + "\xD0\xB5\xD0\xBD\xD1\x82.\xD1\x80\xD1\x84"); |
| +} |
| + |