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

Side by Side Diff: ui/events/mojo/struct_traits_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 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 "base/message_loop/message_loop.h" 5 #include "base/message_loop/message_loop.h"
6 #include "mojo/public/cpp/bindings/binding_set.h" 6 #include "mojo/public/cpp/bindings/binding_set.h"
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 #include "ui/events/keycodes/dom/dom_code.h" 8 #include "ui/events/keycodes/dom/dom_code.h"
9 #include "ui/events/mojo/traits_test_service.mojom.h" 9 #include "ui/events/mojo/traits_test_service.mojom.h"
10 10
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 for (size_t i = 0; i < arraysize(kTestData); i++) { 192 for (size_t i = 0; i < arraysize(kTestData); i++) {
193 std::unique_ptr<Event> output; 193 std::unique_ptr<Event> output;
194 proxy->EchoEvent(Event::Clone(kTestData[i]), &output); 194 proxy->EchoEvent(Event::Clone(kTestData[i]), &output);
195 EXPECT_TRUE(output->IsPointerEvent()); 195 EXPECT_TRUE(output->IsPointerEvent());
196 196
197 const PointerEvent* output_ptr_event = output->AsPointerEvent(); 197 const PointerEvent* output_ptr_event = output->AsPointerEvent();
198 EXPECT_EQ(kTestData[i].type(), output_ptr_event->type()); 198 EXPECT_EQ(kTestData[i].type(), output_ptr_event->type());
199 EXPECT_EQ(kTestData[i].flags(), output_ptr_event->flags()); 199 EXPECT_EQ(kTestData[i].flags(), output_ptr_event->flags());
200 EXPECT_EQ(kTestData[i].location(), output_ptr_event->location()); 200 EXPECT_EQ(kTestData[i].location(), output_ptr_event->location());
201 EXPECT_EQ(kTestData[i].root_location(), output_ptr_event->root_location()); 201 EXPECT_EQ(kTestData[i].root_location(), output_ptr_event->root_location());
202 EXPECT_EQ(kTestData[i].pointer_id(), output_ptr_event->pointer_id()); 202 EXPECT_EQ(kTestData[i].pointer_details().id,
203 output_ptr_event->pointer_details().id);
203 EXPECT_EQ(kTestData[i].changed_button_flags(), 204 EXPECT_EQ(kTestData[i].changed_button_flags(),
204 output_ptr_event->changed_button_flags()); 205 output_ptr_event->changed_button_flags());
205 EXPECT_EQ(kTestData[i].pointer_details(), 206 EXPECT_EQ(kTestData[i].pointer_details(),
206 output_ptr_event->pointer_details()); 207 output_ptr_event->pointer_details());
207 } 208 }
208 } 209 }
209 210
210 TEST_F(StructTraitsTest, PointerWheelEvent) { 211 TEST_F(StructTraitsTest, PointerWheelEvent) {
211 MouseWheelEvent kTestData[] = { 212 MouseWheelEvent kTestData[] = {
212 {gfx::Vector2d(11, 15), gfx::Point(3, 4), gfx::Point(40, 30), 213 {gfx::Vector2d(11, 15), gfx::Point(3, 4), gfx::Point(40, 30),
(...skipping 16 matching lines...) Expand all
229 EXPECT_EQ(kTestData[i].flags(), output_pointer_event->flags()); 230 EXPECT_EQ(kTestData[i].flags(), output_pointer_event->flags());
230 EXPECT_EQ(kTestData[i].location(), output_pointer_event->location()); 231 EXPECT_EQ(kTestData[i].location(), output_pointer_event->location());
231 EXPECT_EQ(kTestData[i].root_location(), 232 EXPECT_EQ(kTestData[i].root_location(),
232 output_pointer_event->root_location()); 233 output_pointer_event->root_location());
233 EXPECT_EQ(kTestData[i].offset(), 234 EXPECT_EQ(kTestData[i].offset(),
234 output_pointer_event->pointer_details().offset); 235 output_pointer_event->pointer_details().offset);
235 } 236 }
236 } 237 }
237 238
238 } // namespace ui 239 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698