Chromium Code Reviews| 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()); |
| +} |