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

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

Issue 13963014: Local omnibox treats navsuggest suggestions as queries. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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_browsertest.cc
diff --git a/chrome/browser/ui/search/instant_extended_browsertest.cc b/chrome/browser/ui/search/instant_extended_browsertest.cc
index aebd5781a011eea21ac53c382e3438f9a6de9966..e90ee50c3e14c741f911bfd2f5feb3e68346e4a7 100644
--- a/chrome/browser/ui/search/instant_extended_browsertest.cc
+++ b/chrome/browser/ui/search/instant_extended_browsertest.cc
@@ -811,6 +811,28 @@ 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) {
+ ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
+ FocusOmniboxAndWaitForInstantExtendedSupport();
+ EXPECT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser()));
+
+ // Typing in the omnibox should show the overlay.
+ SetOmniboxTextAndWaitForOverlayToShow("cnn.com");
+
+ // Create an event listener that opens the top suggestion in a new tab.
+ EXPECT_TRUE(ExecuteScript(
+ "var suggestions = "
+ "chrome.embeddedSearch.searchBox.nativeSuggestions;"
+ "for (var i = 0, suggestion; suggestion = suggestions[i]; ++i) {"
+ "if (suggestion.is_search && suggestion.type == 'navsuggest')"
+ "return false;"
+ "}"
+ "return true;"
+ ));
+}
+
// Verification of fix for BUG=176365. Ensure that each Instant WebContents in
// a tab uses a new BrowsingInstance, to avoid conflicts in the
// NavigationController.

Powered by Google App Engine
This is Rietveld 408576698