| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 MOCK_METHOD7(ConnectRouteByRouteId, | 113 MOCK_METHOD7(ConnectRouteByRouteId, |
| 114 void(const mojo::String& source_urn, | 114 void(const mojo::String& source_urn, |
| 115 const mojo::String& route_id, | 115 const mojo::String& route_id, |
| 116 const mojo::String& presentation_id, | 116 const mojo::String& presentation_id, |
| 117 const mojo::String& origin, | 117 const mojo::String& origin, |
| 118 int tab_id, | 118 int tab_id, |
| 119 int64_t timeout_secs, | 119 int64_t timeout_secs, |
| 120 const JoinRouteCallback& callback)); | 120 const JoinRouteCallback& callback)); |
| 121 MOCK_METHOD1(DetachRoute, void(const mojo::String& route_id)); | 121 MOCK_METHOD1(DetachRoute, void(const mojo::String& route_id)); |
| 122 MOCK_METHOD1(TerminateRoute, void(const mojo::String& route_id)); | 122 MOCK_METHOD1(TerminateRoute, void(const mojo::String& route_id)); |
| 123 MOCK_METHOD1(StartObservingMediaSinks, void(const mojo::String& source)); | 123 MOCK_METHOD2(StartObservingMediaSinks, |
| 124 MOCK_METHOD1(StopObservingMediaSinks, void(const mojo::String& source)); | 124 void(const mojo::String& source, const mojo::String& origin)); |
| 125 MOCK_METHOD2(StopObservingMediaSinks, |
| 126 void(const mojo::String& source, const mojo::String& origin)); |
| 125 MOCK_METHOD3(SendRouteMessage, | 127 MOCK_METHOD3(SendRouteMessage, |
| 126 void(const mojo::String& media_route_id, | 128 void(const mojo::String& media_route_id, |
| 127 const mojo::String& message, | 129 const mojo::String& message, |
| 128 const SendRouteMessageCallback& callback)); | 130 const SendRouteMessageCallback& callback)); |
| 129 void SendRouteBinaryMessage( | 131 void SendRouteBinaryMessage( |
| 130 const mojo::String& media_route_id, | 132 const mojo::String& media_route_id, |
| 131 mojo::Array<uint8_t> data, | 133 mojo::Array<uint8_t> data, |
| 132 const SendRouteMessageCallback& callback) override { | 134 const SendRouteMessageCallback& callback) override { |
| 133 SendRouteBinaryMessageInternal(media_route_id, data.storage(), callback); | 135 SendRouteBinaryMessageInternal(media_route_id, data.storage(), callback); |
| 134 } | 136 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 145 void(const mojo::String& route_id)); | 147 void(const mojo::String& route_id)); |
| 146 MOCK_METHOD1(StartObservingMediaRoutes, void(const mojo::String& source)); | 148 MOCK_METHOD1(StartObservingMediaRoutes, void(const mojo::String& source)); |
| 147 MOCK_METHOD1(StopObservingMediaRoutes, void(const mojo::String& source)); | 149 MOCK_METHOD1(StopObservingMediaRoutes, void(const mojo::String& source)); |
| 148 | 150 |
| 149 private: | 151 private: |
| 150 DISALLOW_COPY_AND_ASSIGN(MockMediaRouteProvider); | 152 DISALLOW_COPY_AND_ASSIGN(MockMediaRouteProvider); |
| 151 }; | 153 }; |
| 152 | 154 |
| 153 class MockMediaSinksObserver : public MediaSinksObserver { | 155 class MockMediaSinksObserver : public MediaSinksObserver { |
| 154 public: | 156 public: |
| 155 MockMediaSinksObserver(MediaRouter* router, const MediaSource& source); | 157 MockMediaSinksObserver(MediaRouter* router, |
| 158 const MediaSource& source); |
| 156 ~MockMediaSinksObserver() override; | 159 ~MockMediaSinksObserver() override; |
| 157 | 160 |
| 158 MOCK_METHOD1(OnSinksReceived, void(const std::vector<MediaSink>& sinks)); | 161 MOCK_METHOD2(OnSinksReceived, void(const MediaSource& source, |
| 162 const std::vector<MediaSink>& sinks)); |
| 159 }; | 163 }; |
| 160 | 164 |
| 161 class MockMediaRoutesObserver : public MediaRoutesObserver { | 165 class MockMediaRoutesObserver : public MediaRoutesObserver { |
| 162 public: | 166 public: |
| 163 explicit MockMediaRoutesObserver(MediaRouter* router, | 167 explicit MockMediaRoutesObserver(MediaRouter* router, |
| 164 const MediaSource::Id source_id = std::string()); | 168 const MediaSource::Id source_id = std::string()); |
| 165 ~MockMediaRoutesObserver() override; | 169 ~MockMediaRoutesObserver() override; |
| 166 | 170 |
| 167 MOCK_METHOD2(OnRoutesUpdated, void(const std::vector<MediaRoute>& routes, | 171 MOCK_METHOD2(OnRoutesUpdated, void(const std::vector<MediaRoute>& routes, |
| 168 const std::vector<MediaRoute::Id>& joinable_route_ids)); | 172 const std::vector<MediaRoute::Id>& joinable_route_ids)); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 183 public: | 187 public: |
| 184 MockPresentationConnectionStateChangedCallback(); | 188 MockPresentationConnectionStateChangedCallback(); |
| 185 ~MockPresentationConnectionStateChangedCallback(); | 189 ~MockPresentationConnectionStateChangedCallback(); |
| 186 MOCK_METHOD1(Run, | 190 MOCK_METHOD1(Run, |
| 187 void(const content::PresentationConnectionStateChangeInfo&)); | 191 void(const content::PresentationConnectionStateChangeInfo&)); |
| 188 }; | 192 }; |
| 189 | 193 |
| 190 } // namespace media_router | 194 } // namespace media_router |
| 191 | 195 |
| 192 #endif // CHROME_BROWSER_MEDIA_ROUTER_TEST_HELPER_H_ | 196 #endif // CHROME_BROWSER_MEDIA_ROUTER_TEST_HELPER_H_ |
| OLD | NEW |