summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/api/omnibox/omnibox_apitest.cc
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-12 01:07:48 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-12 01:07:48 +0000
commit810ffba3ed8a53fa627aa746285ec63a9d192f60 (patch)
treea437e1d4c37104b8b12de0607504d28f516de421 /chrome/browser/extensions/api/omnibox/omnibox_apitest.cc
parent8e9f1b72aa231c6be1f07f44db6479ffa0b9692d (diff)
downloadchromium_src-810ffba3ed8a53fa627aa746285ec63a9d192f60.zip
chromium_src-810ffba3ed8a53fa627aa746285ec63a9d192f60.tar.gz
chromium_src-810ffba3ed8a53fa627aa746285ec63a9d192f60.tar.bz2
Make AutocompleteClassifier a ProfileKeyedService.
This also cleans up some usage of TemplateURLServiceFactory, especially in order to remove knowledge of TemplateURLService[Factory] from TestingProfile. The changes for this parallel some implementation details for the AutocompleteClassifierFactory. BUG=112557 TEST=none Review URL: https://chromiumcodereview.appspot.com/10532096 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141580 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/api/omnibox/omnibox_apitest.cc')
-rw-r--r--chrome/browser/extensions/api/omnibox/omnibox_apitest.cc20
1 files changed, 6 insertions, 14 deletions
diff --git a/chrome/browser/extensions/api/omnibox/omnibox_apitest.cc b/chrome/browser/extensions/api/omnibox/omnibox_apitest.cc
index 774fdec..f136a4d 100644
--- a/chrome/browser/extensions/api/omnibox/omnibox_apitest.cc
+++ b/chrome/browser/extensions/api/omnibox/omnibox_apitest.cc
@@ -56,17 +56,6 @@ class OmniboxApiTest : public ExtensionApiTest {
autocomplete_controller();
}
- void WaitForTemplateURLServiceToLoad() {
- ui_test_utils::WindowedNotificationObserver loaded_observer(
- chrome::NOTIFICATION_TEMPLATE_URL_SERVICE_LOADED,
- content::NotificationService::AllSources());
- TemplateURLService* model =
- TemplateURLServiceFactory::GetForProfile(browser()->profile());
- model->Load();
- if (!model->loaded())
- loaded_observer.Wait();
- }
-
// TODO(phajdan.jr): Get rid of this wait-in-a-loop pattern.
void WaitForAutocompleteDone(AutocompleteController* controller) {
while (!controller->done()) {
@@ -83,7 +72,8 @@ IN_PROC_BROWSER_TEST_F(OmniboxApiTest, DISABLED_Basic) {
// The results depend on the TemplateURLService being loaded. Make sure it is
// loaded so that the autocomplete results are consistent.
- WaitForTemplateURLServiceToLoad();
+ ui_test_utils::WaitForTemplateURLServiceToLoad(
+ TemplateURLServiceFactory::GetForProfile(browser()->profile()));
LocationBar* location_bar = GetLocationBar(browser());
AutocompleteController* autocomplete_controller =
@@ -197,7 +187,8 @@ IN_PROC_BROWSER_TEST_F(OmniboxApiTest, DISABLED_PopupStaysClosed) {
// The results depend on the TemplateURLService being loaded. Make sure it is
// loaded so that the autocomplete results are consistent.
- WaitForTemplateURLServiceToLoad();
+ ui_test_utils::WaitForTemplateURLServiceToLoad(
+ TemplateURLServiceFactory::GetForProfile(browser()->profile()));
LocationBar* location_bar = GetLocationBar(browser());
OmniboxView* omnibox_view = location_bar->GetLocationEntry();
@@ -251,7 +242,8 @@ IN_PROC_BROWSER_TEST_F(OmniboxApiTest, DISABLED_IncognitoSplitMode) {
// The results depend on the TemplateURLService being loaded. Make sure it is
// loaded so that the autocomplete results are consistent.
- WaitForTemplateURLServiceToLoad();
+ ui_test_utils::WaitForTemplateURLServiceToLoad(
+ TemplateURLServiceFactory::GetForProfile(browser()->profile()));
LocationBar* location_bar = GetLocationBar(incognito_browser);
AutocompleteController* autocomplete_controller =