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

Unified Diff: chrome/browser/ui/search/instant_test_utils.cc

Issue 20388003: Reload Instant NTP and Instant-process tabs on search url change (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Format and lint Created 7 years, 4 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
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();
}

Powered by Google App Engine
This is Rietveld 408576698