summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions
diff options
context:
space:
mode:
authormpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-02 16:34:39 +0000
committermpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-02 16:34:39 +0000
commitfb4c4b4cc8f9391f382bd6429efc66c60444c63e (patch)
tree86947294ac6acbb29ea7562a76e85a31ed89b0a4 /chrome/browser/extensions
parentcf59628faab8ca22ae602292cc442dce1bf258c1 (diff)
downloadchromium_src-fb4c4b4cc8f9391f382bd6429efc66c60444c63e.zip
chromium_src-fb4c4b4cc8f9391f382bd6429efc66c60444c63e.tar.gz
chromium_src-fb4c4b4cc8f9391f382bd6429efc66c60444c63e.tar.bz2
Attempt to fix flaky OmniboxApiTest.Basic.
I'm making an educated guess that the TemplateURLModel wasn't loaded by the time we needed a keyword, so let's just wait for it to load. BUG=45588 Review URL: http://codereview.chromium.org/2485004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48729 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions')
-rw-r--r--chrome/browser/extensions/extension_omnibox_apitest.cc21
1 files changed, 12 insertions, 9 deletions
diff --git a/chrome/browser/extensions/extension_omnibox_apitest.cc b/chrome/browser/extensions/extension_omnibox_apitest.cc
index 15b3d73..a012d8e 100644
--- a/chrome/browser/extensions/extension_omnibox_apitest.cc
+++ b/chrome/browser/extensions/extension_omnibox_apitest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -9,9 +9,9 @@
#include "chrome/browser/browser.h"
#include "chrome/browser/browser_window.h"
#include "chrome/browser/extensions/extension_apitest.h"
-#include "chrome/browser/history/history.h"
#include "chrome/browser/location_bar.h"
#include "chrome/browser/profile.h"
+#include "chrome/browser/search_engines/template_url_model.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/notification_type.h"
#include "chrome/common/url_constants.h"
@@ -44,11 +44,14 @@ class OmniboxApiTest : public ExtensionApiTest {
autocomplete_controller();
}
- void WaitForHistoryBackendToLoad() {
- HistoryService* history_service =
- browser()->profile()->GetHistoryService(Profile::EXPLICIT_ACCESS);
- if (!history_service->BackendLoaded())
- ui_test_utils::WaitForNotification(NotificationType::HISTORY_LOADED);
+ void WaitForTemplateURLModelToLoad() {
+ TemplateURLModel* model =
+ browser()->profile()->GetTemplateURLModel();
+ model->Load();
+ if (!model->loaded()) {
+ ui_test_utils::WaitForNotification(
+ NotificationType::TEMPLATE_URL_MODEL_LOADED);
+ }
}
void WaitForAutocompleteDone(AutocompleteController* controller) {
@@ -66,9 +69,9 @@ IN_PROC_BROWSER_TEST_F(OmniboxApiTest, Basic) {
ASSERT_TRUE(StartHTTPServer());
ASSERT_TRUE(RunExtensionTest("omnibox")) << message_;
- // The results depend on the history backend being loaded. Make sure it is
+ // The results depend on the TemplateURLModel being loaded. Make sure it is
// loaded so that the autocomplete results are consistent.
- WaitForHistoryBackendToLoad();
+ WaitForTemplateURLModelToLoad();
LocationBar* location_bar = GetLocationBar();
AutocompleteController* autocomplete_controller = GetAutocompleteController();