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

Unified Diff: chrome/browser/ui/webui/history_ui_unittest.cc

Issue 22862006: "domain" item added to HistoryEntry to allow showing IDN in chrome://history/ (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 4 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
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");
+}
+
« chrome/browser/ui/webui/history_ui.cc ('K') | « chrome/browser/ui/webui/history_ui.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698