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

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: 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') | no next file » | 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..bd4e7d98e0886a9c65b2f17d4750efa3ebe03e75 100644
--- a/chrome/browser/ui/search/instant_extended_interactive_uitest.cc
+++ b/chrome/browser/ui/search/instant_extended_interactive_uitest.cc
@@ -315,6 +315,35 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, InputShowsOverlay) {
EXPECT_EQ(overlay, instant()->GetOverlayContents());
}
+IN_PROC_BROWSER_TEST_F(InstantExtendedTest, UsesOverlayIfTabNotReady) {
+ ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
+ FocusOmniboxAndWaitForInstantOverlayAndNTPSupport();
+
+ // Open a new tab and start typing before InstantTab is properly hooked up.
+ // Should use the overlay.
+ ui_test_utils::NavigateToURLWithDisposition(browser(),
+ GURL(chrome::kChromeUINewTabURL),
+ NEW_FOREGROUND_TAB,
+ ui_test_utils::BROWSER_TEST_NONE);
+ ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("query"));
+
+ // But Instant tab should still exist.
+ ASSERT_NE(static_cast<InstantTab*>(NULL), instant()->instant_tab());
+ EXPECT_FALSE(instant()->UseTabForSuggestions());
+
+ // Wait for Instant Tab support if it still hasn't finished loading.
+ if (!instant()->instant_tab()->supports_instant()) {
+ content::WindowedNotificationObserver instant_tab_observer(
+ chrome::NOTIFICATION_INSTANT_TAB_SUPPORT_DETERMINED,
+ content::NotificationService::AllSources());
+ instant_tab_observer.Wait();
+ }
+
+ // Hide the overlay. Now, we should be using Instant tab for suggestions.
+ instant()->HideOverlay();
+ EXPECT_TRUE(instant()->UseTabForSuggestions());
+}
+
// Test that middle clicking on a suggestion opens the result in a new tab.
IN_PROC_BROWSER_TEST_F(InstantExtendedTest,
MiddleClickOnSuggestionOpensInNewTab) {
« no previous file with comments | « chrome/browser/ui/search/instant_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698