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

Side by Side Diff: components/mus/ws/display_unittest.cc

Issue 1975533002: Change ui::Event::time_stamp from TimeDelta to TimeTicks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 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
« no previous file with comments | « components/mus/ws/cursor_unittest.cc ('k') | components/mus/ws/event_dispatcher_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 162
163 DisplayManager* display_manager = window_server_->display_manager(); 163 DisplayManager* display_manager = window_server_->display_manager();
164 ASSERT_EQ(1u, display_manager->displays().size()); 164 ASSERT_EQ(1u, display_manager->displays().size());
165 Display* display = *display_manager->displays().begin(); 165 Display* display = *display_manager->displays().begin();
166 WindowManagerState* active_wms = display->GetActiveWindowManagerState(); 166 WindowManagerState* active_wms = display->GetActiveWindowManagerState();
167 ASSERT_TRUE(active_wms); 167 ASSERT_TRUE(active_wms);
168 EXPECT_EQ(kTestId1, active_wms->user_id()); 168 EXPECT_EQ(kTestId1, active_wms->user_id());
169 169
170 static_cast<PlatformDisplayDelegate*>(display)->OnEvent(ui::PointerEvent( 170 static_cast<PlatformDisplayDelegate*>(display)->OnEvent(ui::PointerEvent(
171 ui::MouseEvent(ui::ET_MOUSE_PRESSED, gfx::Point(20, 25), 171 ui::MouseEvent(ui::ET_MOUSE_PRESSED, gfx::Point(20, 25),
172 gfx::Point(20, 25), base::TimeDelta(), 172 gfx::Point(20, 25), base::TimeTicks(),
173 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON))); 173 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON)));
174 174
175 EXPECT_TRUE(EventDispatcherTestApi(active_wms->event_dispatcher()) 175 EXPECT_TRUE(EventDispatcherTestApi(active_wms->event_dispatcher())
176 .AreAnyPointersDown()); 176 .AreAnyPointersDown());
177 EXPECT_EQ(gfx::Point(20, 25), 177 EXPECT_EQ(gfx::Point(20, 25),
178 active_wms->event_dispatcher()->mouse_pointer_last_location()); 178 active_wms->event_dispatcher()->mouse_pointer_last_location());
179 179
180 // Switch the user. Should trigger resetting state in old event dispatcher 180 // Switch the user. Should trigger resetting state in old event dispatcher
181 // and update state in new event dispatcher. 181 // and update state in new event dispatcher.
182 window_server_->user_id_tracker()->SetActiveUserId(kTestId2); 182 window_server_->user_id_tracker()->SetActiveUserId(kTestId2);
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 EXPECT_TRUE(window_tree_binding2->client()->tracker()->changes()->empty()); 319 EXPECT_TRUE(window_tree_binding2->client()->tracker()->changes()->empty());
320 window_tree_binding1->client()->tracker()->changes()->clear(); 320 window_tree_binding1->client()->tracker()->changes()->clear();
321 window_tree_binding2->client()->tracker()->changes()->clear(); 321 window_tree_binding2->client()->tracker()->changes()->clear();
322 EXPECT_FALSE(display1->GetFocusedWindow()); 322 EXPECT_FALSE(display1->GetFocusedWindow());
323 EXPECT_EQ(child2, display2->GetFocusedWindow()); 323 EXPECT_EQ(child2, display2->GetFocusedWindow());
324 } 324 }
325 325
326 } // namespace test 326 } // namespace test
327 } // namespace ws 327 } // namespace ws
328 } // namespace mus 328 } // namespace mus
OLDNEW
« no previous file with comments | « components/mus/ws/cursor_unittest.cc ('k') | components/mus/ws/event_dispatcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698