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

Unified Diff: ash/accelerators/accelerator_controller_unittest.cc

Issue 37733003: Make GetRootWindow() return a Window instead of a RootWindow. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 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/accelerators/accelerator_controller.cc ('k') | ash/accelerators/exit_warning_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/accelerators/accelerator_controller_unittest.cc
diff --git a/ash/accelerators/accelerator_controller_unittest.cc b/ash/accelerators/accelerator_controller_unittest.cc
index ce620621db1af5516b777f1a6c05ba1b80cbdfc7..575a5ec031450e0ac45e282c12ae1bc071a16e80 100644
--- a/ash/accelerators/accelerator_controller_unittest.cc
+++ b/ash/accelerators/accelerator_controller_unittest.cc
@@ -603,21 +603,23 @@ TEST_F(AcceleratorControllerTest, ProcessOnce) {
GetController()->Register(accelerator_a, &target);
// The accelerator is processed only once.
+ aura::WindowEventDispatcher* dispatcher =
+ Shell::GetPrimaryRootWindow()->GetDispatcher();
#if defined(OS_WIN)
MSG msg1 = { NULL, WM_KEYDOWN, ui::VKEY_A, 0 };
ui::TranslatedKeyEvent key_event1(msg1, false);
- EXPECT_TRUE(Shell::GetPrimaryRootWindow()->AsRootWindowHostDelegate()->
- OnHostKeyEvent(&key_event1));
+ EXPECT_TRUE(dispatcher->AsRootWindowHostDelegate()->OnHostKeyEvent(
+ &key_event1));
MSG msg2 = { NULL, WM_CHAR, L'A', 0 };
ui::TranslatedKeyEvent key_event2(msg2, true);
- EXPECT_FALSE(Shell::GetPrimaryRootWindow()->AsRootWindowHostDelegate()->
- OnHostKeyEvent(&key_event2));
+ EXPECT_FALSE(dispatcher->AsRootWindowHostDelegate()->OnHostKeyEvent(
+ &key_event2));
MSG msg3 = { NULL, WM_KEYUP, ui::VKEY_A, 0 };
ui::TranslatedKeyEvent key_event3(msg3, false);
- EXPECT_FALSE(Shell::GetPrimaryRootWindow()->AsRootWindowHostDelegate()->
- OnHostKeyEvent(&key_event3));
+ EXPECT_FALSE(dispatcher->AsRootWindowHostDelegate()->OnHostKeyEvent(
+ &key_event3));
#elif defined(USE_X11)
XEvent key_event;
ui::InitXKeyEventForTesting(ui::ET_KEY_PRESSED,
@@ -625,20 +627,20 @@ TEST_F(AcceleratorControllerTest, ProcessOnce) {
0,
&key_event);
ui::TranslatedKeyEvent key_event1(&key_event, false);
- EXPECT_TRUE(Shell::GetPrimaryRootWindow()->AsRootWindowHostDelegate()->
- OnHostKeyEvent(&key_event1));
+ EXPECT_TRUE(dispatcher->AsRootWindowHostDelegate()->OnHostKeyEvent(
+ &key_event1));
ui::TranslatedKeyEvent key_event2(&key_event, true);
- EXPECT_FALSE(Shell::GetPrimaryRootWindow()->AsRootWindowHostDelegate()->
- OnHostKeyEvent(&key_event2));
+ EXPECT_FALSE(dispatcher->AsRootWindowHostDelegate()->OnHostKeyEvent(
+ &key_event2));
ui::InitXKeyEventForTesting(ui::ET_KEY_RELEASED,
ui::VKEY_A,
0,
&key_event);
ui::TranslatedKeyEvent key_event3(&key_event, false);
- EXPECT_FALSE(Shell::GetPrimaryRootWindow()->AsRootWindowHostDelegate()->
- OnHostKeyEvent(&key_event3));
+ EXPECT_FALSE(dispatcher->AsRootWindowHostDelegate()->OnHostKeyEvent(
+ &key_event3));
#endif
EXPECT_EQ(1, target.accelerator_pressed_count());
}
« no previous file with comments | « ash/accelerators/accelerator_controller.cc ('k') | ash/accelerators/exit_warning_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698