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/view_manager/gesture_manager.h" | 5 #include "components/view_manager/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/view_manager/gesture_manager_delegate.h" | 9 #include "components/view_manager/gesture_manager_delegate.h" |
10 #include "components/view_manager/public/cpp/keys.h" | 10 #include "components/view_manager/public/cpp/keys.h" |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 } | 101 } |
102 | 102 |
103 } // namespace | 103 } // namespace |
104 | 104 |
105 class TestGestureManagerDelegate : public GestureManagerDelegate { | 105 class TestGestureManagerDelegate : public GestureManagerDelegate { |
106 public: | 106 public: |
107 TestGestureManagerDelegate() {} | 107 TestGestureManagerDelegate() {} |
108 ~TestGestureManagerDelegate() override {} | 108 ~TestGestureManagerDelegate() override {} |
109 | 109 |
110 std::string GetAndClearDescriptions() { | 110 std::string GetAndClearDescriptions() { |
111 const std::string result(JoinString(descriptions_, '\n')); | 111 const std::string result(base::JoinString(descriptions_, "\n")); |
112 descriptions_.clear(); | 112 descriptions_.clear(); |
113 return result; | 113 return result; |
114 } | 114 } |
115 | 115 |
116 std::vector<std::string>& descriptions() { return descriptions_; } | 116 std::vector<std::string>& descriptions() { return descriptions_; } |
117 | 117 |
118 void AppendDescriptionsFromResults(const ChangeMap& change_map) { | 118 void AppendDescriptionsFromResults(const ChangeMap& change_map) { |
119 std::set<const ServerView*, CompareViewByConnectionId> views_by_id; | 119 std::set<const ServerView*, CompareViewByConnectionId> views_by_id; |
120 for (const auto& pair : change_map) | 120 for (const auto& pair : change_map) |
121 views_by_id.insert(pair.first); | 121 views_by_id.insert(pair.first); |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 view_manager | 468 } // namespace view_manager |
OLD | NEW |