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

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: Fix test 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
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 0a3f5558b1bce86af46f87e2c678276412c5b98d..e6679c9766ff6165dae19b658bd5c45277d60a4b 100644
--- a/chrome/browser/ui/search/instant_extended_interactive_uitest.cc
+++ b/chrome/browser/ui/search/instant_extended_interactive_uitest.cc
@@ -109,7 +109,8 @@ class InstantExtendedTest : public InProcessBrowserTest,
first_most_visited_item_id_(0),
on_native_suggestions_calls_(0),
on_change_calls_(0),
- submit_count_(0) {
+ submit_count_(0),
+ on_esc_key_press_event_calls_(0) {
}
protected:
virtual void SetUpInProcessBrowserTestFixture() OVERRIDE {
@@ -160,7 +161,9 @@ class InstantExtendedTest : public InProcessBrowserTest,
GetIntFromJS(contents, "submitCount",
&submit_count_) &&
GetStringFromJS(contents, "apiHandle.value",
- &query_value_);
+ &query_value_) &&
+ GetIntFromJS(contents, "onEscKeyPressedCalls",
+ &on_esc_key_press_event_calls_);
}
TemplateURL* GetDefaultSearchProviderTemplateURL() {
@@ -210,6 +213,7 @@ class InstantExtendedTest : public InProcessBrowserTest,
int on_native_suggestions_calls_;
int on_change_calls_;
int submit_count_;
+ int on_esc_key_press_event_calls_;
std::string query_value_;
};
@@ -1948,8 +1952,7 @@ 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) {
ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
FocusOmniboxAndWaitForInstantOverlayAndNTPSupport();
@@ -1957,10 +1960,11 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, DISABLED_EscapeClearsOmnibox) {
content::WindowedNotificationObserver instant_tab_observer(
chrome::NOTIFICATION_INSTANT_TAB_SUPPORT_DETERMINED,
content::NotificationService::AllSources());
- ui_test_utils::NavigateToURLWithDisposition(browser(),
- GURL(chrome::kChromeUINewTabURL),
- CURRENT_TAB,
- ui_test_utils::BROWSER_TEST_NONE);
+ ui_test_utils::NavigateToURLWithDisposition(
+ browser(),
+ GURL(chrome::kChromeUINewTabURL),
+ CURRENT_TAB,
+ ui_test_utils::BROWSER_TEST_WAIT_FOR_TAB);
instant_tab_observer.Wait();
content::WebContents* contents =
@@ -1986,6 +1990,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, DISABLED_EscapeClearsOmnibox) {
EXPECT_TRUE(UpdateSearchState(contents));
EXPECT_LT(0, on_change_calls_);
EXPECT_EQ(0, submit_count_);
+ EXPECT_LT(0, on_esc_key_press_event_calls_);
}
IN_PROC_BROWSER_TEST_F(InstantExtendedTest, OnDefaultSearchProviderChanged) {

Powered by Google App Engine
This is Rietveld 408576698