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

Unified Diff: services/ui/ws/window_tree_unittest.cc

Issue 2125663002: mus: Add watcher for all touch events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Overload copy assignment operator for Change struct. Created 4 years, 5 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: services/ui/ws/window_tree_unittest.cc
diff --git a/services/ui/ws/window_tree_unittest.cc b/services/ui/ws/window_tree_unittest.cc
index 028ba9be9d9eb4bfe3d177b3e41b994031771546..cb0719f6a8e5f39070ea92489e09d54259066cee 100644
--- a/services/ui/ws/window_tree_unittest.cc
+++ b/services/ui/ws/window_tree_unittest.cc
@@ -325,7 +325,7 @@ TEST_F(WindowTreeTest, SetEventObserver) {
ASSERT_EQ(0u, client->tracker()->changes()->size());
// Create an observer for pointer-down events.
- WindowTreeTestApi(tree).SetEventObserver(
+ WindowTreeTestApi(tree).AddEventObserver(
CreateEventMatcher(ui::mojom::EventType::POINTER_DOWN), 111u);
// Pointer-down events are sent to the client.
@@ -336,7 +336,7 @@ TEST_F(WindowTreeTest, SetEventObserver) {
client->tracker()->changes()->clear();
// Clearing the observer stops sending events to the client.
- WindowTreeTestApi(tree).SetEventObserver(nullptr, 0u);
+ WindowTreeTestApi(tree).RemoveEventObserver(111u);
DispatchEventAndAckImmediately(pointer_down);
ASSERT_EQ(0u, client->tracker()->changes()->size());
}
@@ -351,7 +351,7 @@ TEST_F(WindowTreeTest, SetEventObserverNonMatching) {
EXPECT_NO_FATAL_FAILURE(SetupEventTargeting(&client, &tree, &window));
// Create an observer for pointer-down events.
- WindowTreeTestApi(tree).SetEventObserver(
+ WindowTreeTestApi(tree).AddEventObserver(
CreateEventMatcher(ui::mojom::EventType::POINTER_DOWN), 111u);
// Pointer-up events are not sent to the client, since they don't match.
@@ -370,7 +370,7 @@ TEST_F(WindowTreeTest, SetEventObserverSendsOnce) {
// Create an observer for pointer-up events (which do not cause focus
// changes).
- WindowTreeTestApi(tree).SetEventObserver(
+ WindowTreeTestApi(tree).AddEventObserver(
CreateEventMatcher(ui::mojom::EventType::POINTER_UP), 111u);
// Create an event inside the bounds of the client.
@@ -393,10 +393,10 @@ TEST_F(WindowTreeTest, SetEventObserverWrongUser) {
other_binding->client()->tracker()->changes()->clear();
// Set event observers on both the wm tree and the other user's tree.
- WindowTreeTestApi(wm_tree()).SetEventObserver(
+ WindowTreeTestApi(wm_tree()).AddEventObserver(
CreateEventMatcher(ui::mojom::EventType::POINTER_UP), 111u);
WindowTreeTestApi(other_tree)
- .SetEventObserver(CreateEventMatcher(ui::mojom::EventType::POINTER_UP),
+ .AddEventObserver(CreateEventMatcher(ui::mojom::EventType::POINTER_UP),
222u);
// An event is observed by the wm tree, but not by the other user's tree.
@@ -409,13 +409,13 @@ TEST_F(WindowTreeTest, SetEventObserverWrongUser) {
// Tests that an event observer cannot observe keystrokes.
TEST_F(WindowTreeTest, SetEventObserverKeyEventsDisallowed) {
- WindowTreeTestApi(wm_tree()).SetEventObserver(
+ WindowTreeTestApi(wm_tree()).AddEventObserver(
CreateEventMatcher(ui::mojom::EventType::KEY_PRESSED), 111u);
ui::KeyEvent key_pressed(ui::ET_KEY_PRESSED, ui::VKEY_A, ui::EF_NONE);
DispatchEventAndAckImmediately(key_pressed);
EXPECT_EQ(0u, wm_client()->tracker()->changes()->size());
- WindowTreeTestApi(wm_tree()).SetEventObserver(
+ WindowTreeTestApi(wm_tree()).AddEventObserver(
CreateEventMatcher(ui::mojom::EventType::KEY_RELEASED), 222u);
ui::KeyEvent key_released(ui::ET_KEY_RELEASED, ui::VKEY_A, ui::EF_NONE);
DispatchEventAndAckImmediately(key_released);

Powered by Google App Engine
This is Rietveld 408576698