| Index: chrome/browser/apps/app_browsertest_util.cc
|
| diff --git a/chrome/browser/apps/app_browsertest_util.cc b/chrome/browser/apps/app_browsertest_util.cc
|
| index c511f101c6241044c1d29a26f80464ec77e8f4fb..acbe3c9dbcb8e2ffb8711aa4d5036df4f455c889 100644
|
| --- a/chrome/browser/apps/app_browsertest_util.cc
|
| +++ b/chrome/browser/apps/app_browsertest_util.cc
|
| @@ -4,6 +4,9 @@
|
|
|
| #include "chrome/browser/apps/app_browsertest_util.h"
|
|
|
| +#include <memory>
|
| +#include <string>
|
| +
|
| #include "base/command_line.h"
|
| #include "base/strings/stringprintf.h"
|
| #include "chrome/browser/extensions/api/tabs/tabs_api.h"
|
| @@ -24,6 +27,12 @@
|
| #include "extensions/common/switches.h"
|
| #include "extensions/test/extension_test_message_listener.h"
|
|
|
| +#if defined(OS_CHROMEOS)
|
| +#include "chrome/browser/media/router/media_routes_observer.h"
|
| +#include "chrome/browser/ui/ash/cast_config_client_media_router.h"
|
| +#include "testing/gmock/include/gmock/gmock.h"
|
| +#endif
|
| +
|
| using content::WebContents;
|
|
|
| namespace {
|
| @@ -49,6 +58,27 @@ void PlatformAppBrowserTest::SetUpCommandLine(base::CommandLine* command_line) {
|
| ProcessManager::SetEventPageSuspendingTimeForTesting(1000);
|
| }
|
|
|
| +void PlatformAppBrowserTest::SetUpInProcessBrowserTestFixture() {
|
| + ExtensionApiTest::SetUpInProcessBrowserTestFixture();
|
| +#if defined(OS_CHROMEOS)
|
| + // Mock the Media Router in extension api tests. Several of the
|
| + // PlatformAppBrowserTest suites call RunAllPendingInMessageLoop() when there
|
| + // are mojo messages that will call back into Profile creation through the
|
| + // media router.
|
| + ON_CALL(media_router_, RegisterMediaSinksObserver(testing::_))
|
| + .WillByDefault(testing::Return(true));
|
| +
|
| + CastConfigClientMediaRouter::SetMediaRouterForTest(&media_router_);
|
| +#endif
|
| +}
|
| +
|
| +void PlatformAppBrowserTest::TearDownInProcessBrowserTestFixture() {
|
| +#if defined(OS_CHROMEOS)
|
| + CastConfigClientMediaRouter::SetMediaRouterForTest(nullptr);
|
| +#endif
|
| + ExtensionApiTest::TearDownInProcessBrowserTestFixture();
|
| +}
|
| +
|
| // static
|
| AppWindow* PlatformAppBrowserTest::GetFirstAppWindowForBrowser(
|
| Browser* browser) {
|
|
|