| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/strings/string16.h" | 5 #include "base/strings/string16.h" |
| 6 #include "base/strings/utf_string_conversions.h" | 6 #include "base/strings/utf_string_conversions.h" |
| 7 #include "chrome/browser/autocomplete/autocomplete_controller.h" | 7 #include "chrome/browser/autocomplete/autocomplete_controller.h" |
| 8 #include "chrome/browser/autocomplete/autocomplete_match.h" | 8 #include "chrome/browser/autocomplete/autocomplete_match.h" |
| 9 #include "chrome/browser/autocomplete/autocomplete_result.h" | 9 #include "chrome/browser/autocomplete/autocomplete_result.h" |
| 10 #include "chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.h" | 10 #include "chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.h" |
| 11 #include "chrome/browser/extensions/api/omnibox/omnibox_api_testbase.h" | 11 #include "chrome/browser/extensions/api/omnibox/omnibox_api_testbase.h" |
| 12 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
| 13 #include "chrome/browser/search_engines/template_url_service_factory.h" | 13 #include "chrome/browser/search_engines/template_url_service_factory.h" |
| 14 #include "chrome/browser/ui/browser.h" | 14 #include "chrome/browser/ui/browser.h" |
| 15 #include "chrome/browser/ui/location_bar/location_bar.h" | 15 #include "chrome/browser/ui/location_bar/location_bar.h" |
| 16 #include "chrome/browser/ui/omnibox/omnibox_view.h" | 16 #include "chrome/browser/ui/omnibox/omnibox_view.h" |
| 17 #include "chrome/test/base/ui_test_utils.h" | 17 #include "chrome/test/base/ui_test_utils.h" |
| 18 #include "components/autocomplete/autocomplete_input.h" | 18 #include "components/autocomplete/autocomplete_input.h" |
| 19 #include "components/metrics/proto/omnibox_event.pb.h" | 19 #include "components/metrics/proto/omnibox_event.pb.h" |
| 20 #include "ui/base/window_open_disposition.h" | 20 #include "ui/base/window_open_disposition.h" |
| 21 | 21 |
| 22 using base::ASCIIToUTF16; | 22 using base::ASCIIToUTF16; |
| 23 using metrics::OmniboxEventProto; | 23 using metrics::OmniboxEventProto; |
| 24 | 24 |
| 25 IN_PROC_BROWSER_TEST_F(OmniboxApiTest, Basic) { | 25 // http://crbug.com/167158 |
| 26 IN_PROC_BROWSER_TEST_F(OmniboxApiTest, DISABLED_Basic) { |
| 26 ASSERT_TRUE(RunExtensionTest("omnibox")) << message_; | 27 ASSERT_TRUE(RunExtensionTest("omnibox")) << message_; |
| 27 | 28 |
| 28 // The results depend on the TemplateURLService being loaded. Make sure it is | 29 // The results depend on the TemplateURLService being loaded. Make sure it is |
| 29 // loaded so that the autocomplete results are consistent. | 30 // loaded so that the autocomplete results are consistent. |
| 30 Profile* profile = browser()->profile(); | 31 Profile* profile = browser()->profile(); |
| 31 ui_test_utils::WaitForTemplateURLServiceToLoad( | 32 ui_test_utils::WaitForTemplateURLServiceToLoad( |
| 32 TemplateURLServiceFactory::GetForProfile(profile)); | 33 TemplateURLServiceFactory::GetForProfile(profile)); |
| 33 | 34 |
| 34 AutocompleteController* autocomplete_controller = | 35 AutocompleteController* autocomplete_controller = |
| 35 GetAutocompleteController(browser()); | 36 GetAutocompleteController(browser()); |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 { | 246 { |
| 246 ResultCatcher catcher; | 247 ResultCatcher catcher; |
| 247 autocomplete_controller->Start(AutocompleteInput( | 248 autocomplete_controller->Start(AutocompleteInput( |
| 248 ASCIIToUTF16("keyword command incognito"), base::string16::npos, | 249 ASCIIToUTF16("keyword command incognito"), base::string16::npos, |
| 249 base::string16(), GURL(), OmniboxEventProto::NTP, true, false, true, | 250 base::string16(), GURL(), OmniboxEventProto::NTP, true, false, true, |
| 250 true, ChromeAutocompleteSchemeClassifier(profile))); | 251 true, ChromeAutocompleteSchemeClassifier(profile))); |
| 251 location_bar->AcceptInput(); | 252 location_bar->AcceptInput(); |
| 252 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); | 253 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); |
| 253 } | 254 } |
| 254 } | 255 } |
| OLD | NEW |