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

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

Issue 1362793002: Construct and check for mojo::Event's LocationData as needed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Also audit wheel_data and brush_data. 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
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->location = mojo::LocationData::New();
254 event->pointer_data->location->x = x; 255 event->pointer_data->location->x = x;
255 event->pointer_data->location->y = y; 256 event->pointer_data->location->y = y;
256 return event.Pass(); 257 return event.Pass();
257 } 258 }
258 259
259 mojo::EventPtr CreatePointerUpEvent(int x, int y) { 260 mojo::EventPtr CreatePointerUpEvent(int x, int y) {
260 mojo::EventPtr event(mojo::Event::New()); 261 mojo::EventPtr event(mojo::Event::New());
261 event->action = mojo::EVENT_TYPE_POINTER_UP; 262 event->action = mojo::EVENT_TYPE_POINTER_UP;
262 event->pointer_data = mojo::PointerData::New(); 263 event->pointer_data = mojo::PointerData::New();
263 event->pointer_data->pointer_id = 1u; 264 event->pointer_data->pointer_id = 1u;
265 event->pointer_data->location = mojo::LocationData::New();
264 event->pointer_data->location->x = x; 266 event->pointer_data->location->x = x;
265 event->pointer_data->location->y = y; 267 event->pointer_data->location->y = y;
266 return event.Pass(); 268 return event.Pass();
267 } 269 }
268 270
269 } // namespace 271 } // namespace
270 272
271 // ----------------------------------------------------------------------------- 273 // -----------------------------------------------------------------------------
272 274
273 class ViewTreeTest : public testing::Test { 275 class ViewTreeTest : public testing::Test {
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 EXPECT_EQ("Focused id=2,1", 443 EXPECT_EQ("Focused id=2,1",
442 ChangesToDescription1(*wm_client()->tracker()->changes())[0]); 444 ChangesToDescription1(*wm_client()->tracker()->changes())[0]);
443 ASSERT_EQ(2u, embed_connection->tracker()->changes()->size()); 445 ASSERT_EQ(2u, embed_connection->tracker()->changes()->size());
444 EXPECT_EQ("Focused id=2,1", 446 EXPECT_EQ("Focused id=2,1",
445 ChangesToDescription1(*embed_connection->tracker()->changes())[0]); 447 ChangesToDescription1(*embed_connection->tracker()->changes())[0]);
446 EXPECT_EQ("InputEvent view=2,1 event_action=4", 448 EXPECT_EQ("InputEvent view=2,1 event_action=4",
447 ChangesToDescription1(*embed_connection->tracker()->changes())[1]); 449 ChangesToDescription1(*embed_connection->tracker()->changes())[1]);
448 } 450 }
449 451
450 } // namespace mus 452 } // namespace mus
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698