Chromium Code Reviews| 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 |