OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <string> | 5 #include <string> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "components/mus/public/cpp/types.h" | 9 #include "components/mus/public/cpp/types.h" |
10 #include "components/mus/public/cpp/util.h" | 10 #include "components/mus/public/cpp/util.h" |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 }; | 249 }; |
250 | 250 |
251 mojo::EventPtr CreatePointerDownEvent(int x, int y) { | 251 mojo::EventPtr CreatePointerDownEvent(int x, int y) { |
252 mojo::EventPtr event(mojo::Event::New()); | 252 mojo::EventPtr event(mojo::Event::New()); |
253 event->action = mojo::EVENT_TYPE_POINTER_DOWN; | 253 event->action = mojo::EVENT_TYPE_POINTER_DOWN; |
254 event->pointer_data = mojo::PointerData::New(); | 254 event->pointer_data = mojo::PointerData::New(); |
255 event->pointer_data->pointer_id = 1u; | 255 event->pointer_data->pointer_id = 1u; |
256 event->pointer_data->location = mojo::LocationData::New(); | 256 event->pointer_data->location = mojo::LocationData::New(); |
257 event->pointer_data->location->x = x; | 257 event->pointer_data->location->x = x; |
258 event->pointer_data->location->y = y; | 258 event->pointer_data->location->y = y; |
| 259 event->pointer_data->kind = mojo::POINTER_KIND_TOUCH; |
259 return event.Pass(); | 260 return event.Pass(); |
260 } | 261 } |
261 | 262 |
262 mojo::EventPtr CreatePointerUpEvent(int x, int y) { | 263 mojo::EventPtr CreatePointerUpEvent(int x, int y) { |
263 mojo::EventPtr event(mojo::Event::New()); | 264 mojo::EventPtr event(mojo::Event::New()); |
264 event->action = mojo::EVENT_TYPE_POINTER_UP; | 265 event->action = mojo::EVENT_TYPE_POINTER_UP; |
265 event->pointer_data = mojo::PointerData::New(); | 266 event->pointer_data = mojo::PointerData::New(); |
266 event->pointer_data->pointer_id = 1u; | 267 event->pointer_data->pointer_id = 1u; |
267 event->pointer_data->location = mojo::LocationData::New(); | 268 event->pointer_data->location = mojo::LocationData::New(); |
268 event->pointer_data->location->x = x; | 269 event->pointer_data->location->x = x; |
269 event->pointer_data->location->y = y; | 270 event->pointer_data->location->y = y; |
| 271 event->pointer_data->kind = mojo::POINTER_KIND_TOUCH; |
270 return event.Pass(); | 272 return event.Pass(); |
271 } | 273 } |
272 | 274 |
273 } // namespace | 275 } // namespace |
274 | 276 |
275 // ----------------------------------------------------------------------------- | 277 // ----------------------------------------------------------------------------- |
276 | 278 |
277 class WindowTreeTest : public testing::Test { | 279 class WindowTreeTest : public testing::Test { |
278 public: | 280 public: |
279 WindowTreeTest() : wm_client_(nullptr) {} | 281 WindowTreeTest() : wm_client_(nullptr) {} |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 ASSERT_EQ(2u, embed_connection->tracker()->changes()->size()); | 463 ASSERT_EQ(2u, embed_connection->tracker()->changes()->size()); |
462 EXPECT_EQ("Focused id=2,1", | 464 EXPECT_EQ("Focused id=2,1", |
463 ChangesToDescription1(*embed_connection->tracker()->changes())[0]); | 465 ChangesToDescription1(*embed_connection->tracker()->changes())[0]); |
464 EXPECT_EQ("InputEvent window=2,1 event_action=4", | 466 EXPECT_EQ("InputEvent window=2,1 event_action=4", |
465 ChangesToDescription1(*embed_connection->tracker()->changes())[1]); | 467 ChangesToDescription1(*embed_connection->tracker()->changes())[1]); |
466 } | 468 } |
467 | 469 |
468 } // namespace ws | 470 } // namespace ws |
469 | 471 |
470 } // namespace mus | 472 } // namespace mus |
OLD | NEW |