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

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: git cl upload 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 13feb0d9e1184560882e46ff4e17ad2d4e482b01..5f19927084438cb2e982caea982bedc5371f0966 100644
--- a/chrome/browser/ui/search/instant_extended_interactive_uitest.cc
+++ b/chrome/browser/ui/search/instant_extended_interactive_uitest.cc
@@ -111,7 +111,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 {
@@ -162,7 +163,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() {
@@ -212,6 +215,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_;
};
@@ -1951,7 +1955,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.
+// TODO(kmadhusu): Investigate and re-enable this test.
IN_PROC_BROWSER_TEST_F(InstantExtendedTest, DISABLED_EscapeClearsOmnibox) {
ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
FocusOmniboxAndWaitForInstantOverlayAndNTPSupport();
@@ -1960,10 +1964,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 =
@@ -1989,6 +1994,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) {
« 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