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

Unified Diff: chrome/browser/history/history_querying_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, 3 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 | « no previous file | chrome/browser/history/url_database.cc » ('j') | chrome/browser/history/url_database.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/history_querying_unittest.cc
===================================================================
--- chrome/browser/history/history_querying_unittest.cc (revision 216076)
+++ chrome/browser/history/history_querying_unittest.cc (working copy)
@@ -442,6 +442,32 @@
}
*/
+// Tests IDN text search by both punycode and UTF.
brettw 2013/09/03 20:44:31 "UTF": I'd write "ASCII" instead.
yuusuke 2013/09/04 08:31:12 Done.
+TEST_F(HistoryQueryTest, TextSearchIDN) {
+ ASSERT_TRUE(history_.get());
+
+ QueryOptions options;
+ QueryResults results;
+
+ TestEntry entry = { "http://xn--d1abbgf6aiiy.xn--p1ai/", "Nothing", 0, };
+ AddEntryToHistory(entry);
+
+ struct QueryEntry {
+ std::string query;
+ size_t results_size;
+ } queries[] = {
+ { "bad query", 0 },
+ { std::string("xn--d1abbgf6aiiy.xn--p1ai"), 1 },
+ { base::WideToUTF8(std::wstring(L"\u043f\u0440\u0435\u0437") +
+ L"\u0438\u0434\u0435\u043d\u0442.\u0440\u0444"), 1, },
+ };
+
+ for (size_t i = 0; i < ARRAYSIZE_UNSAFE(queries); ++i) {
+ QueryHistory(queries[i].query, options, &results);
+ EXPECT_EQ(queries[i].results_size, results.size());
+ }
+}
+
// Test iterating over pages of results.
TEST_F(HistoryQueryTest, Paging) {
// Since results are fetched 1 and 2 at a time, entry #0 and #6 will not
« no previous file with comments | « no previous file | chrome/browser/history/url_database.cc » ('j') | chrome/browser/history/url_database.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698