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

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

Issue 300063006: Files.app: Let Files.app pass mutliple files to file handlers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed Created 6 years, 6 months 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 | « apps/launcher.cc ('k') | chrome/browser/chromeos/file_manager/file_tasks.cc » ('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 c4fd4f61905a3ccf0dc59a871572624274bea94c..70e67f2adeea37323c7a7d9f18b0482a9579551b 100644
--- a/chrome/browser/chromeos/file_manager/external_filesystem_apitest.cc
+++ b/chrome/browser/chromeos/file_manager/external_filesystem_apitest.cc
@@ -599,6 +599,78 @@ class MultiProfileDriveFileSystemExtensionApiTest :
std::map<std::string, std::string> resource_ids_;
};
+class LocalAndDriveFileSystemExtensionApiTest
+ : public FileSystemExtensionApiTestBase {
+ public:
+ LocalAndDriveFileSystemExtensionApiTest() {}
+ virtual ~LocalAndDriveFileSystemExtensionApiTest() {}
+
+ // FileSystemExtensionApiTestBase OVERRIDE.
+ virtual void InitTestFileSystem() OVERRIDE {
+ ASSERT_TRUE(InitializeLocalFileSystem(
+ kLocalMountPointName, &local_tmp_dir_, &local_mount_point_dir_))
+ << "Failed to initialize file system.";
+
+ // Set up cache root to be used by DriveIntegrationService. This has to be
+ // done before the browser is created because the service instance is
+ // initialized by EventRouter.
+ ASSERT_TRUE(test_cache_root_.CreateUniqueTempDir());
+
+ // This callback will get called during Profile creation.
+ create_drive_integration_service_ = base::Bind(
+ &LocalAndDriveFileSystemExtensionApiTest::CreateDriveIntegrationService,
+ base::Unretained(this));
+ service_factory_for_test_.reset(
+ new DriveIntegrationServiceFactory::ScopedFactoryForTest(
+ &create_drive_integration_service_));
+ }
+
+ // FileSystemExtensionApiTestBase OVERRIDE.
+ virtual void AddTestMountPoint() OVERRIDE {
+ EXPECT_TRUE(content::BrowserContext::GetMountPoints(browser()->profile())
+ ->RegisterFileSystem(kLocalMountPointName,
+ fileapi::kFileSystemTypeNativeLocal,
+ fileapi::FileSystemMountOption(),
+ local_mount_point_dir_));
+ VolumeManager::Get(browser()->profile())
+ ->AddVolumeInfoForTesting(local_mount_point_dir_,
+ VOLUME_TYPE_TESTING,
+ chromeos::DEVICE_TYPE_UNKNOWN);
+ test_util::WaitUntilDriveMountPointIsAdded(browser()->profile());
+ }
+
+ protected:
+ // DriveIntegrationService factory function for this test.
+ drive::DriveIntegrationService* CreateDriveIntegrationService(
+ Profile* profile) {
+ fake_drive_service_ = new drive::FakeDriveService;
+ fake_drive_service_->LoadAppListForDriveApi("drive/applist.json");
+
+ std::map<std::string, std::string> resource_ids;
+ EXPECT_TRUE(InitializeDriveService(fake_drive_service_, &resource_ids));
+
+ return new drive::DriveIntegrationService(profile,
+ NULL,
+ fake_drive_service_,
+ "drive",
+ test_cache_root_.path(),
+ NULL);
+ }
+
+ private:
+ // For local volume.
+ base::ScopedTempDir local_tmp_dir_;
+ base::FilePath local_mount_point_dir_;
+
+ // For drive volume.
+ base::ScopedTempDir test_cache_root_;
+ drive::FakeDriveService* fake_drive_service_;
+ DriveIntegrationServiceFactory::FactoryCallback
+ create_drive_integration_service_;
+ scoped_ptr<DriveIntegrationServiceFactory::ScopedFactoryForTest>
+ service_factory_for_test_;
+};
+
//
// LocalFileSystemExtensionApiTests.
//
@@ -712,5 +784,17 @@ IN_PROC_BROWSER_TEST_F(MultiProfileDriveFileSystemExtensionApiTest,
FLAGS_NONE)) << message_;
}
+//
+// LocalAndDriveFileSystemExtensionApiTests.
+//
+IN_PROC_BROWSER_TEST_F(LocalAndDriveFileSystemExtensionApiTest,
+ AppFileHandlerMulti) {
+ EXPECT_TRUE(
+ RunFileSystemExtensionApiTest("file_browser/app_file_handler_multi",
+ FILE_PATH_LITERAL("manifest.json"),
+ "",
+ FLAGS_NONE))
+ << message_;
+}
} // namespace
} // namespace file_manager
« no previous file with comments | « apps/launcher.cc ('k') | chrome/browser/chromeos/file_manager/file_tasks.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698