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

Side by Side Diff: components/mus/gesture_manager_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.cc ('k') | components/mus/view_tree_unittest.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/mus/gesture_manager.h" 5 #include "components/mus/gesture_manager.h"
6 6
7 #include "base/strings/string_number_conversions.h" 7 #include "base/strings/string_number_conversions.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "components/mus/gesture_manager_delegate.h" 9 #include "components/mus/gesture_manager_delegate.h"
10 #include "components/mus/public/cpp/keys.h" 10 #include "components/mus/public/cpp/keys.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 } 61 }
62 62
63 mojo::EventPtr CreateEvent(mojo::EventType type, 63 mojo::EventPtr CreateEvent(mojo::EventType type,
64 int32_t pointer_id, 64 int32_t pointer_id,
65 int x, 65 int x,
66 int y) { 66 int y) {
67 mojo::EventPtr event(mojo::Event::New()); 67 mojo::EventPtr event(mojo::Event::New());
68 event->action = type; 68 event->action = type;
69 event->pointer_data = mojo::PointerData::New(); 69 event->pointer_data = mojo::PointerData::New();
70 event->pointer_data->pointer_id = pointer_id; 70 event->pointer_data->pointer_id = pointer_id;
71 event->pointer_data->x = x; 71 event->pointer_data->location->x = x;
72 event->pointer_data->y = y; 72 event->pointer_data->location->y = y;
73 return event.Pass(); 73 return event.Pass();
74 } 74 }
75 75
76 struct CompareViewByConnectionId { 76 struct CompareViewByConnectionId {
77 bool operator()(const ServerView* a, const ServerView* b) { 77 bool operator()(const ServerView* a, const ServerView* b) {
78 return a->id().connection_id < b->id().connection_id; 78 return a->id().connection_id < b->id().connection_id;
79 } 79 }
80 }; 80 };
81 81
82 std::string IDsToString(const std::set<uint32_t>& ids) { 82 std::string IDsToString(const std::set<uint32_t>& ids) {
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 EXPECT_EQ(std::string(), gesture_delegate_.GetAndClearDescriptions()); 459 EXPECT_EQ(std::string(), gesture_delegate_.GetAndClearDescriptions());
460 460
461 // Respond from the first view, with no gesture, should unblock cancel. 461 // Respond from the first view, with no gesture, should unblock cancel.
462 SetGestures(&root_, pointer_id, kInvalidGestureId, SetWith(5u, 10u), 462 SetGestures(&root_, pointer_id, kInvalidGestureId, SetWith(5u, 10u),
463 std::set<uint32_t>()); 463 std::set<uint32_t>());
464 EXPECT_EQ("cancel pointer=1 connection=1 chosen=false", 464 EXPECT_EQ("cancel pointer=1 connection=1 chosen=false",
465 gesture_delegate_.GetAndClearDescriptions()); 465 gesture_delegate_.GetAndClearDescriptions());
466 } 466 }
467 467
468 } // namespace mus 468 } // namespace mus
OLDNEW
« no previous file with comments | « components/mus/gesture_manager.cc ('k') | components/mus/view_tree_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698