| OLD | NEW |
| 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 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 | 259 |
| 260 window_server()->user_id_tracker()->SetActiveUserId(kTestId1); | 260 window_server()->user_id_tracker()->SetActiveUserId(kTestId1); |
| 261 | 261 |
| 262 ASSERT_EQ(1u, display_manager()->displays().size()); | 262 ASSERT_EQ(1u, display_manager()->displays().size()); |
| 263 Display* display = display_manager()->GetDisplayById(display_id); | 263 Display* display = display_manager()->GetDisplayById(display_id); |
| 264 WindowManagerState* active_wms = | 264 WindowManagerState* active_wms = |
| 265 display->GetActiveWindowManagerDisplayRoot()->window_manager_state(); | 265 display->GetActiveWindowManagerDisplayRoot()->window_manager_state(); |
| 266 ASSERT_TRUE(active_wms); | 266 ASSERT_TRUE(active_wms); |
| 267 EXPECT_EQ(kTestId1, active_wms->user_id()); | 267 EXPECT_EQ(kTestId1, active_wms->user_id()); |
| 268 | 268 |
| 269 static_cast<PlatformDisplayDelegate*>(display)->OnEvent(ui::PointerEvent( | 269 ui::PointerEvent pointer_event(ui::MouseEvent( |
| 270 ui::MouseEvent(ui::ET_MOUSE_PRESSED, gfx::Point(20, 25), | 270 ui::ET_MOUSE_PRESSED, gfx::Point(20, 25), gfx::Point(20, 25), |
| 271 gfx::Point(20, 25), base::TimeTicks(), | 271 base::TimeTicks(), ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON)); |
| 272 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON))); | 272 ignore_result(static_cast<PlatformDisplayDelegate*>(display) |
| 273 ->GetEventSink() |
| 274 ->OnEventFromSource(&pointer_event)); |
| 273 | 275 |
| 274 EXPECT_TRUE(EventDispatcherTestApi(active_wms->event_dispatcher()) | 276 EXPECT_TRUE(EventDispatcherTestApi(active_wms->event_dispatcher()) |
| 275 .AreAnyPointersDown()); | 277 .AreAnyPointersDown()); |
| 276 EXPECT_EQ(gfx::Point(20, 25), | 278 EXPECT_EQ(gfx::Point(20, 25), |
| 277 active_wms->event_dispatcher()->mouse_pointer_last_location()); | 279 active_wms->event_dispatcher()->mouse_pointer_last_location()); |
| 278 | 280 |
| 279 // Switch the user. Should trigger resetting state in old event dispatcher | 281 // Switch the user. Should trigger resetting state in old event dispatcher |
| 280 // and update state in new event dispatcher. | 282 // and update state in new event dispatcher. |
| 281 window_server()->user_id_tracker()->SetActiveUserId(kTestId2); | 283 window_server()->user_id_tracker()->SetActiveUserId(kTestId2); |
| 282 EXPECT_NE( | 284 EXPECT_NE( |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 ASSERT_EQ(0u, tree_client->tracker()->changes()->size()); | 424 ASSERT_EQ(0u, tree_client->tracker()->changes()->size()); |
| 423 | 425 |
| 424 // The window should be destroyed when the client says so. | 426 // The window should be destroyed when the client says so. |
| 425 ASSERT_TRUE(tree->DeleteWindow(secondary_root_id)); | 427 ASSERT_TRUE(tree->DeleteWindow(secondary_root_id)); |
| 426 EXPECT_TRUE(secondary_root_destroyed); | 428 EXPECT_TRUE(secondary_root_destroyed); |
| 427 } | 429 } |
| 428 | 430 |
| 429 } // namespace test | 431 } // namespace test |
| 430 } // namespace ws | 432 } // namespace ws |
| 431 } // namespace ui | 433 } // namespace ui |
| OLD | NEW |