OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "base/prefs/pref_service.h" | 5 #include "base/prefs/pref_service.h" |
6 #include "chrome/browser/autocomplete/autocomplete_controller.h" | 6 #include "chrome/browser/autocomplete/autocomplete_controller.h" |
7 #include "chrome/browser/autocomplete/autocomplete_provider.h" | 7 #include "chrome/browser/autocomplete/autocomplete_provider.h" |
8 #include "chrome/browser/search/search.h" | 8 #include "chrome/browser/search/search.h" |
9 #include "chrome/browser/ui/omnibox/omnibox_controller.h" | 9 #include "chrome/browser/ui/omnibox/omnibox_controller.h" |
10 #include "chrome/common/pref_names.h" | 10 #include "chrome/common/pref_names.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 TEST_F(OmniboxControllerTest, CheckDefaultAutocompleteProviders) { | 62 TEST_F(OmniboxControllerTest, CheckDefaultAutocompleteProviders) { |
63 CreateController(); | 63 CreateController(); |
64 // First collect the basic providers. | 64 // First collect the basic providers. |
65 int observed_providers = 0; | 65 int observed_providers = 0; |
66 const ACProviders* providers = GetAutocompleteProviders(); | 66 const ACProviders* providers = GetAutocompleteProviders(); |
67 for (size_t i = 0; i < providers->size(); ++i) | 67 for (size_t i = 0; i < providers->size(); ++i) |
68 observed_providers |= providers->at(i)->type(); | 68 observed_providers |= providers->at(i)->type(); |
69 // Ensure we have at least one provider. | 69 // Ensure we have at least one provider. |
70 ASSERT_NE(0, observed_providers); | 70 ASSERT_NE(0, observed_providers); |
71 | 71 |
72 // Ensure instant extended includes all the basic ones save for those that are | 72 // Ensure instant extended includes all the provides in classic Chrome. |
73 // not expected to run in instant extended. | 73 int providers_with_instant_extended = observed_providers; |
74 int providers_with_instant_extended = | |
75 observed_providers & | |
76 ~AutocompleteProvider::TYPE_SHORTCUTS; | |
77 // TODO(beaudoin): remove TYPE_SEARCH once it's no longer needed to pass | 74 // TODO(beaudoin): remove TYPE_SEARCH once it's no longer needed to pass |
78 // the Instant suggestion through via FinalizeInstantQuery. | 75 // the Instant suggestion through via FinalizeInstantQuery. |
79 chrome::EnableInstantExtendedAPIForTesting(); | 76 chrome::EnableInstantExtendedAPIForTesting(); |
80 CreateController(); | 77 CreateController(); |
81 AssertProviders(providers_with_instant_extended); | 78 AssertProviders(providers_with_instant_extended); |
82 } | 79 } |
OLD | NEW |