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

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

Issue 13813006: Instant: Don't allow the page to set suggestions inappropriately. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase 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 a2a168005d2cb5fa82d7934eb4568886f9f6216b..aebd5781a011eea21ac53c382e3438f9a6de9966 100644
--- a/chrome/browser/ui/search/instant_extended_browsertest.cc
+++ b/chrome/browser/ui/search/instant_extended_browsertest.cc
@@ -1648,3 +1648,22 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest,
EXPECT_EQ(0, on_change_calls_);
EXPECT_EQ(0, on_native_suggestions_calls_);
}
+
+// Test that suggestions are not accepted when unexpected.
+IN_PROC_BROWSER_TEST_F(InstantExtendedTest, DeniesUnexpectedSuggestions) {
+ ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
+ FocusOmniboxAndWaitForInstantExtendedSupport();
+ SetOmniboxTextAndWaitForOverlayToShow("chip");
+ SendDownArrow();
+
+ EXPECT_EQ("result 1", GetOmniboxText());
+ EXPECT_EQ(ASCIIToUTF16(""), GetGrayText());
+
+ // Make the page send an unexpected suggestion.
+ EXPECT_TRUE(ExecuteScript("suggestion = 'chippies';"
+ "handleOnChange();"));
+
+ // Verify that the suggestion is ignored.
+ EXPECT_EQ("result 1", GetOmniboxText());
+ EXPECT_EQ(ASCIIToUTF16(""), GetGrayText());
+}
« 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