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

Unified Diff: chrome/browser/autocomplete/history_url_provider_unittest.cc

Issue 291005: Allow the history URL provider to handle input of type QUERY. This helps in ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 2 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/autocomplete/history_url_provider_unittest.cc
===================================================================
--- chrome/browser/autocomplete/history_url_provider_unittest.cc (revision 29226)
+++ chrome/browser/autocomplete/history_url_provider_unittest.cc (working copy)
@@ -212,7 +212,8 @@
arraysize(expected_combine));
// The title should also have gotten set properly on the host for the
// synthesized one, since it was also in the results.
- EXPECT_EQ(std::wstring(L"Google News"), matches_[0].description);
+ if (!matches_.empty()) // If this fails, RunTest() already printed it.
Paweł Hajdan Jr. 2009/10/17 06:42:24 Could you rather make it ASSERT_FALSE(matches_.emp
+ EXPECT_EQ(std::wstring(L"Google News"), matches_.front().description);
// Test that short URL matching works correctly as the user types more
// (several tests):
@@ -346,7 +347,8 @@
const std::wstring input_1(L"file:");
const std::string fixup_1[] = {"file:///C:/foo.txt"};
RunTest(input_1, std::wstring(), false, fixup_1, arraysize(fixup_1));
- EXPECT_EQ(input_1.length(), matches_[0].inline_autocomplete_offset);
+ if (!matches_.empty()) // If this fails, RunTest() already printed it.
Paweł Hajdan Jr. 2009/10/17 06:42:24 Same here.
+ EXPECT_EQ(input_1.length(), matches_.front().inline_autocomplete_offset);
// Fixing up "http:/" should result in an inline autocomplete offset of just
// after "http:/", not just after "http:".
@@ -357,7 +359,8 @@
"http://bogussite.com/c",
};
RunTest(input_2, std::wstring(), false, fixup_2, arraysize(fixup_2));
- EXPECT_EQ(input_2.length(), matches_[0].inline_autocomplete_offset);
+ if (!matches_.empty()) // If this fails, RunTest() already printed it.
Paweł Hajdan Jr. 2009/10/17 06:42:24 And here.
+ EXPECT_EQ(input_2.length(), matches_.front().inline_autocomplete_offset);
// Adding a TLD to a small number like "56" should result in "www.56.com"
// rather than "0.0.0.56.com".
« no previous file with comments | « chrome/browser/autocomplete/history_url_provider.cc ('k') | chrome/browser/autocomplete/keyword_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698