Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(611)

Unified Diff: chrome/browser/extensions/extension_omnibox_apitest.cc

Issue 2485004: Attempt to fix flaky OmniboxApiTest.Basic. (Closed)
Patch Set: Created 10 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/test/data/extensions/api_test/omnibox/test.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_omnibox_apitest.cc
diff --git a/chrome/browser/extensions/extension_omnibox_apitest.cc b/chrome/browser/extensions/extension_omnibox_apitest.cc
index 15b3d733780c06cfa4e5164c9a4eb272f6b603e5..94baf6ff0a5b43172100392f2134ed8ad17f57b1 100644
--- a/chrome/browser/extensions/extension_omnibox_apitest.cc
+++ b/chrome/browser/extensions/extension_omnibox_apitest.cc
@@ -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();
« no previous file with comments | « no previous file | chrome/test/data/extensions/api_test/omnibox/test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698