OLD | NEW |
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" |
11 #include "components/mus/server_view.h" | 11 #include "components/mus/server_view.h" |
12 #include "components/mus/test_server_view_delegate.h" | 12 #include "components/mus/test_server_view_delegate.h" |
13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
14 #include "ui/mojo/events/input_events.mojom.h" | 14 #include "ui/mojo/events/input_events.mojom.h" |
15 | 15 |
16 namespace mus { | 16 namespace view_manager { |
17 namespace { | 17 namespace { |
18 | 18 |
19 const uint32_t kInvalidGestureId = GestureManager::kInvalidGestureId; | 19 const uint32_t kInvalidGestureId = GestureManager::kInvalidGestureId; |
20 | 20 |
21 void MarkAsRespondsToTouch(ServerView* view) { | 21 void MarkAsRespondsToTouch(ServerView* view) { |
22 std::vector<uint8_t> empty_vector; | 22 std::vector<uint8_t> empty_vector; |
23 view->SetProperty(kViewManagerKeyWantsTouchEvents, &empty_vector); | 23 view->SetProperty(mojo::kViewManagerKeyWantsTouchEvents, &empty_vector); |
24 } | 24 } |
25 | 25 |
26 std::set<uint32_t> SetWith(uint32_t v1) { | 26 std::set<uint32_t> SetWith(uint32_t v1) { |
27 std::set<uint32_t> result; | 27 std::set<uint32_t> result; |
28 result.insert(v1); | 28 result.insert(v1); |
29 return result; | 29 return result; |
30 } | 30 } |
31 | 31 |
32 std::set<uint32_t> SetWith(uint32_t v1, uint32_t v2) { | 32 std::set<uint32_t> SetWith(uint32_t v1, uint32_t v2) { |
33 std::set<uint32_t> result; | 33 std::set<uint32_t> result; |
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 *CreateEvent(mojo::EVENT_TYPE_POINTER_CANCEL, pointer_id, 5, 5)); | 458 *CreateEvent(mojo::EVENT_TYPE_POINTER_CANCEL, pointer_id, 5, 5)); |
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 view_manager |
OLD | NEW |