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

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

Issue 6731036: Enabled pressing TAB to cycle through the Omnibox results. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 9 years, 1 month 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/keyword_provider_unittest.cc
===================================================================
--- chrome/browser/autocomplete/keyword_provider_unittest.cc (revision 108642)
+++ chrome/browser/autocomplete/keyword_provider_unittest.cc (working copy)
@@ -32,6 +32,8 @@
int num_cases,
ResultType AutocompleteMatch::* member);
+ void RunTest(const char* input, const char* keyword);
Peter Kasting 2011/12/15 22:56:04 I'd prefer not to add a function with the same nam
+
protected:
scoped_refptr<KeywordProvider> kw_provider_;
scoped_ptr<TemplateURLService> model_;
@@ -80,6 +82,14 @@
}
}
+void KeywordProviderTest::RunTest(const char* input,
+ const char* keyword) {
+ string16 keyword16(ASCIIToUTF16(keyword));
+ string16 detected_keyword =
+ kw_provider_->GetKeywordForText(ASCIIToUTF16(input));
+ EXPECT_EQ(keyword16, detected_keyword);
+}
+
// http://crbug.com/80612
TEST_F(KeywordProviderTest, DISABLED_Edit) {
test_data<string16> edit_cases[] = {
@@ -216,3 +226,10 @@
model_->Remove(model_->GetTemplateURLForKeyword(ASCIIToUTF16("aaaa")));
ASSERT_TRUE(model_->GetTemplateURLForKeyword(ASCIIToUTF16("aaaa")) == NULL);
}
+
+TEST_F(KeywordProviderTest, GetKeywordForInput) {
+ RunTest("aa", "aa");
+ RunTest("aafoo", "");
+ RunTest("aa foo", "aa");
+}
+

Powered by Google App Engine
This is Rietveld 408576698