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

Side by Side Diff: services/ui/ws/display_unittest.cc

Issue 2712963003: mustash: Use ui::chromeos::EventRewriter in mus (Closed)
Patch Set: Fix compile issues Created 3 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stdint.h> 5 #include <stdint.h>
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 254
255 window_server()->user_id_tracker()->SetActiveUserId(kTestId1); 255 window_server()->user_id_tracker()->SetActiveUserId(kTestId1);
256 256
257 ASSERT_EQ(1u, display_manager()->displays().size()); 257 ASSERT_EQ(1u, display_manager()->displays().size());
258 Display* display = display_manager()->GetDisplayById(display_id); 258 Display* display = display_manager()->GetDisplayById(display_id);
259 WindowManagerState* active_wms = 259 WindowManagerState* active_wms =
260 display->GetActiveWindowManagerDisplayRoot()->window_manager_state(); 260 display->GetActiveWindowManagerDisplayRoot()->window_manager_state();
261 ASSERT_TRUE(active_wms); 261 ASSERT_TRUE(active_wms);
262 EXPECT_EQ(kTestId1, active_wms->user_id()); 262 EXPECT_EQ(kTestId1, active_wms->user_id());
263 263
264 static_cast<PlatformDisplayDelegate*>(display)->OnEvent(ui::PointerEvent( 264 DisplayTestApi display_test_api(display);
265 ui::MouseEvent(ui::ET_MOUSE_PRESSED, gfx::Point(20, 25), 265 display_test_api.OnEvent(ui::PointerEvent(ui::MouseEvent(
266 gfx::Point(20, 25), base::TimeTicks(), 266 ui::ET_MOUSE_PRESSED, gfx::Point(20, 25), gfx::Point(20, 25),
267 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON))); 267 base::TimeTicks(), ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON)));
268 268
269 EXPECT_TRUE(EventDispatcherTestApi(active_wms->event_dispatcher()) 269 EXPECT_TRUE(EventDispatcherTestApi(active_wms->event_dispatcher())
270 .AreAnyPointersDown()); 270 .AreAnyPointersDown());
271 EXPECT_EQ(gfx::Point(20, 25), 271 EXPECT_EQ(gfx::Point(20, 25),
272 active_wms->event_dispatcher()->mouse_pointer_last_location()); 272 active_wms->event_dispatcher()->mouse_pointer_last_location());
273 273
274 // Switch the user. Should trigger resetting state in old event dispatcher 274 // Switch the user. Should trigger resetting state in old event dispatcher
275 // and update state in new event dispatcher. 275 // and update state in new event dispatcher.
276 window_server()->user_id_tracker()->SetActiveUserId(kTestId2); 276 window_server()->user_id_tracker()->SetActiveUserId(kTestId2);
277 EXPECT_NE( 277 EXPECT_NE(
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 ASSERT_EQ(0u, tree_client->tracker()->changes()->size()); 417 ASSERT_EQ(0u, tree_client->tracker()->changes()->size());
418 418
419 // The window should be destroyed when the client says so. 419 // The window should be destroyed when the client says so.
420 ASSERT_TRUE(tree->DeleteWindow(secondary_root_id)); 420 ASSERT_TRUE(tree->DeleteWindow(secondary_root_id));
421 EXPECT_TRUE(secondary_root_destroyed); 421 EXPECT_TRUE(secondary_root_destroyed);
422 } 422 }
423 423
424 } // namespace test 424 } // namespace test
425 } // namespace ws 425 } // namespace ws
426 } // namespace ui 426 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698