OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.h" | 5 #include "chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.h" |
6 #include "chrome/browser/extensions/api/omnibox/omnibox_api_testbase.h" | 6 #include "chrome/browser/extensions/api/omnibox/omnibox_api_testbase.h" |
7 #include "chrome/browser/search_engines/template_url_service_factory.h" | 7 #include "chrome/browser/search_engines/template_url_service_factory.h" |
8 #include "chrome/test/base/search_test_utils.h" | 8 #include "chrome/test/base/search_test_utils.h" |
9 #include "components/metrics/proto/omnibox_event.pb.h" | 9 #include "components/metrics/proto/omnibox_event.pb.h" |
10 #include "extensions/test/result_catcher.h" | 10 #include "extensions/test/result_catcher.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 // Quickly type another query and accept it before getting suggestions back | 38 // Quickly type another query and accept it before getting suggestions back |
39 // for the query. The popup will close after accepting input - ensure that it | 39 // for the query. The popup will close after accepting input - ensure that it |
40 // does not reopen when the extension returns its suggestions. | 40 // does not reopen when the extension returns its suggestions. |
41 extensions::ResultCatcher catcher; | 41 extensions::ResultCatcher catcher; |
42 | 42 |
43 // TODO: Rather than send this second request by talking to the controller | 43 // TODO: Rather than send this second request by talking to the controller |
44 // directly, figure out how to send it via the proper calls to | 44 // directly, figure out how to send it via the proper calls to |
45 // location_bar or location_bar->(). | 45 // location_bar or location_bar->(). |
46 autocomplete_controller->Start(AutocompleteInput( | 46 autocomplete_controller->Start(AutocompleteInput( |
47 base::ASCIIToUTF16("keyword command"), base::string16::npos, | 47 base::ASCIIToUTF16("keyword command"), base::string16::npos, |
48 std::string(), GURL(), metrics::OmniboxEventProto::NTP, true, false, true, | 48 std::string(), GURL(), base::string16(), metrics::OmniboxEventProto::NTP, |
49 true, false, ChromeAutocompleteSchemeClassifier(profile))); | 49 true, false, true, true, false, |
| 50 ChromeAutocompleteSchemeClassifier(profile))); |
50 location_bar->AcceptInput(); | 51 location_bar->AcceptInput(); |
51 WaitForAutocompleteDone(autocomplete_controller); | 52 WaitForAutocompleteDone(autocomplete_controller); |
52 EXPECT_TRUE(autocomplete_controller->done()); | 53 EXPECT_TRUE(autocomplete_controller->done()); |
53 // This checks that the keyword provider (via javascript) | 54 // This checks that the keyword provider (via javascript) |
54 // gets told to navigate to the string "command". | 55 // gets told to navigate to the string "command". |
55 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); | 56 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); |
56 EXPECT_FALSE(popup_model->IsOpen()); | 57 EXPECT_FALSE(popup_model->IsOpen()); |
57 } | 58 } |
OLD | NEW |