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

Unified Diff: ui/aura/event_filter_unittest.cc

Issue 11047030: Decouple EventClientImpl and root window. Check containers on the same root window as focused windo… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix type in event_filter_unittest Created 8 years, 2 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 | « ash/wm/power_button_controller.cc ('k') | ui/aura/test/event_generator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/event_filter_unittest.cc
diff --git a/ui/aura/event_filter_unittest.cc b/ui/aura/event_filter_unittest.cc
index 010fbfbbdb7dc36589c5c0f757aa7b51d674f491..1827e8120ae1c984f26c783b01c5ff2a0f0cba59 100644
--- a/ui/aura/event_filter_unittest.cc
+++ b/ui/aura/event_filter_unittest.cc
@@ -200,10 +200,17 @@ TEST_F(EventFilterTest, PostHandle) {
generator.PressKey(ui::VKEY_A, 0);
generator.PressLeftButton();
- EXPECT_EQ(1, w1_filter->key_event_count());
+#if defined(OS_WIN)
+ // Windows sends two WM_KEYDOWN/WM_CHAR events for one key press.
+ const int kExpectedKeyCount = 2;
+#else
+ const int kExpectedKeyCount = 1;
+#endif
+
+ EXPECT_EQ(kExpectedKeyCount, w1_filter->key_event_count());
EXPECT_EQ(1, w1_filter->mouse_event_count());
EXPECT_EQ(1, root_window_filter.mouse_event_count());
- EXPECT_EQ(1, d11.key_event_count());
+ EXPECT_EQ(kExpectedKeyCount, d11.key_event_count());
EXPECT_EQ(1, d11.mouse_event_count());
root_window_filter.ResetCounts();
@@ -246,12 +253,12 @@ TEST_F(EventFilterTest, PostHandle) {
generator.PressKey(ui::VKEY_A, 0);
generator.PressLeftButton();
- EXPECT_EQ(1, d11.key_event_count());
+ EXPECT_EQ(kExpectedKeyCount, d11.key_event_count());
EXPECT_EQ(1, d11.mouse_event_count());
// The delegate processed the event. But it should still bubble up to the
// post-target filters.
- EXPECT_EQ(1, w1_filter->key_event_count());
- EXPECT_EQ(1, root_window_filter.key_event_count());
+ EXPECT_EQ(kExpectedKeyCount, w1_filter->key_event_count());
+ EXPECT_EQ(kExpectedKeyCount, root_window_filter.key_event_count());
EXPECT_EQ(1, w1_filter->mouse_event_count());
EXPECT_EQ(1, root_window_filter.mouse_event_count());
@@ -268,7 +275,7 @@ TEST_F(EventFilterTest, PostHandle) {
generator.PressKey(ui::VKEY_A, 0);
generator.PressLeftButton();
- EXPECT_EQ(1, d11.key_event_count());
+ EXPECT_EQ(kExpectedKeyCount, d11.key_event_count());
EXPECT_EQ(1, d11.mouse_event_count());
// The delegate consumed the event. So it should no longer reach the
// post-target filters.
@@ -295,7 +302,7 @@ TEST_F(EventFilterTest, PostHandle) {
generator.PressKey(ui::VKEY_A, 0);
generator.PressLeftButton();
- EXPECT_EQ(1, w1_filter->key_event_count());
+ EXPECT_EQ(kExpectedKeyCount, w1_filter->key_event_count());
EXPECT_EQ(0, d11.key_event_count());
EXPECT_EQ(1, w1_filter->mouse_event_count());
EXPECT_EQ(0, d11.mouse_event_count());
« no previous file with comments | « ash/wm/power_button_controller.cc ('k') | ui/aura/test/event_generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698