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