Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4236)

Unified Diff: chrome/browser/chromeos/file_manager/external_filesystem_apitest.cc

Issue 2525563003: mash: Change CastConfigDelegate to a mojoified CastConfigClient. (Closed)
Patch Set: move dep to chromeos section Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chrome_content_browser_manifest_overlay.json ('k') | chrome/browser/ui/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « chrome/browser/chrome_content_browser_manifest_overlay.json ('k') | chrome/browser/ui/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698