Chromium Code Reviews| Index: chrome/browser/media/router/mojo/media_router_mojo_test.h |
| diff --git a/chrome/browser/media/router/mojo/media_router_mojo_test.h b/chrome/browser/media/router/mojo/media_router_mojo_test.h |
| index 21935d7fbf1b6482daf38e24b1086aef76467e97..2fd16e7fd7d733f59830da98a3dd5aaf891aade9 100644 |
| --- a/chrome/browser/media/router/mojo/media_router_mojo_test.h |
| +++ b/chrome/browser/media/router/mojo/media_router_mojo_test.h |
| @@ -174,6 +174,23 @@ class MockMediaRouteControllerObserver : public MediaRouteController::Observer { |
| MOCK_METHOD0(OnControllerInvalidated, void()); |
| }; |
| +// Mockable class for awaiting RegisterMediaRouteProvider callbacks. |
| +class RegisterMediaRouteProviderHandler { |
| + public: |
| + RegisterMediaRouteProviderHandler(); |
| + ~RegisterMediaRouteProviderHandler(); |
| + |
| + // A wrapper function to deal with move only parameter |config|. |
| + void Invoke(const std::string& instance_id, |
| + mojom::MediaRouteProviderConfigPtr config) { |
| + InvokeRaw(instance_id, config.get()); |
| + } |
| + |
| + MOCK_METHOD2(InvokeRaw, |
|
mark a. foltz
2017/05/11 23:17:59
In general we have been using InvokeInternal for t
zhaobin
2017/05/12 00:16:51
Done.
|
| + void(const std::string& instance_id, |
| + mojom::MediaRouteProviderConfig* config)); |
| +}; |
| + |
| // Tests the API call flow between the MediaRouterMojoImpl and the Media Router |
| // Mojo service in both directions. |
| class MediaRouterMojoTest : public ::testing::Test { |
| @@ -200,6 +217,8 @@ class MediaRouterMojoTest : public ::testing::Test { |
| // Mojo proxy object for |mock_media_router_| |
| media_router::mojom::MediaRouterPtr media_router_proxy_; |
| + RegisterMediaRouteProviderHandler provide_handler_; |
| + |
| private: |
| content::TestBrowserThreadBundle test_thread_bundle_; |
| scoped_refptr<extensions::Extension> extension_; |