| 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 4149d41bb8d26e7ae8fcd4ab4af851a69cf55620..6618ce878275a140517ec4b08193453e43905509 100644
|
| --- a/chrome/browser/media/router/mojo/media_router_mojo_test.h
|
| +++ b/chrome/browser/media/router/mojo/media_router_mojo_test.h
|
| @@ -9,6 +9,7 @@
|
|
|
| #include "base/macros.h"
|
| #include "base/memory/ref_counted.h"
|
| +#include "base/test/mock_callback.h"
|
| #include "chrome/browser/media/router/mock_media_router.h"
|
| #include "chrome/browser/media/router/mojo/media_router_mojo_impl.h"
|
| #include "chrome/browser/media/router/test_helper.h"
|
| @@ -157,6 +158,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,
|
| + 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 {
|
| @@ -183,9 +201,12 @@ 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_;
|
| + TestingProfile profile_;
|
| std::unique_ptr<MediaRouterMojoImpl> mock_media_router_;
|
| std::unique_ptr<mojo::Binding<mojom::MediaRouteProvider>> binding_;
|
|
|
|
|