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

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

Issue 14562006: Handle Esc key press event in Local NTP. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed review comments Created 7 years, 7 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') | chrome/browser/ui/search/instant_page.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/search/instant_extended_interactive_uitest.cc
diff --git a/chrome/browser/ui/search/instant_extended_interactive_uitest.cc b/chrome/browser/ui/search/instant_extended_interactive_uitest.cc
index 4147a2895aac16151d0ccba3ac517fc8e486eab5..8df2d2e9fd9e9c21edeedc9f2de5733ad0d5d09e 100644
--- a/chrome/browser/ui/search/instant_extended_interactive_uitest.cc
+++ b/chrome/browser/ui/search/instant_extended_interactive_uitest.cc
@@ -1930,10 +1930,18 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, EmptyAutocompleteResults) {
}
// Test that hitting Esc to clear the omnibox works. http://crbug.com/231744.
-// TODO(sreeram): reenable once ESC bug is actually fixed.
-IN_PROC_BROWSER_TEST_F(InstantExtendedTest, DISABLED_EscapeClearsOmnibox) {
+IN_PROC_BROWSER_TEST_F(InstantExtendedTest, EscapeClearsOmnibox) {
+ // Use only the local overlay.
samarth 2013/05/05 23:49:30 This shouldn't be necessary given the call to SetI
kmadhusu 2013/05/06 00:11:16 hmm. No specific reason to force this test for loc
+ CommandLine::ForCurrentProcess()->AppendSwitch(
+ switches::kEnableLocalOnlyInstantExtendedAPI);
+ ASSERT_TRUE(chrome::IsLocalOnlyInstantExtendedAPIEnabled());
ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
- FocusOmniboxAndWaitForInstantOverlayAndNTPSupport();
+
+ // The second argument indicates to use only the local overlay and NTP.
+ instant()->SetInstantEnabled(true, true);
+
+ // Focus omnibox and confirm overlay isn't shown.
+ FocusOmniboxAndWaitForInstantOverlaySupport();
// Navigate to the Instant NTP, and wait for it to be recognized.
content::WindowedNotificationObserver instant_tab_observer(
@@ -1945,29 +1953,13 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, DISABLED_EscapeClearsOmnibox) {
ui_test_utils::BROWSER_TEST_NONE);
instant_tab_observer.Wait();
- content::WebContents* contents =
- browser()->tab_strip_model()->GetActiveWebContents();
-
- // Type a query. Verify that the query is seen by the page.
+ // Type a query. Verify that the query is shown in the omnibox.
SetOmniboxText("mojo");
- std::string query;
- EXPECT_TRUE(GetStringFromJS(contents, "chrome.embeddedSearch.searchBox.value",
- &query));
- EXPECT_EQ("mojo", query);
+ EXPECT_EQ("mojo", GetOmniboxText());
- EXPECT_TRUE(content::ExecuteScript(contents,
- "onChangeCalls = submitCount = 0;"));
-
- // Hit Escape, and verify that the page sees that the query is cleared.
+ // Hit Escape, and verify that the omnibox text is cleared.
SendEscape();
- EXPECT_TRUE(GetStringFromJS(contents, "chrome.embeddedSearch.searchBox.value",
- &query));
- EXPECT_EQ("", query);
EXPECT_EQ("", GetOmniboxText());
samarth 2013/05/05 23:49:30 This should be true, but isn't really testing ever
kmadhusu 2013/05/06 00:11:16 I completely agree. This test can be improved. I w
-
- EXPECT_TRUE(UpdateSearchState(contents));
- EXPECT_LT(0, on_change_calls_);
- EXPECT_EQ(0, submit_count_);
}
IN_PROC_BROWSER_TEST_F(InstantExtendedTest, OnDefaultSearchProviderChanged) {
« no previous file with comments | « chrome/browser/ui/search/instant_controller.cc ('k') | chrome/browser/ui/search/instant_page.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698