| 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 95d5d138aaa3d1659ccde27314466576eb4e82c0..30a587b7ed9bdf812a0ea4555b6fd189ef72078d 100644
|
| --- a/chrome/browser/ui/search/instant_extended_interactive_uitest.cc
|
| +++ b/chrome/browser/ui/search/instant_extended_interactive_uitest.cc
|
| @@ -7,6 +7,7 @@
|
| #include "base/prefs/pref_service.h"
|
| #include "base/string_util.h"
|
| #include "base/stringprintf.h"
|
| +#include "base/strings/string_number_conversions.h"
|
| #include "base/utf_string_conversions.h"
|
| #include "chrome/browser/autocomplete/autocomplete_controller.h"
|
| #include "chrome/browser/autocomplete/autocomplete_match.h"
|
| @@ -35,6 +36,7 @@
|
| #include "chrome/browser/ui/tabs/tab_strip_model.h"
|
| #include "chrome/browser/ui/webui/theme_source.h"
|
| #include "chrome/common/chrome_notification_types.h"
|
| +#include "chrome/common/chrome_switches.h"
|
| #include "chrome/common/pref_names.h"
|
| #include "chrome/common/thumbnail_score.h"
|
| #include "chrome/common/url_constants.h"
|
| @@ -193,7 +195,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, OmniboxFocusLoadsInstant) {
|
| EXPECT_FALSE(instant()->GetOverlayContents());
|
|
|
| // Refocus the omnibox. The InstantController should've preloaded Instant.
|
| - FocusOmniboxAndWaitForInstantExtendedSupport();
|
| + FocusOmniboxAndWaitForInstantOverlayAndNTPSupport();
|
|
|
| EXPECT_FALSE(ui_test_utils::IsViewFocused(browser(), VIEW_ID_TAB_CONTAINER));
|
| EXPECT_TRUE(omnibox()->model()->has_focus());
|
| @@ -224,7 +226,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, InputShowsOverlay) {
|
| ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
|
|
|
| // Focus omnibox and confirm overlay isn't shown.
|
| - FocusOmniboxAndWaitForInstantExtendedSupport();
|
| + FocusOmniboxAndWaitForInstantOverlayAndNTPSupport();
|
| content::WebContents* overlay = instant()->GetOverlayContents();
|
| EXPECT_TRUE(overlay);
|
| EXPECT_FALSE(instant()->IsOverlayingSearchResults());
|
| @@ -240,7 +242,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, InputShowsOverlay) {
|
| IN_PROC_BROWSER_TEST_F(InstantExtendedTest,
|
| MiddleClickOnSuggestionOpensInNewTab) {
|
| ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
|
| - FocusOmniboxAndWaitForInstantExtendedSupport();
|
| + FocusOmniboxAndWaitForInstantOverlayAndNTPSupport();
|
| EXPECT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser()));
|
|
|
| EXPECT_EQ(1, browser()->tab_strip_model()->count());
|
| @@ -278,7 +280,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest,
|
| IN_PROC_BROWSER_TEST_F(InstantExtendedTest,
|
| UnfocusingOmniboxDoesNotChangeSuggestions) {
|
| ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
|
| - FocusOmniboxAndWaitForInstantExtendedSupport();
|
| + FocusOmniboxAndWaitForInstantOverlayAndNTPSupport();
|
| EXPECT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser()));
|
|
|
| // Get a committed tab to work with.
|
| @@ -304,7 +306,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest,
|
| // Test that omnibox text is correctly set when overlay is committed with Enter.
|
| IN_PROC_BROWSER_TEST_F(InstantExtendedTest, OmniboxTextUponEnterCommit) {
|
| ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
|
| - FocusOmniboxAndWaitForInstantExtendedSupport();
|
| + FocusOmniboxAndWaitForInstantOverlayAndNTPSupport();
|
|
|
| // The page will autocomplete once we set the omnibox value.
|
| EXPECT_TRUE(ExecuteScript("suggestion = 'santa claus';"));
|
| @@ -329,7 +331,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, OmniboxTextUponEnterCommit) {
|
| // Test that omnibox text is correctly set when committed with focus lost.
|
| IN_PROC_BROWSER_TEST_F(InstantExtendedTest, OmniboxTextUponFocusLostCommit) {
|
| ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
|
| - FocusOmniboxAndWaitForInstantExtendedSupport();
|
| + FocusOmniboxAndWaitForInstantOverlayAndNTPSupport();
|
|
|
| // Set autocomplete text (grey text).
|
| EXPECT_TRUE(ExecuteScript("suggestion = 'johnny depp';"));
|
| @@ -355,7 +357,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest,
|
| OmniboxTextUponFocusedCommittedSERP) {
|
| // Setup Instant.
|
| ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
|
| - FocusOmniboxAndWaitForInstantExtendedSupport();
|
| + FocusOmniboxAndWaitForInstantOverlayAndNTPSupport();
|
|
|
| // Create an observer to wait for the instant tab to support Instant.
|
| content::WindowedNotificationObserver observer(
|
| @@ -389,7 +391,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest,
|
| NavigationSuggestionIsDiscardedUponSearchSuggestion) {
|
| // Setup Instant.
|
| ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
|
| - FocusOmniboxAndWaitForInstantExtendedSupport();
|
| + FocusOmniboxAndWaitForInstantOverlayAndNTPSupport();
|
|
|
| // Tell the page to send a URL suggestion.
|
| EXPECT_TRUE(ExecuteScript("suggestion = 'http://www.example.com';"
|
| @@ -417,7 +419,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest,
|
| // navigate through the suggested results and back to the original user query.
|
| IN_PROC_BROWSER_TEST_F(InstantExtendedTest, NavigateSuggestionsWithArrowKeys) {
|
| ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
|
| - FocusOmniboxAndWaitForInstantExtendedSupport();
|
| + FocusOmniboxAndWaitForInstantOverlayAndNTPSupport();
|
|
|
| ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("hello"));
|
| EXPECT_EQ("hello", GetOmniboxText());
|
| @@ -463,7 +465,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, NavigateSuggestionsWithArrowKeys) {
|
| IN_PROC_BROWSER_TEST_F(InstantExtendedTest,
|
| MAYBE_NavigateToURLSuggestionHitEnterAndLookForSubmit) {
|
| ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
|
| - FocusOmniboxAndWaitForInstantExtendedSupport();
|
| + FocusOmniboxAndWaitForInstantOverlayAndNTPSupport();
|
|
|
| // Create an observer to wait for the instant tab to support Instant.
|
| content::WindowedNotificationObserver observer(
|
| @@ -508,7 +510,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest,
|
| // original user query.
|
| IN_PROC_BROWSER_TEST_F(InstantExtendedTest, NavigateSuggestionsAndHitEscape) {
|
| ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
|
| - FocusOmniboxAndWaitForInstantExtendedSupport();
|
| + FocusOmniboxAndWaitForInstantOverlayAndNTPSupport();
|
|
|
| ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("hello"));
|
| EXPECT_EQ("hello", GetOmniboxText());
|
| @@ -537,7 +539,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, NavigateSuggestionsAndHitEscape) {
|
|
|
| IN_PROC_BROWSER_TEST_F(InstantExtendedTest, PressEscapeWithBlueText) {
|
| ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
|
| - FocusOmniboxAndWaitForInstantExtendedSupport();
|
| + FocusOmniboxAndWaitForInstantOverlayAndNTPSupport();
|
|
|
| // Set blue text completion.
|
| EXPECT_TRUE(ExecuteScript("suggestion = 'chimichanga.com';"
|
| @@ -574,7 +576,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, PressEscapeWithBlueText) {
|
|
|
| IN_PROC_BROWSER_TEST_F(InstantExtendedTest, PressEscapeWithGrayText) {
|
| ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
|
| - FocusOmniboxAndWaitForInstantExtendedSupport();
|
| + FocusOmniboxAndWaitForInstantOverlayAndNTPSupport();
|
|
|
| // Set gray text completion.
|
| EXPECT_TRUE(ExecuteScript("suggestion = 'cowabunga';"
|
| @@ -612,7 +614,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, PressEscapeWithGrayText) {
|
| IN_PROC_BROWSER_TEST_F(InstantExtendedTest, NTPIsPreloaded) {
|
| // Setup Instant.
|
| ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
|
| - FocusOmniboxAndWaitForInstantExtendedSupport();
|
| + FocusOmniboxAndWaitForInstantOverlayAndNTPSupport();
|
|
|
| // NTP contents should be preloaded.
|
| ASSERT_NE(static_cast<InstantNTP*>(NULL), instant()->ntp());
|
| @@ -623,7 +625,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, NTPIsPreloaded) {
|
| IN_PROC_BROWSER_TEST_F(InstantExtendedTest, PreloadedNTPIsUsedInNewTab) {
|
| // Setup Instant.
|
| ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
|
| - FocusOmniboxAndWaitForInstantExtendedSupport();
|
| + FocusOmniboxAndWaitForInstantOverlayAndNTPSupport();
|
|
|
| // NTP contents should be preloaded.
|
| ASSERT_NE(static_cast<InstantNTP*>(NULL), instant()->ntp());
|
| @@ -645,7 +647,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, PreloadedNTPIsUsedInNewTab) {
|
| IN_PROC_BROWSER_TEST_F(InstantExtendedTest, PreloadedNTPIsUsedInSameTab) {
|
| // Setup Instant.
|
| ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
|
| - FocusOmniboxAndWaitForInstantExtendedSupport();
|
| + FocusOmniboxAndWaitForInstantOverlayAndNTPSupport();
|
|
|
| // NTP contents should be preloaded.
|
| ASSERT_NE(static_cast<InstantNTP*>(NULL), instant()->ntp());
|
| @@ -669,7 +671,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest,
|
| DISABLED_PreloadedNTPForWrongProvider) {
|
| // Setup Instant.
|
| ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
|
| - FocusOmniboxAndWaitForInstantExtendedSupport();
|
| + FocusOmniboxAndWaitForInstantOverlayAndNTPSupport();
|
|
|
| // NTP contents should be preloaded.
|
| ASSERT_NE(static_cast<InstantNTP*>(NULL), instant()->ntp());
|
| @@ -694,7 +696,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest,
|
| IN_PROC_BROWSER_TEST_F(InstantExtendedTest, OmniboxHasFocusOnNewTab) {
|
| // Setup Instant.
|
| ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
|
| - FocusOmniboxAndWaitForInstantExtendedSupport();
|
| + FocusOmniboxAndWaitForInstantOverlayAndNTPSupport();
|
|
|
| // Explicitly unfocus the omnibox.
|
| EXPECT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser()));
|
| @@ -715,7 +717,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, OmniboxHasFocusOnNewTab) {
|
| IN_PROC_BROWSER_TEST_F(InstantExtendedTest, OmniboxEmptyOnNewTabPage) {
|
| // Setup Instant.
|
| ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
|
| - FocusOmniboxAndWaitForInstantExtendedSupport();
|
| + FocusOmniboxAndWaitForInstantOverlayAndNTPSupport();
|
|
|
| // Open new tab. Preloaded NTP contents should have been used.
|
| ui_test_utils::NavigateToURLWithDisposition(
|
| @@ -732,7 +734,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, OmniboxEmptyOnNewTabPage) {
|
| IN_PROC_BROWSER_TEST_F(InstantExtendedTest, DISABLED_NoFaviconOnNewTabPage) {
|
| // Setup Instant.
|
| ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
|
| - FocusOmniboxAndWaitForInstantExtendedSupport();
|
| + FocusOmniboxAndWaitForInstantOverlayAndNTPSupport();
|
|
|
| // Open new tab. Preloaded NTP contents should have been used.
|
| ui_test_utils::NavigateToURLWithDisposition(
|
| @@ -759,7 +761,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, InputOnNTPDoesntShowOverlay) {
|
| ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
|
|
|
| // Focus omnibox and confirm overlay isn't shown.
|
| - FocusOmniboxAndWaitForInstantExtendedSupport();
|
| + FocusOmniboxAndWaitForInstantOverlayAndNTPSupport();
|
| content::WebContents* overlay = instant()->GetOverlayContents();
|
| EXPECT_TRUE(overlay);
|
| EXPECT_FALSE(instant()->IsOverlayingSearchResults());
|
| @@ -790,7 +792,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, ProcessIsolation) {
|
|
|
| // Setup Instant.
|
| ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
|
| - FocusOmniboxAndWaitForInstantExtendedSupport();
|
| + FocusOmniboxAndWaitForInstantOverlayAndNTPSupport();
|
|
|
| // The registered Instant render process should still exist.
|
| EXPECT_EQ(1, instant_service->GetInstantProcessCount());
|
| @@ -820,6 +822,74 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, ProcessIsolation) {
|
| active_tab->GetRenderProcessHost()->GetID()));
|
| }
|
|
|
| +// Test that a search query will not be displayed for navsuggest queries.
|
| +IN_PROC_BROWSER_TEST_F(
|
| + InstantExtendedTest, SearchQueryNotDisplayedForNavsuggest) {
|
| + // Use only the local overlay.
|
| + CommandLine::ForCurrentProcess()->AppendSwitch(
|
| + switches::kEnableLocalOnlyInstantExtendedAPI);
|
| + ASSERT_TRUE(chrome::IsLocalOnlyInstantExtendedAPIEnabled());
|
| +
|
| + ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
|
| +
|
| + // The second argument indicates to use only the local overlay and NTP.
|
| + instant()->SetInstantEnabled(true, true);
|
| +
|
| + // Focus omnibox and confirm overlay isn't shown.
|
| + FocusOmniboxAndWaitForInstantOverlaySupport();
|
| +
|
| + // Typing in the omnibox should show the overlay.
|
| + SetOmniboxText("face");
|
| +
|
| + // Create an event listener that opens the top suggestion in a new tab.
|
| + content::WebContents* overlay = instant()->GetOverlayContents();
|
| +
|
| + // Add a navsuggest suggestion.
|
| + instant()->SetSuggestions(
|
| + instant()->overlay()->contents(),
|
| + std::vector<InstantSuggestion>(
|
| + 1,
|
| + InstantSuggestion(ASCIIToUTF16("http://facemash.com/"),
|
| + INSTANT_COMPLETE_NOW,
|
| + INSTANT_SUGGESTION_URL,
|
| + ASCIIToUTF16("face"))));
|
| +
|
| + while (!omnibox()->model()->autocomplete_controller()->done()) {
|
| + content::WindowedNotificationObserver autocomplete_observer(
|
| + chrome::NOTIFICATION_AUTOCOMPLETE_CONTROLLER_RESULT_READY,
|
| + content::NotificationService::AllSources());
|
| + autocomplete_observer.Wait();
|
| + }
|
| +
|
| + std::string nativeSuggestionString =
|
| + "chrome.embeddedSearch.searchBox.nativeSuggestions";
|
| +
|
| + int nativeSuggestionsLength;
|
| + EXPECT_TRUE(
|
| + GetIntFromJS(overlay, nativeSuggestionString + ".length",
|
| + &nativeSuggestionsLength));
|
| + for (int i = 0; i < nativeSuggestionsLength; ++i) {
|
| + std::string nativeSuggestionsAtIndex =
|
| + nativeSuggestionString + "[" + base::IntToString(i) + "]";
|
| +
|
| + bool isSearchPropertyExists;
|
| + EXPECT_TRUE(GetBoolFromJS(overlay, nativeSuggestionsAtIndex +
|
| + ".hasOwnProperty('is_search')", &isSearchPropertyExists));
|
| +
|
| + // Verify that if this is a search suggestion the type is not navsuggest.
|
| + if (isSearchPropertyExists) {
|
| + bool is_search;
|
| + EXPECT_TRUE(GetBoolFromJS(
|
| + overlay, nativeSuggestionsAtIndex + ".is_search", &is_search));
|
| +
|
| + std::string type;
|
| + EXPECT_TRUE(
|
| + GetStringFromJS(overlay, nativeSuggestionsAtIndex + ".type", &type));
|
| + EXPECT_FALSE(is_search && type == "navsuggest");
|
| + }
|
| + }
|
| +}
|
| +
|
| // Verification of fix for BUG=176365. Ensure that each Instant WebContents in
|
| // a tab uses a new BrowsingInstance, to avoid conflicts in the
|
| // NavigationController.
|
| @@ -827,7 +897,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, ProcessIsolation) {
|
| IN_PROC_BROWSER_TEST_F(InstantExtendedTest, DISABLED_UnrelatedSiteInstance) {
|
| // Setup Instant.
|
| ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
|
| - FocusOmniboxAndWaitForInstantExtendedSupport();
|
| + FocusOmniboxAndWaitForInstantOverlayAndNTPSupport();
|
|
|
| // Check that the uncommited ntp page and uncommited overlay have unrelated
|
| // site instances.
|
| @@ -872,7 +942,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, DISABLED_UnrelatedSiteInstance) {
|
| // Tests that suggestions are sanity checked.
|
| IN_PROC_BROWSER_TEST_F(InstantExtendedTest, ValidatesSuggestions) {
|
| ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
|
| - FocusOmniboxAndWaitForInstantExtendedSupport();
|
| + FocusOmniboxAndWaitForInstantOverlayAndNTPSupport();
|
|
|
| // Do not set gray text that is not a suffix of the query.
|
| EXPECT_TRUE(ExecuteScript("suggestion = 'potato';"
|
| @@ -960,7 +1030,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, ValidatesSuggestions) {
|
| IN_PROC_BROWSER_TEST_F(InstantExtendedTest,
|
| NavigationSuggestionIsNotDiscarded) {
|
| ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
|
| - FocusOmniboxAndWaitForInstantExtendedSupport();
|
| + FocusOmniboxAndWaitForInstantOverlayAndNTPSupport();
|
|
|
| // Tell the page to send a URL suggestion.
|
| EXPECT_TRUE(ExecuteScript("suggestion = 'http://www.example.com';"
|
| @@ -981,7 +1051,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, DISABLED_MostVisited) {
|
| content::NotificationService::AllSources());
|
| // Initialize Instant.
|
| ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
|
| - FocusOmniboxAndWaitForInstantExtendedSupport();
|
| + FocusOmniboxAndWaitForInstantOverlayAndNTPSupport();
|
|
|
| // Get a handle to the NTP and the current state of the JS.
|
| ASSERT_NE(static_cast<InstantNTP*>(NULL), instant()->ntp());
|
| @@ -1069,7 +1139,7 @@ IN_PROC_BROWSER_TEST_F(InstantPolicyTest, ThemeBackgroundAccess) {
|
| InstallThemeSource();
|
| ASSERT_NO_FATAL_FAILURE(InstallThemeAndVerify("theme", "camo theme"));
|
| ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
|
| - FocusOmniboxAndWaitForInstantExtendedSupport();
|
| + FocusOmniboxAndWaitForInstantOverlayAndNTPSupport();
|
|
|
| // The "Instant" New Tab should have access to chrome-search: scheme but not
|
| // chrome: scheme.
|
| @@ -1102,7 +1172,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, DISABLED_FaviconAccess) {
|
| EXPECT_TRUE(top_sites->SetPageThumbnail(url, thumbnail, high_score));
|
|
|
| ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
|
| - FocusOmniboxAndWaitForInstantExtendedSupport();
|
| + FocusOmniboxAndWaitForInstantOverlayAndNTPSupport();
|
|
|
| // The "Instant" New Tab should have access to chrome-search: scheme but not
|
| // chrome: scheme.
|
| @@ -1130,7 +1200,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, DISABLED_FaviconAccess) {
|
| // WebUIBindings should never be enabled on ANY Instant web contents.
|
| IN_PROC_BROWSER_TEST_F(InstantExtendedTest, NoWebUIBindingsOnNTP) {
|
| ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
|
| - FocusOmniboxAndWaitForInstantExtendedSupport();
|
| + FocusOmniboxAndWaitForInstantOverlayAndNTPSupport();
|
|
|
| ui_test_utils::NavigateToURLWithDisposition(
|
| browser(),
|
| @@ -1147,7 +1217,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, NoWebUIBindingsOnNTP) {
|
| // WebUIBindings should never be enabled on ANY Instant web contents.
|
| IN_PROC_BROWSER_TEST_F(InstantExtendedTest, NoWebUIBindingsOnPreview) {
|
| ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
|
| - FocusOmniboxAndWaitForInstantExtendedSupport();
|
| + FocusOmniboxAndWaitForInstantOverlayAndNTPSupport();
|
|
|
| // Typing in the omnibox shows the overlay.
|
| ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("query"));
|
| @@ -1162,7 +1232,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, NoWebUIBindingsOnPreview) {
|
| // WebUIBindings should never be enabled on ANY Instant web contents.
|
| IN_PROC_BROWSER_TEST_F(InstantExtendedTest, NoWebUIBindingsOnResults) {
|
| ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
|
| - FocusOmniboxAndWaitForInstantExtendedSupport();
|
| + FocusOmniboxAndWaitForInstantOverlayAndNTPSupport();
|
|
|
| // Typing in the omnibox shows the overlay.
|
| ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("query"));
|
| @@ -1228,7 +1298,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest,
|
| ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
|
|
|
| // Focus omnibox and confirm overlay isn't shown.
|
| - FocusOmniboxAndWaitForInstantExtendedSupport();
|
| + FocusOmniboxAndWaitForInstantOverlayAndNTPSupport();
|
| content::WebContents* overlay = instant()->GetOverlayContents();
|
| EXPECT_TRUE(overlay);
|
| EXPECT_TRUE(instant()->model()->mode().is_default());
|
| @@ -1267,7 +1337,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest,
|
| ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
|
|
|
| // Focus omnibox and confirm overlay isn't shown.
|
| - FocusOmniboxAndWaitForInstantExtendedSupport();
|
| + FocusOmniboxAndWaitForInstantOverlayAndNTPSupport();
|
| content::WebContents* overlay = instant()->GetOverlayContents();
|
| EXPECT_TRUE(overlay);
|
| EXPECT_TRUE(instant()->model()->mode().is_default());
|
| @@ -1320,7 +1390,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, TransientEntrySet) {
|
| ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
|
|
|
| // Focus omnibox and confirm overlay isn't shown.
|
| - FocusOmniboxAndWaitForInstantSupport();
|
| + FocusOmniboxAndWaitForInstantOverlaySupport();
|
| content::WebContents* overlay = instant()->GetOverlayContents();
|
| EXPECT_TRUE(overlay);
|
| EXPECT_TRUE(instant()->model()->mode().is_default());
|
| @@ -1356,7 +1426,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, DISABLED_TransientEntryRemoved) {
|
| ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
|
|
|
| // Focus omnibox and confirm overlay isn't shown.
|
| - FocusOmniboxAndWaitForInstantSupport();
|
| + FocusOmniboxAndWaitForInstantOverlaySupport();
|
| content::WebContents* overlay = instant()->GetOverlayContents();
|
| EXPECT_TRUE(overlay);
|
| EXPECT_TRUE(instant()->model()->mode().is_default());
|
| @@ -1398,7 +1468,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, DISABLED_TransientEntryRemoved) {
|
| IN_PROC_BROWSER_TEST_F(InstantExtendedTest, RestrictedItemReadback) {
|
| // Initialize Instant.
|
| ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
|
| - FocusOmniboxAndWaitForInstantSupport();
|
| + FocusOmniboxAndWaitForInstantOverlaySupport();
|
|
|
| // Get a handle to the NTP and the current state of the JS.
|
| ASSERT_NE(static_cast<InstantNTP*>(NULL), instant()->ntp());
|
| @@ -1471,7 +1541,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, RestrictedItemReadback) {
|
| // providers are done.
|
| IN_PROC_BROWSER_TEST_F(InstantExtendedTest, AutocompleteProvidersDone) {
|
| ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
|
| - FocusOmniboxAndWaitForInstantExtendedSupport();
|
| + FocusOmniboxAndWaitForInstantOverlayAndNTPSupport();
|
|
|
| content::WebContents* overlay = instant()->GetOverlayContents();
|
| EXPECT_TRUE(UpdateSearchState(overlay));
|
| @@ -1508,7 +1578,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, LocalNTPIsNotPreloaded) {
|
| IN_PROC_BROWSER_TEST_F(InstantExtendedTest,
|
| MAYBE_TopBarsVisibilityWhenSwitchingTabs) {
|
| ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
|
| - FocusOmniboxAndWaitForInstantExtendedSupport();
|
| + FocusOmniboxAndWaitForInstantOverlayAndNTPSupport();
|
|
|
| // Open 2 tabs of |DFEAULT| mode.
|
| ui_test_utils::NavigateToURLWithDisposition(
|
| @@ -1598,7 +1668,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, DISABLED_HasBookmarkProvider) {
|
| // Test that the omnibox's temporary text is reset when the popup is closed.
|
| IN_PROC_BROWSER_TEST_F(InstantExtendedTest, TemporaryTextResetWhenPopupClosed) {
|
| ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
|
| - FocusOmniboxAndWaitForInstantExtendedSupport();
|
| + FocusOmniboxAndWaitForInstantOverlayAndNTPSupport();
|
| EXPECT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser()));
|
|
|
| // Show the overlay and arrow-down to a suggestion (this sets temporary text).
|
| @@ -1630,7 +1700,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, TemporaryTextResetWhenPopupClosed) {
|
| IN_PROC_BROWSER_TEST_F(InstantExtendedTest,
|
| NoAutocompleteResultsWhenPopupClosed) {
|
| ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
|
| - FocusOmniboxAndWaitForInstantExtendedSupport();
|
| + FocusOmniboxAndWaitForInstantOverlayAndNTPSupport();
|
| EXPECT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser()));
|
|
|
| // Show the overlay and arrow-down to a suggestion (this sets temporary text).
|
| @@ -1660,7 +1730,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest,
|
| // Test that suggestions are not accepted when unexpected.
|
| IN_PROC_BROWSER_TEST_F(InstantExtendedTest, DeniesUnexpectedSuggestions) {
|
| ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
|
| - FocusOmniboxAndWaitForInstantExtendedSupport();
|
| + FocusOmniboxAndWaitForInstantOverlayAndNTPSupport();
|
| ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("chip"));
|
| SendDownArrow();
|
|
|
| @@ -1679,7 +1749,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, DeniesUnexpectedSuggestions) {
|
| // Test that autocomplete results are cleared when the query is cleared.
|
| IN_PROC_BROWSER_TEST_F(InstantExtendedTest, EmptyAutocompleteResults) {
|
| ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
|
| - FocusOmniboxAndWaitForInstantExtendedSupport();
|
| + FocusOmniboxAndWaitForInstantOverlayAndNTPSupport();
|
|
|
| // Type a URL, so that there's at least one autocomplete result (a "URL what
|
| // you typed" match).
|
| @@ -1707,7 +1777,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, EmptyAutocompleteResults) {
|
| // Test that hitting Esc to clear the omnibox works. http://crbug.com/231744.
|
| IN_PROC_BROWSER_TEST_F(InstantExtendedTest, EscapeClearsOmnibox) {
|
| ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
|
| - FocusOmniboxAndWaitForInstantExtendedSupport();
|
| + FocusOmniboxAndWaitForInstantOverlayAndNTPSupport();
|
|
|
| // Navigate to the Instant NTP, and wait for it to be recognized.
|
| content::WindowedNotificationObserver instant_tab_observer(
|
|
|