Index: chrome/browser/ui/search/instant_test_utils.cc |
diff --git a/chrome/browser/ui/search/instant_test_utils.cc b/chrome/browser/ui/search/instant_test_utils.cc |
index 50eb25c84044d07979953cd0ad0ba29817c68f4e..6e8015e01546b6d908f5d36bf2dbdb6b61290458 100644 |
--- a/chrome/browser/ui/search/instant_test_utils.cc |
+++ b/chrome/browser/ui/search/instant_test_utils.cc |
@@ -58,7 +58,7 @@ void InstantTestBase::SetupInstant(Browser* browser) { |
InstantService* instant_service = |
InstantServiceFactory::GetForProfile(browser_->profile()); |
ASSERT_NE(static_cast<InstantService*>(NULL), instant_service); |
- instant_service->ntp_prerenderer()->ReloadStaleNTP(); |
+ instant_service->ntp_prerenderer()->ReloadInstantNTP(); |
} |
void InstantTestBase::SetInstantURL(const std::string& url) { |
@@ -90,16 +90,20 @@ void InstantTestBase::FocusOmnibox() { |
} |
void InstantTestBase::FocusOmniboxAndWaitForInstantNTPSupport() { |
+ FocusOmnibox(); |
+ WaitForInstantNTPSupport(); |
+} |
+ |
+void InstantTestBase::WaitForInstantNTPSupport() { |
content::WindowedNotificationObserver ntp_observer( |
chrome::NOTIFICATION_INSTANT_NTP_SUPPORT_DETERMINED, |
content::NotificationService::AllSources()); |
- FocusOmnibox(); |
samarth
2013/08/12 19:07:28
Are you sure this doesn't break any tests? You gen
Anuj
2013/08/13 00:18:09
Removed. I was earlier trying to make use of Insta
|
InstantService* instant_service = |
InstantServiceFactory::GetForProfile(browser_->profile()); |
ASSERT_NE(static_cast<InstantService*>(NULL), instant_service); |
- if (!instant_service->ntp_prerenderer()->ntp() || |
- !instant_service->ntp_prerenderer()->ntp()->supports_instant()) |
+ InstantNTP* ntp = instant_service->ntp_prerenderer()->ntp(); |
+ if (!ntp || !ntp->supports_instant()) |
ntp_observer.Wait(); |
} |