| Index: chrome/browser/chromeos/file_manager/external_filesystem_apitest.cc
|
| diff --git a/chrome/browser/chromeos/file_manager/external_filesystem_apitest.cc b/chrome/browser/chromeos/file_manager/external_filesystem_apitest.cc
|
| index 0517f9e739700f4c351bb3847092434f2ed280e9..e742566e364a72b5a97d533ba8b1e3d09757aaf3 100644
|
| --- a/chrome/browser/chromeos/file_manager/external_filesystem_apitest.cc
|
| +++ b/chrome/browser/chromeos/file_manager/external_filesystem_apitest.cc
|
| @@ -14,8 +14,10 @@
|
| #include "chrome/browser/chromeos/file_manager/volume_manager.h"
|
| #include "chrome/browser/chromeos/profiles/profile_helper.h"
|
| #include "chrome/browser/extensions/extension_apitest.h"
|
| +#include "chrome/browser/media/router/mock_media_router.h"
|
| #include "chrome/browser/profiles/profile.h"
|
| #include "chrome/browser/profiles/profile_manager.h"
|
| +#include "chrome/browser/ui/ash/cast_config_client_media_router.h"
|
| #include "chrome/browser/ui/browser.h"
|
| #include "chrome/common/chrome_constants.h"
|
| #include "chrome/common/chrome_paths.h"
|
| @@ -368,9 +370,22 @@ class FileSystemExtensionApiTestBase : public ExtensionApiTest {
|
|
|
| void SetUpOnMainThread() override {
|
| AddTestMountPoint();
|
| +
|
| + // Mock the Media Router in extension api tests. Dispatches to the message
|
| + // loop now try to handle mojo messages that will call back into Profile
|
| + // creation through the media router, which then confuse the drive code.
|
| + ON_CALL(media_router_, RegisterMediaSinksObserver(testing::_))
|
| + .WillByDefault(testing::Return(true));
|
| + CastConfigClientMediaRouter::SetMediaRouterForTest(&media_router_);
|
| +
|
| ExtensionApiTest::SetUpOnMainThread();
|
| }
|
|
|
| + void TearDownOnMainThread() override {
|
| + CastConfigClientMediaRouter::SetMediaRouterForTest(nullptr);
|
| + ExtensionApiTest::TearDownOnMainThread();
|
| + }
|
| +
|
| // Runs a file system extension API test.
|
| // It loads test component extension at |filebrowser_path| with manifest
|
| // at |filebrowser_manifest|. The |filebrowser_manifest| should be a path
|
| @@ -429,6 +444,11 @@ class FileSystemExtensionApiTestBase : public ExtensionApiTest {
|
| virtual void InitTestFileSystem() = 0;
|
| // Registers mount point used in the test.
|
| virtual void AddTestMountPoint() = 0;
|
| +
|
| + private:
|
| + media_router::MockMediaRouter media_router_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(FileSystemExtensionApiTestBase);
|
| };
|
|
|
| // Tests for a native local file system.
|
|
|