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

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

Issue 14043009: Fall back to local page if online NTP fails to load. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove search_tab_helper changes Created 7 years, 8 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_extended_interactive_uitest.cc
diff --git a/chrome/browser/ui/search/instant_extended_interactive_uitest.cc b/chrome/browser/ui/search/instant_extended_interactive_uitest.cc
index b9d31d61d21faf12ffdb4b7deacb3f37f547fab1..46e62df07dc5f4c3b3a4ca5f050e8831af685831 100644
--- a/chrome/browser/ui/search/instant_extended_interactive_uitest.cc
+++ b/chrome/browser/ui/search/instant_extended_interactive_uitest.cc
@@ -702,6 +702,44 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest,
EXPECT_NE(ntp_url, active_tab->GetURL());
}
+IN_PROC_BROWSER_TEST_F(InstantExtendedTest, RedirectToLocalOnLoadFailure) {
samarth 2013/05/02 03:12:56 Please also add a test to test that instanttabs ge
David Black 2013/05/02 05:02:49 Ok. Will work on that (and on making this test wo
+ // Change providers.
+ InstantTestBase::Init(GURL("chrome://path-that-will-surely-404"));//asdf
+
+ // Setup Instant.
+ ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
+ FocusOmniboxAndWaitForInstantOverlayAndNTPSupport();
+
+ content::WindowedNotificationObserver instant_tab_observer(
+ chrome::NOTIFICATION_INSTANT_TAB_SUPPORT_DETERMINED,
+ content::NotificationService::AllSources());
+ instant_tab_observer.Wait();
+
+ // DO NOT SUBMIT: None of this works yet.
+
+ // NTP contents should be preloaded.
+ ASSERT_NE(static_cast<InstantNTP*>(NULL), instant()->ntp());
+ content::WebContents* ntp_contents = instant()->ntp_->contents();
+ EXPECT_TRUE(ntp_contents);
+ GURL ntp_url = ntp_contents->GetURL();
+ EXPECT_EQ(chrome::kChromeSearchLocalNtpUrl, ntp_url.spec());//DEBUG asdf
+
+ // Overlay contents should be preloaded.
+ ASSERT_NE(static_cast<InstantOverlay*>(NULL), instant()->overlay());
+ content::WebContents* overlay_contents = instant()->overlay_->contents();
+ EXPECT_TRUE(overlay_contents);
+ GURL overlay_url = overlay_contents->GetURL();
+ EXPECT_EQ(chrome::kChromeSearchLocalNtpUrl, overlay_url.spec());//DEBUG asdf
+
+ // Instant tab contents should be preloaded.
+ ASSERT_NE(static_cast<InstantTab*>(NULL), instant()->instant_tab());
+ content::WebContents* instant_tab_contents =
+ instant()->instant_tab_->contents();
+ EXPECT_TRUE(instant_tab_contents);
+ GURL instant_tab_url = instant_tab_contents->GetURL();
+ EXPECT_EQ(chrome::kChromeSearchLocalNtpUrl, instant_tab_url.spec());//DEBUG
+}
+
IN_PROC_BROWSER_TEST_F(InstantExtendedTest, OmniboxHasFocusOnNewTab) {
// Setup Instant.
ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));

Powered by Google App Engine
This is Rietveld 408576698