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

Side by Side Diff: components/mus/view_tree_unittest.cc

Issue 1313353010: Overhaul Mandoline event transport code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed gn check Created 5 years, 3 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/gesture_manager_unittest.cc ('k') | components/pdf_viewer/pdf_viewer.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 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/client_connection.h" 9 #include "components/mus/client_connection.h"
10 #include "components/mus/connection_manager.h" 10 #include "components/mus/connection_manager.h"
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 244
245 private: 245 private:
246 DISALLOW_COPY_AND_ASSIGN(TestDisplayManagerFactory); 246 DISALLOW_COPY_AND_ASSIGN(TestDisplayManagerFactory);
247 }; 247 };
248 248
249 mojo::EventPtr CreatePointerDownEvent(int x, int y) { 249 mojo::EventPtr CreatePointerDownEvent(int x, int y) {
250 mojo::EventPtr event(mojo::Event::New()); 250 mojo::EventPtr event(mojo::Event::New());
251 event->action = mojo::EVENT_TYPE_POINTER_DOWN; 251 event->action = mojo::EVENT_TYPE_POINTER_DOWN;
252 event->pointer_data = mojo::PointerData::New(); 252 event->pointer_data = mojo::PointerData::New();
253 event->pointer_data->pointer_id = 1u; 253 event->pointer_data->pointer_id = 1u;
254 event->pointer_data->x = x; 254 event->pointer_data->location->x = x;
255 event->pointer_data->y = y; 255 event->pointer_data->location->y = y;
256 return event.Pass(); 256 return event.Pass();
257 } 257 }
258 258
259 mojo::EventPtr CreatePointerUpEvent(int x, int y) { 259 mojo::EventPtr CreatePointerUpEvent(int x, int y) {
260 mojo::EventPtr event(mojo::Event::New()); 260 mojo::EventPtr event(mojo::Event::New());
261 event->action = mojo::EVENT_TYPE_POINTER_UP; 261 event->action = mojo::EVENT_TYPE_POINTER_UP;
262 event->pointer_data = mojo::PointerData::New(); 262 event->pointer_data = mojo::PointerData::New();
263 event->pointer_data->pointer_id = 1u; 263 event->pointer_data->pointer_id = 1u;
264 event->pointer_data->x = x; 264 event->pointer_data->location->x = x;
265 event->pointer_data->y = y; 265 event->pointer_data->location->y = y;
266 return event.Pass(); 266 return event.Pass();
267 } 267 }
268 268
269 } // namespace 269 } // namespace
270 270
271 // ----------------------------------------------------------------------------- 271 // -----------------------------------------------------------------------------
272 272
273 class ViewTreeTest : public testing::Test { 273 class ViewTreeTest : public testing::Test {
274 public: 274 public:
275 ViewTreeTest() : wm_client_(nullptr) {} 275 ViewTreeTest() : wm_client_(nullptr) {}
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 EXPECT_EQ("Focused id=2,1", 441 EXPECT_EQ("Focused id=2,1",
442 ChangesToDescription1(*wm_client()->tracker()->changes())[0]); 442 ChangesToDescription1(*wm_client()->tracker()->changes())[0]);
443 ASSERT_EQ(2u, embed_connection->tracker()->changes()->size()); 443 ASSERT_EQ(2u, embed_connection->tracker()->changes()->size());
444 EXPECT_EQ("Focused id=2,1", 444 EXPECT_EQ("Focused id=2,1",
445 ChangesToDescription1(*embed_connection->tracker()->changes())[0]); 445 ChangesToDescription1(*embed_connection->tracker()->changes())[0]);
446 EXPECT_EQ("InputEvent view=2,1 event_action=4", 446 EXPECT_EQ("InputEvent view=2,1 event_action=4",
447 ChangesToDescription1(*embed_connection->tracker()->changes())[1]); 447 ChangesToDescription1(*embed_connection->tracker()->changes())[1]);
448 } 448 }
449 449
450 } // namespace mus 450 } // namespace mus
OLDNEW
« no previous file with comments | « components/mus/gesture_manager_unittest.cc ('k') | components/pdf_viewer/pdf_viewer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698