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 #ifndef CHROME_BROWSER_MEDIA_ROUTER_TEST_HELPER_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_TEST_HELPER_H_ |
6 #define CHROME_BROWSER_MEDIA_ROUTER_TEST_HELPER_H_ | 6 #define CHROME_BROWSER_MEDIA_ROUTER_TEST_HELPER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "chrome/browser/media/router/issues_observer.h" | 11 #include "chrome/browser/media/router/issues_observer.h" |
12 #include "chrome/browser/media/router/media_router.mojom.h" | 12 #include "chrome/browser/media/router/media_router.mojom.h" |
13 #include "chrome/browser/media/router/media_router_mojo_impl.h" | 13 #include "chrome/browser/media/router/media_router_mojo_impl.h" |
14 #include "chrome/browser/media/router/media_routes_observer.h" | 14 #include "chrome/browser/media/router/media_routes_observer.h" |
15 #include "chrome/browser/media/router/media_sinks_observer.h" | 15 #include "chrome/browser/media/router/media_sinks_observer.h" |
16 #include "chrome/browser/media/router/presentation_connection_state_observer.h" | |
17 #include "extensions/browser/event_page_tracker.h" | 16 #include "extensions/browser/event_page_tracker.h" |
18 #include "testing/gmock/include/gmock/gmock.h" | 17 #include "testing/gmock/include/gmock/gmock.h" |
19 | 18 |
20 namespace media_router { | 19 namespace media_router { |
21 | 20 |
22 // Matcher for objects that uses Equals() member function for equality check. | 21 // Matcher for objects that uses Equals() member function for equality check. |
23 MATCHER_P(Equals, other, "") { | 22 MATCHER_P(Equals, other, "") { |
24 return arg.Equals(other); | 23 return arg.Equals(other); |
25 } | 24 } |
26 | 25 |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 }; | 137 }; |
139 | 138 |
140 class MockMediaRoutesObserver : public MediaRoutesObserver { | 139 class MockMediaRoutesObserver : public MediaRoutesObserver { |
141 public: | 140 public: |
142 explicit MockMediaRoutesObserver(MediaRouter* router); | 141 explicit MockMediaRoutesObserver(MediaRouter* router); |
143 ~MockMediaRoutesObserver() override; | 142 ~MockMediaRoutesObserver() override; |
144 | 143 |
145 MOCK_METHOD1(OnRoutesUpdated, void(const std::vector<MediaRoute>& sinks)); | 144 MOCK_METHOD1(OnRoutesUpdated, void(const std::vector<MediaRoute>& sinks)); |
146 }; | 145 }; |
147 | 146 |
148 class MockPresentationConnectionStateObserver | |
149 : public PresentationConnectionStateObserver { | |
150 public: | |
151 MockPresentationConnectionStateObserver(MediaRouter* router, | |
152 const MediaRoute::Id& route_id); | |
153 ~MockPresentationConnectionStateObserver() override; | |
154 | |
155 MOCK_METHOD1(OnStateChanged, | |
156 void(content::PresentationConnectionState state)); | |
157 }; | |
158 | |
159 class MockEventPageTracker : public extensions::EventPageTracker { | 147 class MockEventPageTracker : public extensions::EventPageTracker { |
160 public: | 148 public: |
161 MockEventPageTracker(); | 149 MockEventPageTracker(); |
162 ~MockEventPageTracker(); | 150 ~MockEventPageTracker(); |
163 | 151 |
164 MOCK_METHOD1(IsEventPageSuspended, bool(const std::string& extension_id)); | 152 MOCK_METHOD1(IsEventPageSuspended, bool(const std::string& extension_id)); |
165 MOCK_METHOD2(WakeEventPage, | 153 MOCK_METHOD2(WakeEventPage, |
166 bool(const std::string& extension_id, | 154 bool(const std::string& extension_id, |
167 const base::Callback<void(bool)>& callback)); | 155 const base::Callback<void(bool)>& callback)); |
168 }; | 156 }; |
169 | 157 |
| 158 class MockPresentationConnectionStateChangedCallback { |
| 159 public: |
| 160 MockPresentationConnectionStateChangedCallback(); |
| 161 ~MockPresentationConnectionStateChangedCallback(); |
| 162 MOCK_METHOD1(Run, void(content::PresentationConnectionState)); |
| 163 }; |
| 164 |
170 } // namespace media_router | 165 } // namespace media_router |
171 | 166 |
172 #endif // CHROME_BROWSER_MEDIA_ROUTER_TEST_HELPER_H_ | 167 #endif // CHROME_BROWSER_MEDIA_ROUTER_TEST_HELPER_H_ |
OLD | NEW |