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

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

Issue 12792013: Instant extended: Remove suggest commit on lost focus (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update another test Created 7 years, 9 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 3bfeb77f672bc69d825a0f9a724e7d26d86aef8e..ace1eebdcf36b75892c523fed907ca26346c6b79 100644
--- a/chrome/browser/ui/search/instant_extended_browsertest.cc
+++ b/chrome/browser/ui/search/instant_extended_browsertest.cc
@@ -334,24 +334,14 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, OmniboxTextUponFocusLostCommit) {
// Commit the overlay by lost focus (e.g. clicking on the page).
instant()->CommitIfPossible(INSTANT_COMMIT_FOCUS_LOST);
- // Search term extraction should kick in with the autocompleted text.
- EXPECT_EQ(ASCIIToUTF16("johnny depp"), omnibox()->GetText());
-
- // Suggestion should be cleared at this point.
- EXPECT_EQ(ASCIIToUTF16(""), omnibox()->GetInstantSuggestion());
+ // Omnibox text and suggestion should not be changed.
+ EXPECT_EQ(ASCIIToUTF16("johnny"), omnibox()->GetText());
+ EXPECT_EQ(ASCIIToUTF16(" depp"), omnibox()->GetInstantSuggestion());
}
// Test that omnibox text is correctly set when clicking on committed SERP.
-// Disabled on Mac because omnibox focus loss is not working correctly.
-#if defined(OS_MACOSX)
-#define MAYBE_OmniboxTextUponFocusedCommittedSERP \
- DISABLED_OmniboxTextUponFocusedCommittedSERP
-#else
-#define MAYBE_OmniboxTextUponFocusedCommittedSERP \
- OmniboxTextUponFocusedCommittedSERP
-#endif
IN_PROC_BROWSER_TEST_F(InstantExtendedTest,
- MAYBE_OmniboxTextUponFocusedCommittedSERP) {
+ OmniboxTextUponFocusedCommittedSERP) {
// Setup Instant.
ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
FocusOmniboxAndWaitForInstantExtendedSupport();
@@ -377,25 +367,15 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest,
"handleOnChange();"));
instant()->instant_tab()->contents()->GetView()->Focus();
- // Search term extraction should kick in with the autocompleted text.
- EXPECT_EQ(ASCIIToUTF16("hello kitty"), omnibox()->GetText());
-
- // Suggestion should be cleared at this point.
- EXPECT_EQ(ASCIIToUTF16(""), omnibox()->GetInstantSuggestion());
+ // Omnibox text and suggestion should not be changed.
+ EXPECT_EQ(ASCIIToUTF16("hello"), omnibox()->GetText());
+ EXPECT_EQ(ASCIIToUTF16(" kitty"), omnibox()->GetInstantSuggestion());
}
// Checks that a previous Navigation suggestion is not re-used when a search
-// suggestion comes in. Disabled on Mac because omnibox focus loss is not
-// working correctly. http://crbug.com/178520
-#if defined(OS_MACOSX)
-#define MAYBE_NavigationSuggestionIsDiscardedUponSearchSuggestion \
- DISABLED_NavigationSuggestionIsDiscardedUponSearchSuggestion
-#else
-#define MAYBE_NavigationSuggestionIsDiscardedUponSearchSuggestion \
- NavigationSuggestionIsDiscardedUponSearchSuggestion
-#endif
+// suggestion comes in.
IN_PROC_BROWSER_TEST_F(InstantExtendedTest,
- MAYBE_NavigationSuggestionIsDiscardedUponSearchSuggestion) {
+ NavigationSuggestionIsDiscardedUponSearchSuggestion) {
// Setup Instant.
ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
FocusOmniboxAndWaitForInstantExtendedSupport();
@@ -413,7 +393,8 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest,
"behavior = 2;"
"handleOnChange();"));
instant()->overlay()->contents()->GetView()->Focus();
- EXPECT_EQ(ASCIIToUTF16("exams are great"), omnibox()->GetText());
+ EXPECT_EQ(ASCIIToUTF16("exam"), omnibox()->GetText());
+ EXPECT_EQ(ASCIIToUTF16("s are great"), omnibox()->GetInstantSuggestion());
// TODO(jered): Remove this after fixing OnBlur().
omnibox()->RevertAll();

Powered by Google App Engine
This is Rietveld 408576698