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

Unified Diff: ash/wm/window_manager_unittest.cc

Issue 519113002: Do not mutate ui::Event properties during nested event processing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments changed Created 6 years, 3 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 | « no previous file | ui/events/event.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/window_manager_unittest.cc
diff --git a/ash/wm/window_manager_unittest.cc b/ash/wm/window_manager_unittest.cc
index c47c8e274b37b28b70a117aa18d327c2231d3ed0..6a8d5004ee59c532fcf7852381306e8d0099ea99 100644
--- a/ash/wm/window_manager_unittest.cc
+++ b/ash/wm/window_manager_unittest.cc
@@ -199,6 +199,7 @@ TEST_F(WindowManagerTest, Focus) {
EXPECT_EQ(w122.get(), focus_client->GetFocusedWindow());
// The key press should be sent to the focused sub-window.
+ keyev = ui::KeyEvent(ui::ET_KEY_PRESSED, ui::VKEY_E, ui::EF_NONE);
details = dispatcher->OnEventFromSource(&keyev);
ASSERT_FALSE(details.dispatcher_destroyed);
EXPECT_EQ(ui::VKEY_E, w122delegate->last_key_code());
@@ -237,6 +238,7 @@ TEST_F(WindowManagerTest, Focus) {
EXPECT_EQ(aura::client::GetFocusClient(w12.get()),
aura::client::GetFocusClient(w123.get()));
EXPECT_EQ(NULL, aura::client::GetFocusClient(w12.get())->GetFocusedWindow());
+ keyev = ui::KeyEvent(ui::ET_KEY_PRESSED, ui::VKEY_E, ui::EF_NONE);
details = dispatcher->OnEventFromSource(&keyev);
EXPECT_FALSE(keyev.handled() || details.dispatcher_destroyed);
@@ -252,6 +254,7 @@ TEST_F(WindowManagerTest, Focus) {
// parent window is not focusable.
w12->RemoveChild(w123.get());
EXPECT_EQ(NULL, aura::client::GetFocusClient(w123.get()));
+ keyev = ui::KeyEvent(ui::ET_KEY_PRESSED, ui::VKEY_E, ui::EF_NONE);
details = dispatcher->OnEventFromSource(&keyev);
EXPECT_FALSE(keyev.handled() || details.dispatcher_destroyed);
}
« no previous file with comments | « no previous file | ui/events/event.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698