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

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

Issue 2655303004: Add id properties to PointerEvent (Closed)
Patch Set: pointer id 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "services/ui/ws/event_dispatcher.h" 5 #include "services/ui/ws/event_dispatcher.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <queue> 10 #include <queue>
(...skipping 1306 matching lines...) Expand 10 before | Expand all | Expand 10 after
1317 test_event_dispatcher_delegate()->GetAndAdvanceDispatchedEventDetails(); 1317 test_event_dispatcher_delegate()->GetAndAdvanceDispatchedEventDetails();
1318 ASSERT_TRUE(details); 1318 ASSERT_TRUE(details);
1319 ASSERT_EQ(child.get(), details->window); 1319 ASSERT_EQ(child.get(), details->window);
1320 1320
1321 ASSERT_TRUE(details->event); 1321 ASSERT_TRUE(details->event);
1322 ASSERT_TRUE(details->event->IsPointerEvent()); 1322 ASSERT_TRUE(details->event->IsPointerEvent());
1323 1323
1324 ui::PointerEvent* dispatched_event = details->event->AsPointerEvent(); 1324 ui::PointerEvent* dispatched_event = details->event->AsPointerEvent();
1325 EXPECT_EQ(gfx::Point(25, 20), dispatched_event->root_location()); 1325 EXPECT_EQ(gfx::Point(25, 20), dispatched_event->root_location());
1326 EXPECT_EQ(gfx::Point(15, 10), dispatched_event->location()); 1326 EXPECT_EQ(gfx::Point(15, 10), dispatched_event->location());
1327 EXPECT_EQ(touch_id, dispatched_event->pointer_id()); 1327 EXPECT_EQ(touch_id, dispatched_event->pointer_details().id);
1328 } 1328 }
1329 } 1329 }
1330 1330
1331 TEST_F(EventDispatcherTest, ResetClearsPointerDown) { 1331 TEST_F(EventDispatcherTest, ResetClearsPointerDown) {
1332 std::unique_ptr<ServerWindow> child = CreateChildWindow(WindowId(1, 3)); 1332 std::unique_ptr<ServerWindow> child = CreateChildWindow(WindowId(1, 3));
1333 1333
1334 root_window()->SetBounds(gfx::Rect(0, 0, 100, 100)); 1334 root_window()->SetBounds(gfx::Rect(0, 0, 100, 100));
1335 child->SetBounds(gfx::Rect(10, 10, 20, 20)); 1335 child->SetBounds(gfx::Rect(10, 10, 20, 20));
1336 1336
1337 // Send event that is over child. 1337 // Send event that is over child.
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after
1797 1797
1798 // Set capture on |c1|. No events should be sent as |c1| is in the same 1798 // Set capture on |c1|. No events should be sent as |c1| is in the same
1799 // client. 1799 // client.
1800 event_dispatcher()->SetCaptureWindow(c1.get(), kClientAreaId); 1800 event_dispatcher()->SetCaptureWindow(c1.get(), kClientAreaId);
1801 EXPECT_FALSE(test_event_dispatcher_delegate()->has_queued_events()); 1801 EXPECT_FALSE(test_event_dispatcher_delegate()->has_queued_events());
1802 } 1802 }
1803 1803
1804 } // namespace test 1804 } // namespace test
1805 } // namespace ws 1805 } // namespace ws
1806 } // namespace ui 1806 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698