Commit fc54a875 authored by dhollowa@chromium.org's avatar dhollowa@chromium.org

InstantExtendedManualTests should fail and not hang

Converts hanging tests to failures. Also disables a couple more flakey
manual tests.

BUG=225517
TEST=InstantExtendedManualTests.*
R=jered@chromium.org

Review URL: https://chromiumcodereview.appspot.com/14130012

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@194802 0039d316-1c4b-4281-b951-d872f2087c98
parent 50643400
...@@ -102,7 +102,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, OmniboxFocusLoadsInstant) { ...@@ -102,7 +102,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, OmniboxFocusLoadsInstant) {
EXPECT_EQ(overlay, instant()->GetOverlayContents()); EXPECT_EQ(overlay, instant()->GetOverlayContents());
// Doing a search should also use the same preloaded page. // Doing a search should also use the same preloaded page.
SetOmniboxTextAndWaitForOverlayToShow("query"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("query"));
EXPECT_TRUE(instant()->model()->mode().is_search_suggestions()); EXPECT_TRUE(instant()->model()->mode().is_search_suggestions());
EXPECT_EQ(overlay, instant()->GetOverlayContents()); EXPECT_EQ(overlay, instant()->GetOverlayContents());
} }
...@@ -132,7 +132,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, MAYBE_OnChangeEvent) { ...@@ -132,7 +132,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, MAYBE_OnChangeEvent) {
// Typing "query" into the omnibox causes one or more onchange events. The // Typing "query" into the omnibox causes one or more onchange events. The
// page suggested "query suggestion" is inline autocompleted into the omnibox, // page suggested "query suggestion" is inline autocompleted into the omnibox,
// causing another onchange event. // causing another onchange event.
SetOmniboxTextAndWaitForOverlayToShow("query"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("query"));
EXPECT_EQ(ASCIIToUTF16("query suggestion"), omnibox()->GetText()); EXPECT_EQ(ASCIIToUTF16("query suggestion"), omnibox()->GetText());
int min_onchangecalls = 2; int min_onchangecalls = 2;
...@@ -220,7 +220,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, OnCancelEvent) { ...@@ -220,7 +220,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, OnCancelEvent) {
ASSERT_NO_FATAL_FAILURE(SetupInstant(browser())); ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
EXPECT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); EXPECT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser()));
FocusOmniboxAndWaitForInstantSupport(); FocusOmniboxAndWaitForInstantSupport();
SetOmniboxTextAndWaitForOverlayToShow("search"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("search"));
// Stash a reference to the overlay, so we can refer to it after commit. // Stash a reference to the overlay, so we can refer to it after commit.
content::WebContents* overlay = instant()->GetOverlayContents(); content::WebContents* overlay = instant()->GetOverlayContents();
...@@ -288,7 +288,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, OnResizeEvent) { ...@@ -288,7 +288,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, OnResizeEvent) {
// Type a query into the omnibox. This should cause an onresize() event, with // Type a query into the omnibox. This should cause an onresize() event, with
// a valid (non-zero) height. // a valid (non-zero) height.
SetOmniboxTextAndWaitForOverlayToShow("search"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("search"));
EXPECT_TRUE(UpdateSearchState(instant()->GetOverlayContents())); EXPECT_TRUE(UpdateSearchState(instant()->GetOverlayContents()));
EXPECT_EQ(1, onresizecalls_); EXPECT_EQ(1, onresizecalls_);
...@@ -304,7 +304,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, SuggestionIsCompletedNow) { ...@@ -304,7 +304,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, SuggestionIsCompletedNow) {
EXPECT_TRUE(ExecuteScript("behavior = 'now'")); EXPECT_TRUE(ExecuteScript("behavior = 'now'"));
// Type a query, causing the hardcoded "query suggestion" to be returned. // Type a query, causing the hardcoded "query suggestion" to be returned.
SetOmniboxTextAndWaitForOverlayToShow("query"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("query"));
// Get what's showing in the omnibox, and what's highlighted. // Get what's showing in the omnibox, and what's highlighted.
EXPECT_EQ(ASCIIToUTF16("query suggestion"), omnibox()->GetText()); EXPECT_EQ(ASCIIToUTF16("query suggestion"), omnibox()->GetText());
...@@ -321,7 +321,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, SuggestionIsCompletedNever) { ...@@ -321,7 +321,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, SuggestionIsCompletedNever) {
EXPECT_TRUE(ExecuteScript("behavior = 'never'")); EXPECT_TRUE(ExecuteScript("behavior = 'never'"));
// Type a query, causing the hardcoded "query suggestion" to be returned. // Type a query, causing the hardcoded "query suggestion" to be returned.
SetOmniboxTextAndWaitForOverlayToShow("query"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("query"));
// Get what's showing in the omnibox, and what's highlighted. // Get what's showing in the omnibox, and what's highlighted.
EXPECT_EQ(ASCIIToUTF16("query"), omnibox()->GetText()); EXPECT_EQ(ASCIIToUTF16("query"), omnibox()->GetText());
...@@ -338,7 +338,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, SuggestionIsValidObject) { ...@@ -338,7 +338,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, SuggestionIsValidObject) {
EXPECT_TRUE(ExecuteScript("suggestion = [ { value: 'query completion' } ]")); EXPECT_TRUE(ExecuteScript("suggestion = [ { value: 'query completion' } ]"));
// Type a query, causing "query completion" to be returned as the suggestion. // Type a query, causing "query completion" to be returned as the suggestion.
SetOmniboxTextAndWaitForOverlayToShow("query"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("query"));
EXPECT_EQ(ASCIIToUTF16("query completion"), omnibox()->GetText()); EXPECT_EQ(ASCIIToUTF16("query completion"), omnibox()->GetText());
} }
...@@ -351,7 +351,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, SuggestionIsInvalidObject) { ...@@ -351,7 +351,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, SuggestionIsInvalidObject) {
EXPECT_TRUE(ExecuteScript("suggestion = { value: 'query completion' }")); EXPECT_TRUE(ExecuteScript("suggestion = { value: 'query completion' }"));
// Type a query, but expect no suggestion. // Type a query, but expect no suggestion.
SetOmniboxTextAndWaitForOverlayToShow("query"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("query"));
EXPECT_EQ(ASCIIToUTF16("query"), omnibox()->GetText()); EXPECT_EQ(ASCIIToUTF16("query"), omnibox()->GetText());
} }
...@@ -361,19 +361,19 @@ IN_PROC_BROWSER_TEST_F(InstantTest, SuggestionIsEmpty) { ...@@ -361,19 +361,19 @@ IN_PROC_BROWSER_TEST_F(InstantTest, SuggestionIsEmpty) {
FocusOmniboxAndWaitForInstantSupport(); FocusOmniboxAndWaitForInstantSupport();
EXPECT_TRUE(ExecuteScript("suggestion = {}")); EXPECT_TRUE(ExecuteScript("suggestion = {}"));
SetOmniboxTextAndWaitForOverlayToShow("query"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("query"));
EXPECT_EQ(ASCIIToUTF16("query"), omnibox()->GetText()); EXPECT_EQ(ASCIIToUTF16("query"), omnibox()->GetText());
omnibox()->RevertAll(); omnibox()->RevertAll();
EXPECT_TRUE(ExecuteScript("suggestion = []")); EXPECT_TRUE(ExecuteScript("suggestion = []"));
SetOmniboxTextAndWaitForOverlayToShow("query sugg"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("query sugg"));
EXPECT_EQ(ASCIIToUTF16("query sugg"), omnibox()->GetText()); EXPECT_EQ(ASCIIToUTF16("query sugg"), omnibox()->GetText());
omnibox()->RevertAll(); omnibox()->RevertAll();
EXPECT_TRUE(ExecuteScript("suggestion = [{}]")); EXPECT_TRUE(ExecuteScript("suggestion = [{}]"));
SetOmniboxTextAndWaitForOverlayToShow("query suggest"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("query suggest"));
EXPECT_EQ(ASCIIToUTF16("query suggest"), omnibox()->GetText()); EXPECT_EQ(ASCIIToUTF16("query suggest"), omnibox()->GetText());
} }
...@@ -382,7 +382,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, SearchSuggestionIsNotDiscarded) { ...@@ -382,7 +382,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, SearchSuggestionIsNotDiscarded) {
ASSERT_NO_FATAL_FAILURE(SetupInstant(browser())); ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
FocusOmniboxAndWaitForInstantSupport(); FocusOmniboxAndWaitForInstantSupport();
SetOmniboxTextAndWaitForOverlayToShow("query"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("query"));
EXPECT_EQ(ASCIIToUTF16("query suggestion"), omnibox()->GetText()); EXPECT_EQ(ASCIIToUTF16("query suggestion"), omnibox()->GetText());
SetOmniboxText("query sugg"); SetOmniboxText("query sugg");
EXPECT_EQ(ASCIIToUTF16("query suggestion"), omnibox()->GetText()); EXPECT_EQ(ASCIIToUTF16("query suggestion"), omnibox()->GetText());
...@@ -450,7 +450,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, TransitionsBetweenSearchAndURL) { ...@@ -450,7 +450,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, TransitionsBetweenSearchAndURL) {
min_onchangecalls = onchangecalls_; min_onchangecalls = onchangecalls_;
// Type a search. Instant should show. // Type a search. Instant should show.
SetOmniboxTextAndWaitForOverlayToShow("search"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("search"));
++min_onchangecalls; ++min_onchangecalls;
EXPECT_TRUE(UpdateSearchState(instant()->GetOverlayContents())); EXPECT_TRUE(UpdateSearchState(instant()->GetOverlayContents()));
...@@ -472,7 +472,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, TransitionsBetweenSearchAndURL) { ...@@ -472,7 +472,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, TransitionsBetweenSearchAndURL) {
min_onchangecalls = onchangecalls_; min_onchangecalls = onchangecalls_;
// Type the same search as before. // Type the same search as before.
SetOmniboxTextAndWaitForOverlayToShow("search"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("search"));
min_onchangecalls++; min_onchangecalls++;
EXPECT_TRUE(UpdateSearchState(instant()->GetOverlayContents())); EXPECT_TRUE(UpdateSearchState(instant()->GetOverlayContents()));
...@@ -535,7 +535,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, DoesNotCommitURLsTwo) { ...@@ -535,7 +535,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, DoesNotCommitURLsTwo) {
FocusOmniboxAndWaitForInstantSupport(); FocusOmniboxAndWaitForInstantSupport();
// Type a query. This causes the overlay to be shown. // Type a query. This causes the overlay to be shown.
SetOmniboxTextAndWaitForOverlayToShow("query"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("query"));
content::WebContents* overlay = instant()->GetOverlayContents(); content::WebContents* overlay = instant()->GetOverlayContents();
EXPECT_TRUE(overlay); EXPECT_TRUE(overlay);
...@@ -602,7 +602,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, PageVisibility) { ...@@ -602,7 +602,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, PageVisibility) {
EXPECT_TRUE(CheckVisibilityIs(overlay, false)); EXPECT_TRUE(CheckVisibilityIs(overlay, false));
// Type a query and wait for Instant to show. // Type a query and wait for Instant to show.
SetOmniboxTextAndWaitForOverlayToShow("query"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("query"));
EXPECT_TRUE(CheckVisibilityIs(active_tab, true)); EXPECT_TRUE(CheckVisibilityIs(active_tab, true));
EXPECT_TRUE(CheckVisibilityIs(overlay, true)); EXPECT_TRUE(CheckVisibilityIs(overlay, true));
...@@ -612,7 +612,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, PageVisibility) { ...@@ -612,7 +612,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, PageVisibility) {
EXPECT_TRUE(CheckVisibilityIs(overlay, false)); EXPECT_TRUE(CheckVisibilityIs(overlay, false));
// Typing a query should show the overlay again. // Typing a query should show the overlay again.
SetOmniboxTextAndWaitForOverlayToShow("query"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("query"));
EXPECT_TRUE(CheckVisibilityIs(active_tab, true)); EXPECT_TRUE(CheckVisibilityIs(active_tab, true));
EXPECT_TRUE(CheckVisibilityIs(overlay, true)); EXPECT_TRUE(CheckVisibilityIs(overlay, true));
...@@ -690,7 +690,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, History) { ...@@ -690,7 +690,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, History) {
ui_test_utils::WaitForHistoryToLoad(history); ui_test_utils::WaitForHistoryToLoad(history);
// Perform a search. // Perform a search.
SetOmniboxTextAndWaitForOverlayToShow("search"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("search"));
// Commit the search. // Commit the search.
browser()->window()->GetLocationBar()->AcceptInput(); browser()->window()->GetLocationBar()->AcceptInput();
...@@ -735,7 +735,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, MAYBE_NewWindowDismissesInstant) { ...@@ -735,7 +735,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, MAYBE_NewWindowDismissesInstant) {
ASSERT_NO_FATAL_FAILURE(SetupInstant(browser())); ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
EXPECT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); EXPECT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser()));
FocusOmniboxAndWaitForInstantSupport(); FocusOmniboxAndWaitForInstantSupport();
SetOmniboxTextAndWaitForOverlayToShow("search"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("search"));
Browser* previous_window = browser(); Browser* previous_window = browser();
EXPECT_TRUE(instant()->IsOverlayingSearchResults()); EXPECT_TRUE(instant()->IsOverlayingSearchResults());
...@@ -745,7 +745,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, MAYBE_NewWindowDismissesInstant) { ...@@ -745,7 +745,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, MAYBE_NewWindowDismissesInstant) {
SearchMode::MODE_DEFAULT); SearchMode::MODE_DEFAULT);
chrome::NewEmptyWindow(browser()->profile(), chrome::NewEmptyWindow(browser()->profile(),
chrome::HOST_DESKTOP_TYPE_NATIVE); chrome::HOST_DESKTOP_TYPE_NATIVE);
observer.WaitForDesiredOverlayState(); ASSERT_TRUE(observer.WaitForExpectedOverlayState());
// Even though we just created a new Browser object (for the new window), the // Even though we just created a new Browser object (for the new window), the
// browser() accessor should still give us the first window's Browser object. // browser() accessor should still give us the first window's Browser object.
...@@ -763,7 +763,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, InstantOverlayRefresh) { ...@@ -763,7 +763,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, InstantOverlayRefresh) {
FocusOmniboxAndWaitForInstantSupport(); FocusOmniboxAndWaitForInstantSupport();
// The overlay is refreshed only after all three conditions above are met. // The overlay is refreshed only after all three conditions above are met.
SetOmniboxTextAndWaitForOverlayToShow("query"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("query"));
instant()->overlay_->is_stale_ = true; instant()->overlay_->is_stale_ = true;
instant()->ReloadOverlayIfStale(); instant()->ReloadOverlayIfStale();
EXPECT_TRUE(instant()->overlay_->supports_instant()); EXPECT_TRUE(instant()->overlay_->supports_instant());
...@@ -774,7 +774,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, InstantOverlayRefresh) { ...@@ -774,7 +774,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, InstantOverlayRefresh) {
EXPECT_FALSE(instant()->overlay_->supports_instant()); EXPECT_FALSE(instant()->overlay_->supports_instant());
// Try with a different ordering. // Try with a different ordering.
SetOmniboxTextAndWaitForOverlayToShow("query"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("query"));
instant()->overlay_->is_stale_ = true; instant()->overlay_->is_stale_ = true;
instant()->ReloadOverlayIfStale(); instant()->ReloadOverlayIfStale();
EXPECT_TRUE(instant()->overlay_->supports_instant()); EXPECT_TRUE(instant()->overlay_->supports_instant());
...@@ -794,42 +794,42 @@ IN_PROC_BROWSER_TEST_F(InstantTest, SuggestionsAreCaseInsensitive) { ...@@ -794,42 +794,42 @@ IN_PROC_BROWSER_TEST_F(InstantTest, SuggestionsAreCaseInsensitive) {
EXPECT_TRUE(ExecuteScript("suggestion = [ { value: 'INSTANT' } ]")); EXPECT_TRUE(ExecuteScript("suggestion = [ { value: 'INSTANT' } ]"));
SetOmniboxTextAndWaitForOverlayToShow("in"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("in"));
EXPECT_EQ(ASCIIToUTF16("instant"), omnibox()->GetText()); EXPECT_EQ(ASCIIToUTF16("instant"), omnibox()->GetText());
omnibox()->RevertAll(); omnibox()->RevertAll();
SetOmniboxTextAndWaitForOverlayToShow("IN"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("IN"));
EXPECT_EQ(ASCIIToUTF16("INSTANT"), omnibox()->GetText()); EXPECT_EQ(ASCIIToUTF16("INSTANT"), omnibox()->GetText());
// U+0130 == LATIN CAPITAL LETTER I WITH DOT ABOVE // U+0130 == LATIN CAPITAL LETTER I WITH DOT ABOVE
EXPECT_TRUE(ExecuteScript("suggestion = [ { value: '\\u0130NSTANT' } ]")); EXPECT_TRUE(ExecuteScript("suggestion = [ { value: '\\u0130NSTANT' } ]"));
omnibox()->RevertAll(); omnibox()->RevertAll();
SetOmniboxTextAndWaitForOverlayToShow("i"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("i"));
EXPECT_EQ(WideToUTF16(L"i\u0307nstant"), omnibox()->GetText()); EXPECT_EQ(WideToUTF16(L"i\u0307nstant"), omnibox()->GetText());
omnibox()->RevertAll(); omnibox()->RevertAll();
SetOmniboxTextAndWaitForOverlayToShow("I"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("I"));
EXPECT_EQ(WideToUTF16(L"I\u0307nstant"), omnibox()->GetText()); EXPECT_EQ(WideToUTF16(L"I\u0307nstant"), omnibox()->GetText());
omnibox()->RevertAll(); omnibox()->RevertAll();
SetOmniboxTextAndWaitForOverlayToShow(WideToUTF8(L"i\u0307")); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow(WideToUTF8(L"i\u0307")));
EXPECT_EQ(WideToUTF16(L"i\u0307nstant"), omnibox()->GetText()); EXPECT_EQ(WideToUTF16(L"i\u0307nstant"), omnibox()->GetText());
omnibox()->RevertAll(); omnibox()->RevertAll();
SetOmniboxTextAndWaitForOverlayToShow(WideToUTF8(L"I\u0307")); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow(WideToUTF8(L"I\u0307")));
EXPECT_EQ(WideToUTF16(L"I\u0307nstant"), omnibox()->GetText()); EXPECT_EQ(WideToUTF16(L"I\u0307nstant"), omnibox()->GetText());
omnibox()->RevertAll(); omnibox()->RevertAll();
SetOmniboxTextAndWaitForOverlayToShow(WideToUTF8(L"\u0130")); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow(WideToUTF8(L"\u0130")));
EXPECT_EQ(WideToUTF16(L"\u0130NSTANT"), omnibox()->GetText()); EXPECT_EQ(WideToUTF16(L"\u0130NSTANT"), omnibox()->GetText());
omnibox()->RevertAll(); omnibox()->RevertAll();
SetOmniboxTextAndWaitForOverlayToShow("in"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("in"));
EXPECT_EQ(ASCIIToUTF16("in"), omnibox()->GetText()); EXPECT_EQ(ASCIIToUTF16("in"), omnibox()->GetText());
omnibox()->RevertAll(); omnibox()->RevertAll();
SetOmniboxTextAndWaitForOverlayToShow("IN"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("IN"));
EXPECT_EQ(ASCIIToUTF16("IN"), omnibox()->GetText()); EXPECT_EQ(ASCIIToUTF16("IN"), omnibox()->GetText());
// Check that a d with a dot above and below it is completed regardless of // Check that a d with a dot above and below it is completed regardless of
...@@ -839,7 +839,8 @@ IN_PROC_BROWSER_TEST_F(InstantTest, SuggestionsAreCaseInsensitive) { ...@@ -839,7 +839,8 @@ IN_PROC_BROWSER_TEST_F(InstantTest, SuggestionsAreCaseInsensitive) {
EXPECT_TRUE(ExecuteScript("suggestion = [ { value: '\\u1e0d\\u0307oh' } ]")); EXPECT_TRUE(ExecuteScript("suggestion = [ { value: '\\u1e0d\\u0307oh' } ]"));
omnibox()->RevertAll(); omnibox()->RevertAll();
SetOmniboxTextAndWaitForOverlayToShow(WideToUTF8(L"\u1e0b\u0323")); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow(
WideToUTF8(L"\u1e0b\u0323")));
EXPECT_EQ(WideToUTF16(L"\u1e0b\u0323oh"), omnibox()->GetText()); EXPECT_EQ(WideToUTF16(L"\u1e0b\u0323oh"), omnibox()->GetText());
} }
...@@ -865,7 +866,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, MAYBE_CommitInNewTab) { ...@@ -865,7 +866,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, MAYBE_CommitInNewTab) {
&active_tab_onvisibilitycalls)); &active_tab_onvisibilitycalls));
EXPECT_EQ(0, active_tab_onvisibilitycalls); EXPECT_EQ(0, active_tab_onvisibilitycalls);
SetOmniboxTextAndWaitForOverlayToShow("search"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("search"));
// Stash a reference to the overlay, so we can refer to it after commit. // Stash a reference to the overlay, so we can refer to it after commit.
content::WebContents* overlay = instant()->GetOverlayContents(); content::WebContents* overlay = instant()->GetOverlayContents();
...@@ -936,7 +937,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, SuggestionsAreReusable) { ...@@ -936,7 +937,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, SuggestionsAreReusable) {
EXPECT_TRUE(ExecuteScript("suggestion = [ { value: 'instant' } ];" EXPECT_TRUE(ExecuteScript("suggestion = [ { value: 'instant' } ];"
"behavior = 'never';")); "behavior = 'never';"));
SetOmniboxTextAndWaitForOverlayToShow("in"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("in"));
EXPECT_EQ(ASCIIToUTF16("stant"), GetGrayText()); EXPECT_EQ(ASCIIToUTF16("stant"), GetGrayText());
SetOmniboxText("ins"); SetOmniboxText("ins");
...@@ -955,14 +956,14 @@ IN_PROC_BROWSER_TEST_F(InstantTest, InstantRenderViewGone) { ...@@ -955,14 +956,14 @@ IN_PROC_BROWSER_TEST_F(InstantTest, InstantRenderViewGone) {
FocusOmniboxAndWaitForInstantSupport(); FocusOmniboxAndWaitForInstantSupport();
// Type partial query, get suggestion to show. // Type partial query, get suggestion to show.
SetOmniboxTextAndWaitForOverlayToShow("q"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("q"));
EXPECT_EQ(ASCIIToUTF16("query suggestion"), omnibox()->GetText()); EXPECT_EQ(ASCIIToUTF16("query suggestion"), omnibox()->GetText());
// Kill the Instant renderer and wait for Instant support again. // Kill the Instant renderer and wait for Instant support again.
KillInstantRenderView(); KillInstantRenderView();
FocusOmniboxAndWaitForInstantSupport(); FocusOmniboxAndWaitForInstantSupport();
SetOmniboxTextAndWaitForOverlayToShow("qu"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("qu"));
EXPECT_EQ(ASCIIToUTF16("query suggestion"), omnibox()->GetText()); EXPECT_EQ(ASCIIToUTF16("query suggestion"), omnibox()->GetText());
} }
...@@ -986,7 +987,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, ProcessIsolation) { ...@@ -986,7 +987,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, ProcessIsolation) {
overlay->GetRenderProcessHost()->GetID())); overlay->GetRenderProcessHost()->GetID()));
// Search and commit the search by pressing Alt-Enter. // Search and commit the search by pressing Alt-Enter.
SetOmniboxTextAndWaitForOverlayToShow("tractor"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("tractor"));
omnibox()->model()->AcceptInput(NEW_FOREGROUND_TAB, false); omnibox()->model()->AcceptInput(NEW_FOREGROUND_TAB, false);
// The committed search results page should also live inside the // The committed search results page should also live inside the
......
...@@ -231,7 +231,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, InputShowsOverlay) { ...@@ -231,7 +231,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, InputShowsOverlay) {
EXPECT_TRUE(instant()->model()->mode().is_default()); EXPECT_TRUE(instant()->model()->mode().is_default());
// Typing in the omnibox should show the overlay. // Typing in the omnibox should show the overlay.
SetOmniboxTextAndWaitForOverlayToShow("query"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("query"));
EXPECT_TRUE(instant()->model()->mode().is_search_suggestions()); EXPECT_TRUE(instant()->model()->mode().is_search_suggestions());
EXPECT_EQ(overlay, instant()->GetOverlayContents()); EXPECT_EQ(overlay, instant()->GetOverlayContents());
} }
...@@ -246,7 +246,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, ...@@ -246,7 +246,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest,
EXPECT_EQ(1, browser()->tab_strip_model()->count()); EXPECT_EQ(1, browser()->tab_strip_model()->count());
// Typing in the omnibox should show the overlay. // Typing in the omnibox should show the overlay.
SetOmniboxTextAndWaitForOverlayToShow("http://www.example.com/"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("http://www.example.com/"));
// Create an event listener that opens the top suggestion in a new tab. // Create an event listener that opens the top suggestion in a new tab.
EXPECT_TRUE(ExecuteScript( EXPECT_TRUE(ExecuteScript(
...@@ -283,7 +283,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, ...@@ -283,7 +283,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest,
// Get a committed tab to work with. // Get a committed tab to work with.
content::WebContents* instant_tab = instant()->GetOverlayContents(); content::WebContents* instant_tab = instant()->GetOverlayContents();
SetOmniboxTextAndWaitForOverlayToShow("committed"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("committed"));
browser()->window()->GetLocationBar()->AcceptInput(); browser()->window()->GetLocationBar()->AcceptInput();
// Put focus back into the omnibox, type, and wait for some gray text. // Put focus back into the omnibox, type, and wait for some gray text.
...@@ -310,7 +310,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, OmniboxTextUponEnterCommit) { ...@@ -310,7 +310,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, OmniboxTextUponEnterCommit) {
EXPECT_TRUE(ExecuteScript("suggestion = 'santa claus';")); EXPECT_TRUE(ExecuteScript("suggestion = 'santa claus';"));
// Set the text, and wait for suggestions to show up. // Set the text, and wait for suggestions to show up.
SetOmniboxTextAndWaitForOverlayToShow("santa"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("santa"));
EXPECT_EQ(ASCIIToUTF16("santa"), omnibox()->GetText()); EXPECT_EQ(ASCIIToUTF16("santa"), omnibox()->GetText());
// Test that the current suggestion is correctly set. // Test that the current suggestion is correctly set.
...@@ -335,7 +335,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, OmniboxTextUponFocusLostCommit) { ...@@ -335,7 +335,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, OmniboxTextUponFocusLostCommit) {
EXPECT_TRUE(ExecuteScript("suggestion = 'johnny depp';")); EXPECT_TRUE(ExecuteScript("suggestion = 'johnny depp';"));
// Set the text, and wait for suggestions to show up. // Set the text, and wait for suggestions to show up.
SetOmniboxTextAndWaitForOverlayToShow("johnny"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("johnny"));
EXPECT_EQ(ASCIIToUTF16("johnny"), omnibox()->GetText()); EXPECT_EQ(ASCIIToUTF16("johnny"), omnibox()->GetText());
// Test that the current suggestion is correctly set. // Test that the current suggestion is correctly set.
...@@ -363,7 +363,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, ...@@ -363,7 +363,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest,
content::NotificationService::AllSources()); content::NotificationService::AllSources());
// Do a search and commit it. // Do a search and commit it.
SetOmniboxTextAndWaitForOverlayToShow("hello k"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("hello k"));
EXPECT_EQ(ASCIIToUTF16("hello k"), omnibox()->GetText()); EXPECT_EQ(ASCIIToUTF16("hello k"), omnibox()->GetText());
browser()->window()->GetLocationBar()->AcceptInput(); browser()->window()->GetLocationBar()->AcceptInput();
observer.Wait(); observer.Wait();
...@@ -394,7 +394,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, ...@@ -394,7 +394,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest,
// Tell the page to send a URL suggestion. // Tell the page to send a URL suggestion.
EXPECT_TRUE(ExecuteScript("suggestion = 'http://www.example.com';" EXPECT_TRUE(ExecuteScript("suggestion = 'http://www.example.com';"
"behavior = 1;")); "behavior = 1;"));
SetOmniboxTextAndWaitForOverlayToShow("exa"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("exa"));
EXPECT_EQ(ASCIIToUTF16("example.com"), omnibox()->GetText()); EXPECT_EQ(ASCIIToUTF16("example.com"), omnibox()->GetText());
// Now send a search suggestion and see that Navigation suggestion is no // Now send a search suggestion and see that Navigation suggestion is no
...@@ -419,7 +419,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, NavigateSuggestionsWithArrowKeys) { ...@@ -419,7 +419,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, NavigateSuggestionsWithArrowKeys) {
ASSERT_NO_FATAL_FAILURE(SetupInstant(browser())); ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
FocusOmniboxAndWaitForInstantExtendedSupport(); FocusOmniboxAndWaitForInstantExtendedSupport();
SetOmniboxTextAndWaitForOverlayToShow("hello"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("hello"));
EXPECT_EQ("hello", GetOmniboxText()); EXPECT_EQ("hello", GetOmniboxText());
SendDownArrow(); SendDownArrow();
...@@ -464,7 +464,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, ...@@ -464,7 +464,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest,
content::NotificationService::AllSources()); content::NotificationService::AllSources());
// Do a search and commit it. // Do a search and commit it.
SetOmniboxTextAndWaitForOverlayToShow("hello k"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("hello k"));
EXPECT_EQ(ASCIIToUTF16("hello k"), omnibox()->GetText()); EXPECT_EQ(ASCIIToUTF16("hello k"), omnibox()->GetText());
browser()->window()->GetLocationBar()->AcceptInput(); browser()->window()->GetLocationBar()->AcceptInput();
observer.Wait(); observer.Wait();
...@@ -503,7 +503,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, NavigateSuggestionsAndHitEscape) { ...@@ -503,7 +503,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, NavigateSuggestionsAndHitEscape) {
ASSERT_NO_FATAL_FAILURE(SetupInstant(browser())); ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
FocusOmniboxAndWaitForInstantExtendedSupport(); FocusOmniboxAndWaitForInstantExtendedSupport();
SetOmniboxTextAndWaitForOverlayToShow("hello"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("hello"));
EXPECT_EQ("hello", GetOmniboxText()); EXPECT_EQ("hello", GetOmniboxText());
SendDownArrow(); SendDownArrow();
...@@ -536,7 +536,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, PressEscapeWithBlueText) { ...@@ -536,7 +536,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, PressEscapeWithBlueText) {
EXPECT_TRUE(ExecuteScript("suggestion = 'chimichanga.com';" EXPECT_TRUE(ExecuteScript("suggestion = 'chimichanga.com';"
"behavior = 1;")); "behavior = 1;"));
SetOmniboxTextAndWaitForOverlayToShow("chimi"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("chimi"));
EXPECT_EQ(ASCIIToUTF16("chimichanga.com"), omnibox()->GetText()); EXPECT_EQ(ASCIIToUTF16("chimichanga.com"), omnibox()->GetText());
EXPECT_EQ(ASCIIToUTF16("changa.com"), GetBlueText()); EXPECT_EQ(ASCIIToUTF16("changa.com"), GetBlueText());
...@@ -573,7 +573,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, PressEscapeWithGrayText) { ...@@ -573,7 +573,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, PressEscapeWithGrayText) {
EXPECT_TRUE(ExecuteScript("suggestion = 'cowabunga';" EXPECT_TRUE(ExecuteScript("suggestion = 'cowabunga';"
"behavior = 2;")); "behavior = 2;"));
SetOmniboxTextAndWaitForOverlayToShow("cowa"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("cowa"));
EXPECT_EQ(ASCIIToUTF16("cowa"), omnibox()->GetText()); EXPECT_EQ(ASCIIToUTF16("cowa"), omnibox()->GetText());
EXPECT_EQ(ASCIIToUTF16(""), GetBlueText()); EXPECT_EQ(ASCIIToUTF16(""), GetBlueText());
...@@ -831,7 +831,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, DISABLED_UnrelatedSiteInstance) { ...@@ -831,7 +831,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, DISABLED_UnrelatedSiteInstance) {
// Type a query and hit enter to get a results page. The overlay becomes the // Type a query and hit enter to get a results page. The overlay becomes the
// active tab. // active tab.
SetOmniboxTextAndWaitForOverlayToShow("hello"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("hello"));
EXPECT_EQ("hello", GetOmniboxText()); EXPECT_EQ("hello", GetOmniboxText());
browser()->window()->GetLocationBar()->AcceptInput(); browser()->window()->GetLocationBar()->AcceptInput();
content::WebContents* first_active_tab = content::WebContents* first_active_tab =
...@@ -847,7 +847,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, DISABLED_UnrelatedSiteInstance) { ...@@ -847,7 +847,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, DISABLED_UnrelatedSiteInstance) {
ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUIAboutURL)); ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUIAboutURL));
// Show and commit the new overlay. // Show and commit the new overlay.
SetOmniboxTextAndWaitForOverlayToShow("hello again"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("hello again"));
EXPECT_EQ("hello again", GetOmniboxText()); EXPECT_EQ("hello again", GetOmniboxText());
browser()->window()->GetLocationBar()->AcceptInput(); browser()->window()->GetLocationBar()->AcceptInput();
content::WebContents* second_active_tab = content::WebContents* second_active_tab =
...@@ -868,7 +868,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, ValidatesSuggestions) { ...@@ -868,7 +868,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, ValidatesSuggestions) {
// Do not set gray text that is not a suffix of the query. // Do not set gray text that is not a suffix of the query.
EXPECT_TRUE(ExecuteScript("suggestion = 'potato';" EXPECT_TRUE(ExecuteScript("suggestion = 'potato';"
"behavior = 2;")); "behavior = 2;"));
SetOmniboxTextAndWaitForOverlayToShow("query"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("query"));
EXPECT_EQ(ASCIIToUTF16("query"), omnibox()->GetText()); EXPECT_EQ(ASCIIToUTF16("query"), omnibox()->GetText());
EXPECT_EQ(ASCIIToUTF16(""), GetGrayText()); EXPECT_EQ(ASCIIToUTF16(""), GetGrayText());
...@@ -877,7 +877,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, ValidatesSuggestions) { ...@@ -877,7 +877,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, ValidatesSuggestions) {
// Do not set blue text that is not a valid URL completion. // Do not set blue text that is not a valid URL completion.
EXPECT_TRUE(ExecuteScript("suggestion = 'this is not a url!';" EXPECT_TRUE(ExecuteScript("suggestion = 'this is not a url!';"
"behavior = 1;")); "behavior = 1;"));
SetOmniboxTextAndWaitForOverlayToShow("this is"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("this is"));
EXPECT_EQ(ASCIIToUTF16("this is"), omnibox()->GetText()); EXPECT_EQ(ASCIIToUTF16("this is"), omnibox()->GetText());
EXPECT_EQ(ASCIIToUTF16(""), GetGrayText()); EXPECT_EQ(ASCIIToUTF16(""), GetGrayText());
...@@ -887,7 +887,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, ValidatesSuggestions) { ...@@ -887,7 +887,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, ValidatesSuggestions) {
// First set up some blue text completion. // First set up some blue text completion.
EXPECT_TRUE(ExecuteScript("suggestion = 'www.example.com';" EXPECT_TRUE(ExecuteScript("suggestion = 'www.example.com';"
"behavior = 1;")); "behavior = 1;"));
SetOmniboxTextAndWaitForOverlayToShow("http://www.ex"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("http://www.ex"));
EXPECT_EQ(ASCIIToUTF16("http://www.example.com"), omnibox()->GetText()); EXPECT_EQ(ASCIIToUTF16("http://www.example.com"), omnibox()->GetText());
EXPECT_EQ(ASCIIToUTF16("ample.com"), GetBlueText()); EXPECT_EQ(ASCIIToUTF16("ample.com"), GetBlueText());
...@@ -902,7 +902,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, ValidatesSuggestions) { ...@@ -902,7 +902,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, ValidatesSuggestions) {
// Ignore an out-of-date blue text suggestion. (Simulates a laggy // Ignore an out-of-date blue text suggestion. (Simulates a laggy
// SetSuggestion IPC by directly calling into InstantController.) // SetSuggestion IPC by directly calling into InstantController.)
SetOmniboxTextAndWaitForOverlayToShow("http://www.example.com/"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("http://www.example.com/"));
instant()->SetSuggestions( instant()->SetSuggestions(
instant()->overlay()->contents(), instant()->overlay()->contents(),
std::vector<InstantSuggestion>( std::vector<InstantSuggestion>(
...@@ -920,7 +920,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, ValidatesSuggestions) { ...@@ -920,7 +920,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, ValidatesSuggestions) {
// TODO(samarth): uncomment after fixing crbug.com/191656. // TODO(samarth): uncomment after fixing crbug.com/191656.
// Use an out-of-date blue text suggestion, if the text typed by the user is // Use an out-of-date blue text suggestion, if the text typed by the user is
// contained in the suggestion. // contained in the suggestion.
// SetOmniboxTextAndWaitForOverlayToShow("ex"); // ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("ex"));
// instant()->SetSuggestions( // instant()->SetSuggestions(
// instant()->overlay()->contents(), // instant()->overlay()->contents(),
// std::vector<InstantSuggestion>( // std::vector<InstantSuggestion>(
...@@ -956,7 +956,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, ...@@ -956,7 +956,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest,
// Tell the page to send a URL suggestion. // Tell the page to send a URL suggestion.
EXPECT_TRUE(ExecuteScript("suggestion = 'http://www.example.com';" EXPECT_TRUE(ExecuteScript("suggestion = 'http://www.example.com';"
"behavior = 1;")); "behavior = 1;"));
SetOmniboxTextAndWaitForOverlayToShow("exa"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("exa"));
EXPECT_EQ(ASCIIToUTF16("example.com"), omnibox()->GetText()); EXPECT_EQ(ASCIIToUTF16("example.com"), omnibox()->GetText());
SetOmniboxText("exam"); SetOmniboxText("exam");
EXPECT_EQ(ASCIIToUTF16("example.com"), omnibox()->GetText()); EXPECT_EQ(ASCIIToUTF16("example.com"), omnibox()->GetText());
...@@ -1141,7 +1141,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, NoWebUIBindingsOnPreview) { ...@@ -1141,7 +1141,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, NoWebUIBindingsOnPreview) {
FocusOmniboxAndWaitForInstantExtendedSupport(); FocusOmniboxAndWaitForInstantExtendedSupport();
// Typing in the omnibox shows the overlay. // Typing in the omnibox shows the overlay.
SetOmniboxTextAndWaitForOverlayToShow("query"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("query"));
EXPECT_TRUE(instant()->model()->mode().is_search_suggestions()); EXPECT_TRUE(instant()->model()->mode().is_search_suggestions());
content::WebContents* preview = instant()->GetOverlayContents(); content::WebContents* preview = instant()->GetOverlayContents();
ASSERT_NE(static_cast<content::WebContents*>(NULL), preview); ASSERT_NE(static_cast<content::WebContents*>(NULL), preview);
...@@ -1156,7 +1156,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, NoWebUIBindingsOnResults) { ...@@ -1156,7 +1156,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, NoWebUIBindingsOnResults) {
FocusOmniboxAndWaitForInstantExtendedSupport(); FocusOmniboxAndWaitForInstantExtendedSupport();
// Typing in the omnibox shows the overlay. // Typing in the omnibox shows the overlay.
SetOmniboxTextAndWaitForOverlayToShow("query"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("query"));
content::WebContents* preview = instant()->GetOverlayContents(); content::WebContents* preview = instant()->GetOverlayContents();
EXPECT_TRUE(instant()->model()->mode().is_search_suggestions()); EXPECT_TRUE(instant()->model()->mode().is_search_suggestions());
// Commit the search by pressing Enter. // Commit the search by pressing Enter.
...@@ -1226,7 +1226,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, ...@@ -1226,7 +1226,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest,
EXPECT_FALSE(instant()->IsOverlayingSearchResults()); EXPECT_FALSE(instant()->IsOverlayingSearchResults());
// Typing in the omnibox should show the overlay. // Typing in the omnibox should show the overlay.
SetOmniboxTextAndWaitForOverlayToShow("query"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("query"));
EXPECT_TRUE(instant()->IsOverlayingSearchResults()); EXPECT_TRUE(instant()->IsOverlayingSearchResults());
EXPECT_EQ(overlay, instant()->GetOverlayContents()); EXPECT_EQ(overlay, instant()->GetOverlayContents());
...@@ -1321,7 +1321,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, TransientEntrySet) { ...@@ -1321,7 +1321,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, TransientEntrySet) {
content::WindowedNotificationObserver observer( content::WindowedNotificationObserver observer(
chrome::NOTIFICATION_INSTANT_COMMITTED, chrome::NOTIFICATION_INSTANT_COMMITTED,
content::NotificationService::AllSources()); content::NotificationService::AllSources());
SetOmniboxTextAndWaitForOverlayToShow("query"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("query"));
browser()->window()->GetLocationBar()->AcceptInput(); browser()->window()->GetLocationBar()->AcceptInput();
observer.Wait(); observer.Wait();
...@@ -1366,7 +1366,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, DISABLED_TransientEntryRemoved) { ...@@ -1366,7 +1366,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, DISABLED_TransientEntryRemoved) {
)); ));
// Commit the overlay. // Commit the overlay.
SetOmniboxTextAndWaitForOverlayToShow("query"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("query"));
browser()->window()->GetLocationBar()->AcceptInput(); browser()->window()->GetLocationBar()->AcceptInput();
observer.Wait(); observer.Wait();
...@@ -1468,7 +1468,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, AutocompleteProvidersDone) { ...@@ -1468,7 +1468,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, AutocompleteProvidersDone) {
EXPECT_TRUE(UpdateSearchState(overlay)); EXPECT_TRUE(UpdateSearchState(overlay));
EXPECT_EQ(0, on_native_suggestions_calls_); EXPECT_EQ(0, on_native_suggestions_calls_);
SetOmniboxTextAndWaitForOverlayToShow("railroad"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("railroad"));
EXPECT_EQ(overlay, instant()->GetOverlayContents()); EXPECT_EQ(overlay, instant()->GetOverlayContents());
EXPECT_TRUE(UpdateSearchState(overlay)); EXPECT_TRUE(UpdateSearchState(overlay));
...@@ -1531,7 +1531,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, ...@@ -1531,7 +1531,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest,
// The overlay showing will trigger top bars in 1st tab to be hidden, but keep // The overlay showing will trigger top bars in 1st tab to be hidden, but keep
// 2nd tab's visible. // 2nd tab's visible.
browser()->tab_strip_model()->ActivateTabAt(0, true); browser()->tab_strip_model()->ActivateTabAt(0, true);
SetOmniboxTextAndWaitForOverlayToShow("http://www.example.com/"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("http://www.example.com/"));
EXPECT_FALSE(tab0_helper->model()->top_bars_visible()); EXPECT_FALSE(tab0_helper->model()->top_bars_visible());
EXPECT_TRUE(tab1_helper->model()->top_bars_visible()); EXPECT_TRUE(tab1_helper->model()->top_bars_visible());
...@@ -1549,7 +1549,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, ...@@ -1549,7 +1549,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest,
// Type in omnibox to trigger full-height overlay, which will trigger its top // Type in omnibox to trigger full-height overlay, which will trigger its top
// bars to be hidden, but keep 2nd tab's visible. // bars to be hidden, but keep 2nd tab's visible.
SetOmniboxTextAndWaitForOverlayToShow("query"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("query"));
EXPECT_FALSE(tab0_helper->model()->top_bars_visible()); EXPECT_FALSE(tab0_helper->model()->top_bars_visible());
EXPECT_TRUE(tab1_helper->model()->top_bars_visible()); EXPECT_TRUE(tab1_helper->model()->top_bars_visible());
...@@ -1594,7 +1594,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, TemporaryTextResetWhenPopupClosed) { ...@@ -1594,7 +1594,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, TemporaryTextResetWhenPopupClosed) {
EXPECT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); EXPECT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser()));
// Show the overlay and arrow-down to a suggestion (this sets temporary text). // Show the overlay and arrow-down to a suggestion (this sets temporary text).
SetOmniboxTextAndWaitForOverlayToShow("juju"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("juju"));
SendDownArrow(); SendDownArrow();
EXPECT_TRUE(HasTemporaryText()); EXPECT_TRUE(HasTemporaryText());
...@@ -1626,7 +1626,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, ...@@ -1626,7 +1626,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest,
EXPECT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); EXPECT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser()));
// Show the overlay and arrow-down to a suggestion (this sets temporary text). // Show the overlay and arrow-down to a suggestion (this sets temporary text).
SetOmniboxTextAndWaitForOverlayToShow("thangam"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("thangam"));
SendDownArrow(); SendDownArrow();
EXPECT_TRUE(HasTemporaryText()); EXPECT_TRUE(HasTemporaryText());
...@@ -1653,7 +1653,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, ...@@ -1653,7 +1653,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest,
IN_PROC_BROWSER_TEST_F(InstantExtendedTest, DeniesUnexpectedSuggestions) { IN_PROC_BROWSER_TEST_F(InstantExtendedTest, DeniesUnexpectedSuggestions) {
ASSERT_NO_FATAL_FAILURE(SetupInstant(browser())); ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
FocusOmniboxAndWaitForInstantExtendedSupport(); FocusOmniboxAndWaitForInstantExtendedSupport();
SetOmniboxTextAndWaitForOverlayToShow("chip"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("chip"));
SendDownArrow(); SendDownArrow();
EXPECT_EQ("result 1", GetOmniboxText()); EXPECT_EQ("result 1", GetOmniboxText());
...@@ -1675,7 +1675,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, EmptyAutocompleteResults) { ...@@ -1675,7 +1675,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, EmptyAutocompleteResults) {
// Type a URL, so that there's at least one autocomplete result (a "URL what // Type a URL, so that there's at least one autocomplete result (a "URL what
// you typed" match). // you typed" match).
SetOmniboxTextAndWaitForOverlayToShow("http://upsamina/"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("http://upsamina/"));
content::WebContents* overlay = instant()->GetOverlayContents(); content::WebContents* overlay = instant()->GetOverlayContents();
......
...@@ -84,9 +84,7 @@ class InstantExtendedManualTest : public InProcessBrowserTest, ...@@ -84,9 +84,7 @@ class InstantExtendedManualTest : public InProcessBrowserTest,
bool PressBackspaceAndWaitForOverlayToShow() { bool PressBackspaceAndWaitForOverlayToShow() {
InstantTestModelObserver observer( InstantTestModelObserver observer(
instant()->model(), SearchMode::MODE_SEARCH_SUGGESTIONS); instant()->model(), SearchMode::MODE_SEARCH_SUGGESTIONS);
bool result = PressBackspace(); return PressBackspace() && observer.WaitForExpectedOverlayState();
observer.WaitForDesiredOverlayState();
return result;
} }
void PressEnterAndWaitForNavigation() { void PressEnterAndWaitForNavigation() {
...@@ -166,7 +164,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedManualTest, ...@@ -166,7 +164,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedManualTest,
// Type "face" and expect Google to set gray text for "book" to suggest // Type "face" and expect Google to set gray text for "book" to suggest
// [facebook], the query. // [facebook], the query.
SetOmniboxTextAndWaitForOverlayToShow("face"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("face"));
EXPECT_EQ(ASCIIToUTF16("face"), omnibox()->GetText()); EXPECT_EQ(ASCIIToUTF16("face"), omnibox()->GetText());
EXPECT_EQ(ASCIIToUTF16("book"), GetGrayText()); EXPECT_EQ(ASCIIToUTF16("book"), GetGrayText());
...@@ -190,7 +188,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedManualTest, ...@@ -190,7 +188,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedManualTest,
// Type "fan" and expect Google to set gray text to "dango" to suggest // Type "fan" and expect Google to set gray text to "dango" to suggest
// [fandango], the query. // [fandango], the query.
SetOmniboxTextAndWaitForOverlayToShow("fan"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("fan"));
EXPECT_EQ(ASCIIToUTF16("fan"), omnibox()->GetText()); EXPECT_EQ(ASCIIToUTF16("fan"), omnibox()->GetText());
EXPECT_EQ(ASCIIToUTF16("dango"), GetGrayText()); EXPECT_EQ(ASCIIToUTF16("dango"), GetGrayText());
...@@ -215,7 +213,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedManualTest, ...@@ -215,7 +213,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedManualTest,
// Type "facebook.c" and expect Google to set blue text to "om" to suggest // Type "facebook.c" and expect Google to set blue text to "om" to suggest
// http://www.facebook.com/, the URL. // http://www.facebook.com/, the URL.
SetOmniboxTextAndWaitForOverlayToShow("facebook.c"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("facebook.c"));
EXPECT_EQ(ASCIIToUTF16("facebook.com"), omnibox()->GetText()); EXPECT_EQ(ASCIIToUTF16("facebook.com"), omnibox()->GetText());
EXPECT_EQ(ASCIIToUTF16("om"), GetBlueText()); EXPECT_EQ(ASCIIToUTF16("om"), GetBlueText());
bool selected = false; bool selected = false;
...@@ -245,7 +243,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedManualTest, ...@@ -245,7 +243,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedManualTest,
// Type "facebook.com/" and expect Google to set blue text to "login.php" to // Type "facebook.com/" and expect Google to set blue text to "login.php" to
// suggest http://www.facebook.com/login.php, the URL. // suggest http://www.facebook.com/login.php, the URL.
SetOmniboxTextAndWaitForOverlayToShow("facebook.com/"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("facebook.com/"));
EXPECT_EQ(ASCIIToUTF16("facebook.com/login.php"), omnibox()->GetText()); EXPECT_EQ(ASCIIToUTF16("facebook.com/login.php"), omnibox()->GetText());
EXPECT_EQ(ASCIIToUTF16("login.php"), GetBlueText()); EXPECT_EQ(ASCIIToUTF16("login.php"), GetBlueText());
bool selected = false; bool selected = false;
...@@ -276,7 +274,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedManualTest, ...@@ -276,7 +274,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedManualTest,
// Type "a.cop" and expect Google to set gray text to "land" to suggest the // Type "a.cop" and expect Google to set gray text to "land" to suggest the
// query [a.copland]. // query [a.copland].
SetOmniboxTextAndWaitForOverlayToShow("a.cop"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("a.cop"));
EXPECT_EQ(ASCIIToUTF16("a.cop"), omnibox()->GetText()); EXPECT_EQ(ASCIIToUTF16("a.cop"), omnibox()->GetText());
EXPECT_EQ(ASCIIToUTF16("land"), GetGrayText()); EXPECT_EQ(ASCIIToUTF16("land"), GetGrayText());
...@@ -303,7 +301,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedManualTest, ...@@ -303,7 +301,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedManualTest,
EXPECT_TRUE(OverlayIsGoogle()); EXPECT_TRUE(OverlayIsGoogle());
// Type "e.co/" and expect the top suggestion to be the URL "e.co/". // Type "e.co/" and expect the top suggestion to be the URL "e.co/".
SetOmniboxTextAndWaitForOverlayToShow("e.co/"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("e.co/"));
EXPECT_EQ(ASCIIToUTF16("e.co/"), omnibox()->GetText()); EXPECT_EQ(ASCIIToUTF16("e.co/"), omnibox()->GetText());
EXPECT_EQ(ASCIIToUTF16(""), GetBlueText()); EXPECT_EQ(ASCIIToUTF16(""), GetBlueText());
EXPECT_EQ(ASCIIToUTF16(""), GetGrayText()); EXPECT_EQ(ASCIIToUTF16(""), GetGrayText());
...@@ -333,7 +331,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedManualTest, MANUAL_TypeURLAndPressEnter) { ...@@ -333,7 +331,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedManualTest, MANUAL_TypeURLAndPressEnter) {
// Type "www.facebook.com" and expect the top suggestion to be the URL // Type "www.facebook.com" and expect the top suggestion to be the URL
// facebook.com. // facebook.com.
SetOmniboxTextAndWaitForOverlayToShow("www.facebook.com"); ASSERT_TRUE(SetOmniboxTextAndWaitForOverlayToShow("www.facebook.com"));
EXPECT_EQ(ASCIIToUTF16("www.facebook.com"), omnibox()->GetText()); EXPECT_EQ(ASCIIToUTF16("www.facebook.com"), omnibox()->GetText());
EXPECT_EQ(ASCIIToUTF16(""), GetBlueText()); EXPECT_EQ(ASCIIToUTF16(""), GetBlueText());
bool selected = false; bool selected = false;
...@@ -345,8 +343,9 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedManualTest, MANUAL_TypeURLAndPressEnter) { ...@@ -345,8 +343,9 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedManualTest, MANUAL_TypeURLAndPressEnter) {
EXPECT_TRUE(GetActiveTabURL().DomainIs("facebook.com")); EXPECT_TRUE(GetActiveTabURL().DomainIs("facebook.com"));
} }
// TODO: http://crbug.com/232088
IN_PROC_BROWSER_TEST_F(InstantExtendedManualTest, IN_PROC_BROWSER_TEST_F(InstantExtendedManualTest,
MANUAL_TypeAutocompletedURLAndPressEnter) { DISABLED_TypeAutocompletedURLAndPressEnter) {
set_browser(browser()); set_browser(browser());
FocusOmniboxAndWaitForInstantExtendedSupport(); FocusOmniboxAndWaitForInstantExtendedSupport();
EXPECT_TRUE(OverlayIsGoogle()); EXPECT_TRUE(OverlayIsGoogle());
...@@ -365,8 +364,9 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedManualTest, ...@@ -365,8 +364,9 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedManualTest,
EXPECT_TRUE(GetActiveTabURL().DomainIs("facebook.com")); EXPECT_TRUE(GetActiveTabURL().DomainIs("facebook.com"));
} }
// TODO: http://crbug.com/230537
IN_PROC_BROWSER_TEST_F(InstantExtendedManualTest, IN_PROC_BROWSER_TEST_F(InstantExtendedManualTest,
MANUAL_PasteURLAndPressEnter) { DISABLED_PasteURLAndPressEnter) {
set_browser(browser()); set_browser(browser());
FocusOmniboxAndWaitForInstantExtendedSupport(); FocusOmniboxAndWaitForInstantExtendedSupport();
EXPECT_TRUE(OverlayIsGoogle()); EXPECT_TRUE(OverlayIsGoogle());
...@@ -379,7 +379,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedManualTest, ...@@ -379,7 +379,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedManualTest,
omnibox()->model()->on_paste(); omnibox()->model()->on_paste();
SetOmniboxText("www.facebook.com"); SetOmniboxText("www.facebook.com");
omnibox()->OnAfterPossibleChange(); omnibox()->OnAfterPossibleChange();
observer.WaitForDesiredOverlayState(); ASSERT_TRUE(observer.WaitForExpectedOverlayState());
EXPECT_EQ(ASCIIToUTF16("www.facebook.com"), omnibox()->GetText()); EXPECT_EQ(ASCIIToUTF16("www.facebook.com"), omnibox()->GetText());
EXPECT_EQ(string16(), GetBlueText()); EXPECT_EQ(string16(), GetBlueText());
bool selected = false; bool selected = false;
......
...@@ -33,9 +33,10 @@ std::string WrapScript(const std::string& script) { ...@@ -33,9 +33,10 @@ std::string WrapScript(const std::string& script) {
InstantTestModelObserver::InstantTestModelObserver( InstantTestModelObserver::InstantTestModelObserver(
InstantOverlayModel* model, InstantOverlayModel* model,
SearchMode::Type desired_mode_type) SearchMode::Type expected_mode_type)
: model_(model), : model_(model),
desired_mode_type_(desired_mode_type) { expected_mode_type_(expected_mode_type),
observed_mode_type_(static_cast<SearchMode::Type>(-1)) {
model_->AddObserver(this); model_->AddObserver(this);
} }
...@@ -43,13 +44,15 @@ InstantTestModelObserver::~InstantTestModelObserver() { ...@@ -43,13 +44,15 @@ InstantTestModelObserver::~InstantTestModelObserver() {
model_->RemoveObserver(this); model_->RemoveObserver(this);
} }
void InstantTestModelObserver::WaitForDesiredOverlayState() { bool InstantTestModelObserver::WaitForExpectedOverlayState() {
run_loop_.Run(); run_loop_.Run();
return observed_mode_type_ == expected_mode_type_;
} }
void InstantTestModelObserver::OverlayStateChanged( void InstantTestModelObserver::OverlayStateChanged(
const InstantOverlayModel& model) { const InstantOverlayModel& model) {
if (model.mode().mode == desired_mode_type_) observed_mode_type_ = model.mode().mode;
EXPECT_EQ(expected_mode_type_, observed_mode_type_);
run_loop_.Quit(); run_loop_.Quit();
} }
...@@ -140,12 +143,12 @@ void InstantTestBase::SetOmniboxText(const std::string& text) { ...@@ -140,12 +143,12 @@ void InstantTestBase::SetOmniboxText(const std::string& text) {
omnibox()->SetUserText(UTF8ToUTF16(text)); omnibox()->SetUserText(UTF8ToUTF16(text));
} }
void InstantTestBase::SetOmniboxTextAndWaitForOverlayToShow( bool InstantTestBase::SetOmniboxTextAndWaitForOverlayToShow(
const std::string& text) { const std::string& text) {
InstantTestModelObserver observer( InstantTestModelObserver observer(
instant()->model(), SearchMode::MODE_SEARCH_SUGGESTIONS); instant()->model(), SearchMode::MODE_SEARCH_SUGGESTIONS);
SetOmniboxText(text); SetOmniboxText(text);
observer.WaitForDesiredOverlayState(); return observer.WaitForExpectedOverlayState();
} }
void InstantTestBase::SetOmniboxTextAndWaitForSuggestion( void InstantTestBase::SetOmniboxTextAndWaitForSuggestion(
......
...@@ -32,17 +32,20 @@ class WebContents; ...@@ -32,17 +32,20 @@ class WebContents;
class InstantTestModelObserver : public InstantOverlayModelObserver { class InstantTestModelObserver : public InstantOverlayModelObserver {
public: public:
InstantTestModelObserver(InstantOverlayModel* model, InstantTestModelObserver(InstantOverlayModel* model,
SearchMode::Type desired_mode_type); SearchMode::Type expected_mode_type);
~InstantTestModelObserver(); virtual ~InstantTestModelObserver();
void WaitForDesiredOverlayState(); // Returns true if the |expected_mode_type_| was observed in
// OverlayStateChanged.
bool WaitForExpectedOverlayState();
// Overridden from InstantOverlayModelObserver: // Overridden from InstantOverlayModelObserver:
virtual void OverlayStateChanged(const InstantOverlayModel& model) OVERRIDE; virtual void OverlayStateChanged(const InstantOverlayModel& model) OVERRIDE;
private: private:
InstantOverlayModel* const model_; InstantOverlayModel* const model_;
const SearchMode::Type desired_mode_type_; const SearchMode::Type expected_mode_type_;
SearchMode::Type observed_mode_type_;
base::RunLoop run_loop_; base::RunLoop run_loop_;
DISALLOW_COPY_AND_ASSIGN(InstantTestModelObserver); DISALLOW_COPY_AND_ASSIGN(InstantTestModelObserver);
...@@ -89,7 +92,7 @@ class InstantTestBase { ...@@ -89,7 +92,7 @@ class InstantTestBase {
void FocusOmniboxAndWaitForInstantExtendedSupport(); void FocusOmniboxAndWaitForInstantExtendedSupport();
void SetOmniboxText(const std::string& text); void SetOmniboxText(const std::string& text);
void SetOmniboxTextAndWaitForOverlayToShow(const std::string& text); bool SetOmniboxTextAndWaitForOverlayToShow(const std::string& text);
void SetOmniboxTextAndWaitForSuggestion(const std::string& text); void SetOmniboxTextAndWaitForSuggestion(const std::string& text);
bool GetBoolFromJS(content::WebContents* contents, bool GetBoolFromJS(content::WebContents* contents,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment