| Index: chrome/browser/ui/omnibox/omnibox_view_browsertest.cc
|
| diff --git a/chrome/browser/ui/omnibox/omnibox_view_browsertest.cc b/chrome/browser/ui/omnibox/omnibox_view_browsertest.cc
|
| index 4a0f5c1a339d6e4a7506e04ddb8a2f17a5190113..af51e6c80b3947f0534db670874f59389bd6dd87 100644
|
| --- a/chrome/browser/ui/omnibox/omnibox_view_browsertest.cc
|
| +++ b/chrome/browser/ui/omnibox/omnibox_view_browsertest.cc
|
| @@ -137,7 +137,17 @@ const int kCtrlOrCmdMask = ui::EF_CONTROL_DOWN;
|
| } // namespace
|
|
|
| class OmniboxViewTest : public InProcessBrowserTest,
|
| - public content::NotificationObserver {
|
| + public content::NotificationObserver,
|
| + public history::HistoryServiceObserver {
|
| + public:
|
| + OmniboxViewTest() : observer_(this) {}
|
| +
|
| + // history::HisoryServiceObserver:
|
| + virtual void OnHistoryServiceLoaded(
|
| + HistoryService* history_service) override {
|
| + base::MessageLoop::current()->Quit();
|
| + }
|
| +
|
| protected:
|
| void SetUpOnMainThread() override {
|
| ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser()));
|
| @@ -282,9 +292,7 @@ class OmniboxViewTest : public InProcessBrowserTest,
|
| ASSERT_TRUE(history_service);
|
|
|
| if (!history_service->BackendLoaded()) {
|
| - content::NotificationRegistrar registrar;
|
| - registrar.Add(this, chrome::NOTIFICATION_HISTORY_LOADED,
|
| - content::Source<Profile>(profile));
|
| + observer_.Add(history_service);
|
| content::RunMessageLoop();
|
| }
|
|
|
| @@ -346,7 +354,6 @@ class OmniboxViewTest : public InProcessBrowserTest,
|
| case content::NOTIFICATION_WEB_CONTENTS_DESTROYED:
|
| case chrome::NOTIFICATION_TAB_PARENTED:
|
| case chrome::NOTIFICATION_AUTOCOMPLETE_CONTROLLER_RESULT_READY:
|
| - case chrome::NOTIFICATION_HISTORY_LOADED:
|
| case chrome::NOTIFICATION_HISTORY_URLS_MODIFIED:
|
| break;
|
| default:
|
| @@ -354,6 +361,9 @@ class OmniboxViewTest : public InProcessBrowserTest,
|
| }
|
| base::MessageLoop::current()->Quit();
|
| }
|
| +
|
| + private:
|
| + ScopedObserver<HistoryService, OmniboxViewTest> observer_;
|
| };
|
|
|
| // Test if ctrl-* accelerators are workable in omnibox.
|
|
|