| 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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 const JoinRouteCallback& callback)); | 103 const JoinRouteCallback& callback)); |
| 104 MOCK_METHOD6(ConnectRouteByRouteId, | 104 MOCK_METHOD6(ConnectRouteByRouteId, |
| 105 void(const mojo::String& source_urn, | 105 void(const mojo::String& source_urn, |
| 106 const mojo::String& route_id, | 106 const mojo::String& route_id, |
| 107 const mojo::String& presentation_id, | 107 const mojo::String& presentation_id, |
| 108 const mojo::String& origin, | 108 const mojo::String& origin, |
| 109 int tab_id, | 109 int tab_id, |
| 110 const JoinRouteCallback& callback)); | 110 const JoinRouteCallback& callback)); |
| 111 MOCK_METHOD1(DetachRoute, void(const mojo::String& route_id)); | 111 MOCK_METHOD1(DetachRoute, void(const mojo::String& route_id)); |
| 112 MOCK_METHOD1(TerminateRoute, void(const mojo::String& route_id)); | 112 MOCK_METHOD1(TerminateRoute, void(const mojo::String& route_id)); |
| 113 MOCK_METHOD1(StartObservingMediaSinks, void(const mojo::String& source)); | 113 MOCK_METHOD2(StartObservingMediaSinks, |
| 114 void(const mojo::String& source, const mojo::String& origin)); |
| 114 MOCK_METHOD1(StopObservingMediaSinks, void(const mojo::String& source)); | 115 MOCK_METHOD1(StopObservingMediaSinks, void(const mojo::String& source)); |
| 115 MOCK_METHOD3(SendRouteMessage, | 116 MOCK_METHOD3(SendRouteMessage, |
| 116 void(const mojo::String& media_route_id, | 117 void(const mojo::String& media_route_id, |
| 117 const mojo::String& message, | 118 const mojo::String& message, |
| 118 const SendRouteMessageCallback& callback)); | 119 const SendRouteMessageCallback& callback)); |
| 119 void SendRouteBinaryMessage( | 120 void SendRouteBinaryMessage( |
| 120 const mojo::String& media_route_id, | 121 const mojo::String& media_route_id, |
| 121 mojo::Array<uint8_t> data, | 122 mojo::Array<uint8_t> data, |
| 122 const SendRouteMessageCallback& callback) override { | 123 const SendRouteMessageCallback& callback) override { |
| 123 SendRouteBinaryMessageInternal(media_route_id, data.storage(), callback); | 124 SendRouteBinaryMessageInternal(media_route_id, data.storage(), callback); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 135 void(const mojo::String& route_id)); | 136 void(const mojo::String& route_id)); |
| 136 MOCK_METHOD1(StartObservingMediaRoutes, void(const mojo::String& source)); | 137 MOCK_METHOD1(StartObservingMediaRoutes, void(const mojo::String& source)); |
| 137 MOCK_METHOD1(StopObservingMediaRoutes, void(const mojo::String& source)); | 138 MOCK_METHOD1(StopObservingMediaRoutes, void(const mojo::String& source)); |
| 138 | 139 |
| 139 private: | 140 private: |
| 140 DISALLOW_COPY_AND_ASSIGN(MockMediaRouteProvider); | 141 DISALLOW_COPY_AND_ASSIGN(MockMediaRouteProvider); |
| 141 }; | 142 }; |
| 142 | 143 |
| 143 class MockMediaSinksObserver : public MediaSinksObserver { | 144 class MockMediaSinksObserver : public MediaSinksObserver { |
| 144 public: | 145 public: |
| 145 MockMediaSinksObserver(MediaRouter* router, const MediaSource& source); | 146 MockMediaSinksObserver(MediaRouter* router, |
| 147 const MediaSource& source, |
| 148 const GURL& origin); |
| 146 ~MockMediaSinksObserver() override; | 149 ~MockMediaSinksObserver() override; |
| 147 | 150 |
| 148 MOCK_METHOD1(OnSinksReceived, void(const std::vector<MediaSink>& sinks)); | 151 MOCK_METHOD1(OnSinksReceived, void(const std::vector<MediaSink>& sinks)); |
| 149 }; | 152 }; |
| 150 | 153 |
| 151 class MockMediaRoutesObserver : public MediaRoutesObserver { | 154 class MockMediaRoutesObserver : public MediaRoutesObserver { |
| 152 public: | 155 public: |
| 153 explicit MockMediaRoutesObserver(MediaRouter* router, | 156 explicit MockMediaRoutesObserver(MediaRouter* router, |
| 154 const MediaSource::Id source_id = std::string()); | 157 const MediaSource::Id source_id = std::string()); |
| 155 ~MockMediaRoutesObserver() override; | 158 ~MockMediaRoutesObserver() override; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 172 class MockPresentationConnectionStateChangedCallback { | 175 class MockPresentationConnectionStateChangedCallback { |
| 173 public: | 176 public: |
| 174 MockPresentationConnectionStateChangedCallback(); | 177 MockPresentationConnectionStateChangedCallback(); |
| 175 ~MockPresentationConnectionStateChangedCallback(); | 178 ~MockPresentationConnectionStateChangedCallback(); |
| 176 MOCK_METHOD1(Run, void(content::PresentationConnectionState)); | 179 MOCK_METHOD1(Run, void(content::PresentationConnectionState)); |
| 177 }; | 180 }; |
| 178 | 181 |
| 179 } // namespace media_router | 182 } // namespace media_router |
| 180 | 183 |
| 181 #endif // CHROME_BROWSER_MEDIA_ROUTER_TEST_HELPER_H_ | 184 #endif // CHROME_BROWSER_MEDIA_ROUTER_TEST_HELPER_H_ |
| OLD | NEW |