| 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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 }; | 253 }; |
| 254 | 254 |
| 255 EventPtr CreatePointerDownEvent(int x, int y) { | 255 EventPtr CreatePointerDownEvent(int x, int y) { |
| 256 EventPtr event(Event::New()); | 256 EventPtr event(Event::New()); |
| 257 event->action = mus::mojom::EVENT_TYPE_POINTER_DOWN; | 257 event->action = mus::mojom::EVENT_TYPE_POINTER_DOWN; |
| 258 event->pointer_data = PointerData::New(); | 258 event->pointer_data = PointerData::New(); |
| 259 event->pointer_data->pointer_id = 1u; | 259 event->pointer_data->pointer_id = 1u; |
| 260 event->pointer_data->location = LocationData::New(); | 260 event->pointer_data->location = LocationData::New(); |
| 261 event->pointer_data->location->x = x; | 261 event->pointer_data->location->x = x; |
| 262 event->pointer_data->location->y = y; | 262 event->pointer_data->location->y = y; |
| 263 event->pointer_data->kind = mojom::POINTER_KIND_TOUCH; |
| 263 return event.Pass(); | 264 return event.Pass(); |
| 264 } | 265 } |
| 265 | 266 |
| 266 EventPtr CreatePointerUpEvent(int x, int y) { | 267 EventPtr CreatePointerUpEvent(int x, int y) { |
| 267 EventPtr event(Event::New()); | 268 EventPtr event(Event::New()); |
| 268 event->action = mus::mojom::EVENT_TYPE_POINTER_UP; | 269 event->action = mus::mojom::EVENT_TYPE_POINTER_UP; |
| 269 event->pointer_data = PointerData::New(); | 270 event->pointer_data = PointerData::New(); |
| 270 event->pointer_data->pointer_id = 1u; | 271 event->pointer_data->pointer_id = 1u; |
| 271 event->pointer_data->location = LocationData::New(); | 272 event->pointer_data->location = LocationData::New(); |
| 272 event->pointer_data->location->x = x; | 273 event->pointer_data->location->x = x; |
| 273 event->pointer_data->location->y = y; | 274 event->pointer_data->location->y = y; |
| 275 event->pointer_data->kind = mojom::POINTER_KIND_TOUCH; |
| 274 return event.Pass(); | 276 return event.Pass(); |
| 275 } | 277 } |
| 276 | 278 |
| 277 } // namespace | 279 } // namespace |
| 278 | 280 |
| 279 // ----------------------------------------------------------------------------- | 281 // ----------------------------------------------------------------------------- |
| 280 | 282 |
| 281 class WindowTreeTest : public testing::Test { | 283 class WindowTreeTest : public testing::Test { |
| 282 public: | 284 public: |
| 283 WindowTreeTest() : wm_client_(nullptr) {} | 285 WindowTreeTest() : wm_client_(nullptr) {} |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 ASSERT_EQ(2u, embed_connection->tracker()->changes()->size()); | 467 ASSERT_EQ(2u, embed_connection->tracker()->changes()->size()); |
| 466 EXPECT_EQ("Focused id=2,1", | 468 EXPECT_EQ("Focused id=2,1", |
| 467 ChangesToDescription1(*embed_connection->tracker()->changes())[0]); | 469 ChangesToDescription1(*embed_connection->tracker()->changes())[0]); |
| 468 EXPECT_EQ("InputEvent window=2,1 event_action=4", | 470 EXPECT_EQ("InputEvent window=2,1 event_action=4", |
| 469 ChangesToDescription1(*embed_connection->tracker()->changes())[1]); | 471 ChangesToDescription1(*embed_connection->tracker()->changes())[1]); |
| 470 } | 472 } |
| 471 | 473 |
| 472 } // namespace ws | 474 } // namespace ws |
| 473 | 475 |
| 474 } // namespace mus | 476 } // namespace mus |
| OLD | NEW |