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

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
« 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_browsertest.cc
diff --git a/chrome/browser/ui/search/instant_extended_browsertest.cc b/chrome/browser/ui/search/instant_extended_browsertest.cc
index aebd5781a011eea21ac53c382e3438f9a6de9966..959ce82b83aa6dc2e900304aee4fe75b86bda4c7 100644
--- a/chrome/browser/ui/search/instant_extended_browsertest.cc
+++ b/chrome/browser/ui/search/instant_extended_browsertest.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"
@@ -811,6 +812,43 @@ 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.
+ content::WebContents* overlay = instant()->GetOverlayContents();
+ int i = 0;
+ while (true) {
+ std::string nativeSuggestionsAtIndex =
+ "chrome.embeddedSearch.searchBox.nativeSuggestions[" +
+ base::IntToString(i) + "]";
+
+ if (!ExecuteScript(nativeSuggestionsAtIndex))
+ break;
+
+ if (ExecuteScript(nativeSuggestionsAtIndex+".is_search")) {
+ 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");
+ }
+
+ ++i;
+ }
+}
sreeram 2013/04/18 17:51:40 This test uses the server overlay. We don't send a
dougw 2013/04/19 01:11:09 Done.
+
// Verification of fix for BUG=176365. Ensure that each Instant WebContents in
// a tab uses a new BrowsingInstance, to avoid conflicts in the
// NavigationController.
« 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