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

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

Issue 14843002: InstantExtended: don't reset InstantTab if not ready. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add test. Created 7 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 | « chrome/browser/ui/search/instant_controller.cc ('k') | chrome/browser/ui/search/instant_page.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4147a2895aac16151d0ccba3ac517fc8e486eab5..c94e592448ff5d827b0cc5711b6e3fe435889eca 100644
--- a/chrome/browser/ui/search/instant_extended_interactive_uitest.cc
+++ b/chrome/browser/ui/search/instant_extended_interactive_uitest.cc
@@ -2285,3 +2285,34 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, SearchProviderRunsForFallback) {
// - Search history suggestion for "query"
EXPECT_EQ(2, CountSearchProviderSuggestions());
}
+
+IN_PROC_BROWSER_TEST_F(InstantExtendedTest, UsesOverlayIfTabNotReady) {
+ ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
+ FocusOmniboxAndWaitForInstantOverlayAndNTPSupport();
+
+ // Navigate to the NTP, and wait for it to be recognized.
+ content::WindowedNotificationObserver instant_tab_observer(
+ chrome::NOTIFICATION_INSTANT_TAB_SUPPORT_DETERMINED,
+ content::NotificationService::AllSources());
+ ui_test_utils::NavigateToURLWithDisposition(browser(),
+ GURL(chrome::kChromeUINewTabURL),
+ NEW_FOREGROUND_TAB,
+ ui_test_utils::BROWSER_TEST_NONE);
+ instant_tab_observer.Wait();
+ ASSERT_TRUE(instant()->instant_tab()->supports_instant());
+
+ // Turn off Instant support for the tab and type in the omnibox. Should use
+ // the overlay.
+ instant()->instant_tab_->supports_instant_ = false;
sreeram 2013/05/05 21:06:41 Why do this? If you removed the observer and obser
samarth 2013/05/05 21:18:34 Ah yes, that's better. Done.
+ ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("query"));
+ // But Instant tab should still exist
+ EXPECT_NE(static_cast<InstantTab*>(NULL), instant()->instant_tab());
+ EXPECT_FALSE(instant()->UseTabForSuggestions());
+
+ // Restore Instant support for the tab and force the overlay to be hidden.
+ instant()->instant_tab_->supports_instant_ = true;
+ instant()->HideOverlay();
+
+ // Now, we should be using Instant tab for suggestions.
+ EXPECT_TRUE(instant()->UseTabForSuggestions());
+}
« no previous file with comments | « chrome/browser/ui/search/instant_controller.cc ('k') | chrome/browser/ui/search/instant_page.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698