Commit 0bf02521 authored by Austin Tankiang's avatar Austin Tankiang Committed by Commit Bot

Remove storage::kFileSystemTypeDrive

This filesystem type was used by the legacy drive sync client that has
now been replaced by DriveFS. Also replace all usages in tests of this
filesystem type with an equivalent type.

Bug: 1003238
Change-Id: I5f99a3eaca6887423cb1ec073f5f9b22e83b694b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1946050Reviewed-by: default avatarSam McNally <sammc@chromium.org>
Reviewed-by: default avatarHiroki Nakagawa <nhiroki@chromium.org>
Commit-Queue: Austin Tankiang <austinct@chromium.org>
Cr-Commit-Position: refs/heads/master@{#720814}
parent 5d7eda1d
...@@ -1022,8 +1022,6 @@ FileManagerPrivateInternalGetDownloadUrlFunction::Run() { ...@@ -1022,8 +1022,6 @@ FileManagerPrivateInternalGetDownloadUrlFunction::Run() {
file_system_context->CrackURL(url); file_system_context->CrackURL(url);
switch (file_system_url.type()) { switch (file_system_url.type()) {
case storage::kFileSystemTypeDrive:
return RespondNow(Error("Legacy drive client is not supported"));
case storage::kFileSystemTypeDriveFs: case storage::kFileSystemTypeDriveFs:
return RunAsyncForDriveFs(file_system_url); return RunAsyncForDriveFs(file_system_url);
default: default:
......
...@@ -647,11 +647,6 @@ FileManagerPrivateInternalValidatePathNameLengthFunction::Run() { ...@@ -647,11 +647,6 @@ FileManagerPrivateInternalValidatePathNameLengthFunction::Run() {
if (!chromeos::FileSystemBackend::CanHandleURL(file_system_url)) if (!chromeos::FileSystemBackend::CanHandleURL(file_system_url))
return RespondNow(Error("Invalid URL")); return RespondNow(Error("Invalid URL"));
// No explicit limit on the length of Drive file names.
if (file_system_url.type() == storage::kFileSystemTypeDrive) {
return RespondNow(OneArgument(std::make_unique<base::Value>(true)));
}
base::PostTaskAndReplyWithResult( base::PostTaskAndReplyWithResult(
FROM_HERE, FROM_HERE,
{base::ThreadPool(), base::MayBlock(), base::TaskPriority::USER_BLOCKING}, {base::ThreadPool(), base::MayBlock(), base::TaskPriority::USER_BLOCKING},
......
...@@ -144,16 +144,16 @@ class FileTasksNotifierTest : public testing::Test { ...@@ -144,16 +144,16 @@ class FileTasksNotifierTest : public testing::Test {
ASSERT_TRUE(mount_points->RegisterFileSystem( ASSERT_TRUE(mount_points->RegisterFileSystem(
"drivefs", storage::kFileSystemTypeDriveFs, {}, "drivefs", storage::kFileSystemTypeDriveFs, {},
base::FilePath("/media/fuse/drivefs"))); base::FilePath("/media/fuse/drivefs")));
ASSERT_TRUE( ASSERT_TRUE(mount_points->RegisterFileSystem(
mount_points->RegisterFileSystem("drive", storage::kFileSystemTypeDrive, "arc-documents-provider", storage::kFileSystemTypeArcDocumentsProvider,
{}, base::FilePath("/special/drive"))); {}, base::FilePath("/special/arc-documents-provider")));
} }
void TearDown() override { void TearDown() override {
auto* mount_points = storage::ExternalMountPoints::GetSystemInstance(); auto* mount_points = storage::ExternalMountPoints::GetSystemInstance();
mount_points->RevokeFileSystem("downloads"); mount_points->RevokeFileSystem("downloads");
mount_points->RevokeFileSystem("drivefs"); mount_points->RevokeFileSystem("drivefs");
mount_points->RevokeFileSystem("drive"); mount_points->RevokeFileSystem("arc-documents-provider");
observer_.reset(); observer_.reset();
notifier_.reset(); notifier_.reset();
...@@ -226,11 +226,11 @@ TEST_F(FileTasksNotifierTest, FileTask_RemovableMedia) { ...@@ -226,11 +226,11 @@ TEST_F(FileTasksNotifierTest, FileTask_RemovableMedia) {
notifier().NotifyFileTasks({CreateFileSystemUrl(path)}); notifier().NotifyFileTasks({CreateFileSystemUrl(path)});
} }
TEST_F(FileTasksNotifierTest, FileTask_LegacyDrive) { TEST_F(FileTasksNotifierTest, FileTask_ArcDocumentsProvider) {
base::FilePath path("/special/drive/root/file"); base::FilePath path("/special/arc-documents-provider/root/file");
EXPECT_CALL(observer(), OnFilesOpenedImpl(_, _)).Times(0); EXPECT_CALL(observer(), OnFilesOpenedImpl(_, _)).Times(0);
notifier().NotifyFileTasks( notifier().NotifyFileTasks({CreateFileSystemUrl(
{CreateFileSystemUrl(path, storage::kFileSystemTypeDrive)}); path, storage::kFileSystemTypeArcDocumentsProvider)});
} }
TEST_F(FileTasksNotifierTest, FileTask_Multiple) { TEST_F(FileTasksNotifierTest, FileTask_Multiple) {
...@@ -240,7 +240,8 @@ TEST_F(FileTasksNotifierTest, FileTask_Multiple) { ...@@ -240,7 +240,8 @@ TEST_F(FileTasksNotifierTest, FileTask_Multiple) {
base::FilePath crostini_path("/media/fuse/crostini-abcdef/file"); base::FilePath crostini_path("/media/fuse/crostini-abcdef/file");
base::FilePath unknown_path("/some/other/path"); base::FilePath unknown_path("/some/other/path");
base::FilePath removable_path("/media/removable/device/file"); base::FilePath removable_path("/media/removable/device/file");
base::FilePath legacy_drive_path("/special/drive/root/file"); base::FilePath arc_documents_provider_path(
"/special/arc-documents-provider/root/file");
EXPECT_CALL( EXPECT_CALL(
observer(), observer(),
OnFilesOpenedImpl(local_path, FileTasksObserver::OpenType::kLaunch)); OnFilesOpenedImpl(local_path, FileTasksObserver::OpenType::kLaunch));
...@@ -259,7 +260,7 @@ TEST_F(FileTasksNotifierTest, FileTask_Multiple) { ...@@ -259,7 +260,7 @@ TEST_F(FileTasksNotifierTest, FileTask_Multiple) {
CreateFileSystemUrl(crostini_path), CreateFileSystemUrl(crostini_path),
CreateFileSystemUrl(unknown_path), CreateFileSystemUrl(unknown_path),
CreateFileSystemUrl(removable_path), CreateFileSystemUrl(removable_path),
CreateFileSystemUrl(legacy_drive_path), CreateFileSystemUrl(arc_documents_provider_path),
}); });
} }
...@@ -321,8 +322,8 @@ TEST_F(FileTasksNotifierTest, DialogSelection_RemovableMedia) { ...@@ -321,8 +322,8 @@ TEST_F(FileTasksNotifierTest, DialogSelection_RemovableMedia) {
notifier().NotifyFileDialogSelection({CreateSelectedFileInfo(path)}, false); notifier().NotifyFileDialogSelection({CreateSelectedFileInfo(path)}, false);
} }
TEST_F(FileTasksNotifierTest, DialogSelection_LegacyDrive) { TEST_F(FileTasksNotifierTest, DialogSelection_ArcDocumentsProvider) {
base::FilePath path("/special/drive/root/file"); base::FilePath path("/special/arc-documents-provider/root/file");
base::FilePath local_path = base::FilePath local_path =
profile().GetPath().Append("GCache/v1/files/file"); profile().GetPath().Append("GCache/v1/files/file");
EXPECT_CALL(observer(), OnFilesOpenedImpl(_, _)).Times(0); EXPECT_CALL(observer(), OnFilesOpenedImpl(_, _)).Times(0);
...@@ -341,9 +342,8 @@ TEST_F(FileTasksNotifierTest, DialogSelection_Multiple) { ...@@ -341,9 +342,8 @@ TEST_F(FileTasksNotifierTest, DialogSelection_Multiple) {
base::FilePath crostini_path("/media/fuse/crostini-abcdef/file"); base::FilePath crostini_path("/media/fuse/crostini-abcdef/file");
base::FilePath unknown_path("/some/other/path"); base::FilePath unknown_path("/some/other/path");
base::FilePath removable_path("/media/removable/device/file"); base::FilePath removable_path("/media/removable/device/file");
base::FilePath legacy_drive_path("/special/drive/root/file"); base::FilePath arc_documents_provider_path(
base::FilePath legacy_drive_local_path = "/special/arc-documents-provider/root/file");
profile().GetPath().Append("GCache/v1/files/file");
EXPECT_CALL(observer(), OnFilesOpenedImpl( EXPECT_CALL(observer(), OnFilesOpenedImpl(
local_path, FileTasksObserver::OpenType::kOpen)); local_path, FileTasksObserver::OpenType::kOpen));
EXPECT_CALL( EXPECT_CALL(
...@@ -359,8 +359,7 @@ TEST_F(FileTasksNotifierTest, DialogSelection_Multiple) { ...@@ -359,8 +359,7 @@ TEST_F(FileTasksNotifierTest, DialogSelection_Multiple) {
{CreateSelectedFileInfo(local_path), CreateSelectedFileInfo(drivefs_path), {CreateSelectedFileInfo(local_path), CreateSelectedFileInfo(drivefs_path),
CreateSelectedFileInfo(arc_path), CreateSelectedFileInfo(crostini_path), CreateSelectedFileInfo(arc_path), CreateSelectedFileInfo(crostini_path),
CreateSelectedFileInfo(unknown_path), CreateSelectedFileInfo(unknown_path),
CreateSelectedFileInfo(legacy_drive_path, legacy_drive_local_path), CreateSelectedFileInfo(arc_documents_provider_path),
CreateSelectedFileInfo(legacy_drive_path),
CreateSelectedFileInfo(removable_path)}, CreateSelectedFileInfo(removable_path)},
true); true);
...@@ -380,8 +379,7 @@ TEST_F(FileTasksNotifierTest, DialogSelection_Multiple) { ...@@ -380,8 +379,7 @@ TEST_F(FileTasksNotifierTest, DialogSelection_Multiple) {
{CreateSelectedFileInfo(local_path), CreateSelectedFileInfo(drivefs_path), {CreateSelectedFileInfo(local_path), CreateSelectedFileInfo(drivefs_path),
CreateSelectedFileInfo(arc_path), CreateSelectedFileInfo(crostini_path), CreateSelectedFileInfo(arc_path), CreateSelectedFileInfo(crostini_path),
CreateSelectedFileInfo(unknown_path), CreateSelectedFileInfo(unknown_path),
CreateSelectedFileInfo(legacy_drive_path, legacy_drive_local_path), CreateSelectedFileInfo(arc_documents_provider_path),
CreateSelectedFileInfo(legacy_drive_path),
CreateSelectedFileInfo(removable_path)}, CreateSelectedFileInfo(removable_path)},
false); false);
} }
...@@ -426,12 +424,6 @@ TEST_F(FileTasksNotifierTest, Download_RemovableMedia) { ...@@ -426,12 +424,6 @@ TEST_F(FileTasksNotifierTest, Download_RemovableMedia) {
notifier().OnDownloadUpdated(nullptr, CreateCompletedDownloadItem(path)); notifier().OnDownloadUpdated(nullptr, CreateCompletedDownloadItem(path));
} }
TEST_F(FileTasksNotifierTest, Download_LegacyDrive) {
base::FilePath path("/special/drive/root/file");
EXPECT_CALL(observer(), OnFilesOpenedImpl(_, _)).Times(0);
notifier().OnDownloadUpdated(nullptr, CreateCompletedDownloadItem(path));
}
TEST_F(FileTasksNotifierTest, Download_Incomplete) { TEST_F(FileTasksNotifierTest, Download_Incomplete) {
EXPECT_CALL(observer(), OnFilesOpenedImpl(_, _)).Times(0); EXPECT_CALL(observer(), OnFilesOpenedImpl(_, _)).Times(0);
content::FakeDownloadItem download_item; content::FakeDownloadItem download_item;
...@@ -474,7 +466,7 @@ TEST_F(FileTasksNotifierTest, QueryFileAvailability_FileExists) { ...@@ -474,7 +466,7 @@ TEST_F(FileTasksNotifierTest, QueryFileAvailability_FileExists) {
TEST_F(FileTasksNotifierTest, QueryFileAvailability_UnsupportedMountType) { TEST_F(FileTasksNotifierTest, QueryFileAvailability_UnsupportedMountType) {
base::RunLoop run_loop; base::RunLoop run_loop;
notifier().QueryFileAvailability( notifier().QueryFileAvailability(
{base::FilePath("/special/drive/root/file")}, {base::FilePath("/special/arc-documents-provider/root/file")},
base::BindLambdaForTesting( base::BindLambdaForTesting(
[&](std::vector<FileTasksNotifier::FileAvailability> results) { [&](std::vector<FileTasksNotifier::FileAvailability> results) {
run_loop.Quit(); run_loop.Quit();
...@@ -575,7 +567,7 @@ TEST_F(FileTasksNotifierTest, QueryFileAvailability_Multiple) { ...@@ -575,7 +567,7 @@ TEST_F(FileTasksNotifierTest, QueryFileAvailability_Multiple) {
base::RunLoop run_loop; base::RunLoop run_loop;
notifier().QueryFileAvailability( notifier().QueryFileAvailability(
{my_files().Append("not_found"), my_files().Append("file"), {my_files().Append("not_found"), my_files().Append("file"),
base::FilePath("/special/drive/root/file"), base::FilePath("/special/arc-documents-provider/root/file"),
base::FilePath("/media/fuse/crostini-abcdef/file"), base::FilePath("/media/fuse/crostini-abcdef/file"),
base::FilePath("/media/fuse/drivefs/root/available_offline"), base::FilePath("/media/fuse/drivefs/root/available_offline"),
base::FilePath("/media/fuse/drivefs/root/unavailable_offline"), base::FilePath("/media/fuse/drivefs/root/unavailable_offline"),
......
...@@ -26,8 +26,7 @@ using content::BrowserThread; ...@@ -26,8 +26,7 @@ using content::BrowserThread;
namespace chromeos { namespace chromeos {
bool IsExternalFileURLType(storage::FileSystemType type, bool force) { bool IsExternalFileURLType(storage::FileSystemType type, bool force) {
return type == storage::kFileSystemTypeDrive || return type == storage::kFileSystemTypeDeviceMediaAsFileStorage ||
type == storage::kFileSystemTypeDeviceMediaAsFileStorage ||
type == storage::kFileSystemTypeProvided || type == storage::kFileSystemTypeProvided ||
type == storage::kFileSystemTypeArcContent || type == storage::kFileSystemTypeArcContent ||
type == storage::kFileSystemTypeArcDocumentsProvider || force; type == storage::kFileSystemTypeArcDocumentsProvider || force;
......
...@@ -35,8 +35,8 @@ class ExternalFileURLUtilTest : public testing::Test { ...@@ -35,8 +35,8 @@ class ExternalFileURLUtilTest : public testing::Test {
return storage::FileSystemURL::CreateForTest( return storage::FileSystemURL::CreateForTest(
url::Origin::Create(GURL("chrome-extension://xxx")), url::Origin::Create(GURL("chrome-extension://xxx")),
storage::kFileSystemTypeExternal, storage::kFileSystemTypeExternal,
base::FilePath("drive-test-user-hash").Append(path), "", base::FilePath("arc-documents-provider").Append(path), "",
storage::kFileSystemTypeDrive, base::FilePath(), "", storage::kFileSystemTypeArcDocumentsProvider, base::FilePath(), "",
storage::FileSystemMountOption()); storage::FileSystemMountOption());
} }
......
...@@ -53,7 +53,6 @@ bool FileSystemBackend::CanHandleURL(const storage::FileSystemURL& url) { ...@@ -53,7 +53,6 @@ bool FileSystemBackend::CanHandleURL(const storage::FileSystemURL& url) {
return false; return false;
return url.type() == storage::kFileSystemTypeNativeLocal || return url.type() == storage::kFileSystemTypeNativeLocal ||
url.type() == storage::kFileSystemTypeRestrictedNativeLocal || url.type() == storage::kFileSystemTypeRestrictedNativeLocal ||
url.type() == storage::kFileSystemTypeDrive ||
url.type() == storage::kFileSystemTypeProvided || url.type() == storage::kFileSystemTypeProvided ||
url.type() == storage::kFileSystemTypeDeviceMediaAsFileStorage || url.type() == storage::kFileSystemTypeDeviceMediaAsFileStorage ||
url.type() == storage::kFileSystemTypeArcContent || url.type() == storage::kFileSystemTypeArcContent ||
...@@ -105,7 +104,6 @@ void FileSystemBackend::AddSystemMountPoints() { ...@@ -105,7 +104,6 @@ void FileSystemBackend::AddSystemMountPoints() {
bool FileSystemBackend::CanHandleType(storage::FileSystemType type) const { bool FileSystemBackend::CanHandleType(storage::FileSystemType type) const {
switch (type) { switch (type) {
case storage::kFileSystemTypeExternal: case storage::kFileSystemTypeExternal:
case storage::kFileSystemTypeDrive:
case storage::kFileSystemTypeRestrictedNativeLocal: case storage::kFileSystemTypeRestrictedNativeLocal:
case storage::kFileSystemTypeNativeLocal: case storage::kFileSystemTypeNativeLocal:
case storage::kFileSystemTypeNativeForPlatformApp: case storage::kFileSystemTypeNativeForPlatformApp:
...@@ -354,8 +352,7 @@ storage::FileSystemOperation* FileSystemBackend::CreateFileSystemOperation( ...@@ -354,8 +352,7 @@ storage::FileSystemOperation* FileSystemBackend::CreateFileSystemOperation(
.get())); .get()));
} }
DCHECK(url.type() == storage::kFileSystemTypeDrive || DCHECK(url.type() == storage::kFileSystemTypeProvided ||
url.type() == storage::kFileSystemTypeProvided ||
url.type() == storage::kFileSystemTypeArcContent || url.type() == storage::kFileSystemTypeArcContent ||
url.type() == storage::kFileSystemTypeArcDocumentsProvider); url.type() == storage::kFileSystemTypeArcDocumentsProvider);
return storage::FileSystemOperation::Create( return storage::FileSystemOperation::Create(
...@@ -365,8 +362,7 @@ storage::FileSystemOperation* FileSystemBackend::CreateFileSystemOperation( ...@@ -365,8 +362,7 @@ storage::FileSystemOperation* FileSystemBackend::CreateFileSystemOperation(
bool FileSystemBackend::SupportsStreaming( bool FileSystemBackend::SupportsStreaming(
const storage::FileSystemURL& url) const { const storage::FileSystemURL& url) const {
return url.type() == storage::kFileSystemTypeDrive || return url.type() == storage::kFileSystemTypeProvided ||
url.type() == storage::kFileSystemTypeProvided ||
url.type() == storage::kFileSystemTypeDeviceMediaAsFileStorage || url.type() == storage::kFileSystemTypeDeviceMediaAsFileStorage ||
url.type() == storage::kFileSystemTypeArcContent || url.type() == storage::kFileSystemTypeArcContent ||
url.type() == storage::kFileSystemTypeArcDocumentsProvider; url.type() == storage::kFileSystemTypeArcDocumentsProvider;
...@@ -375,7 +371,6 @@ bool FileSystemBackend::SupportsStreaming( ...@@ -375,7 +371,6 @@ bool FileSystemBackend::SupportsStreaming(
bool FileSystemBackend::HasInplaceCopyImplementation( bool FileSystemBackend::HasInplaceCopyImplementation(
storage::FileSystemType type) const { storage::FileSystemType type) const {
switch (type) { switch (type) {
case storage::kFileSystemTypeDrive:
case storage::kFileSystemTypeProvided: case storage::kFileSystemTypeProvided:
case storage::kFileSystemTypeDeviceMediaAsFileStorage: case storage::kFileSystemTypeDeviceMediaAsFileStorage:
case storage::kFileSystemTypeDriveFs: case storage::kFileSystemTypeDriveFs:
......
...@@ -91,7 +91,6 @@ blink::mojom::FileSystemType ToMojoFileSystemType( ...@@ -91,7 +91,6 @@ blink::mojom::FileSystemType ToMojoFileSystemType(
case storage::FileSystemType::kFileSystemTypeDragged: case storage::FileSystemType::kFileSystemTypeDragged:
case storage::FileSystemType::kFileSystemTypeNativeMedia: case storage::FileSystemType::kFileSystemTypeNativeMedia:
case storage::FileSystemType::kFileSystemTypeDeviceMedia: case storage::FileSystemType::kFileSystemTypeDeviceMedia:
case storage::FileSystemType::kFileSystemTypeDrive:
case storage::FileSystemType::kFileSystemTypeSyncable: case storage::FileSystemType::kFileSystemTypeSyncable:
case storage::FileSystemType::kFileSystemTypeSyncableForInternalSync: case storage::FileSystemType::kFileSystemTypeSyncableForInternalSync:
case storage::FileSystemType::kFileSystemTypeNativeForPlatformApp: case storage::FileSystemType::kFileSystemTypeNativeForPlatformApp:
......
...@@ -254,8 +254,8 @@ TEST(ExternalMountPointsTest, HandlesFileSystemMountType) { ...@@ -254,8 +254,8 @@ TEST(ExternalMountPointsTest, HandlesFileSystemMountType) {
storage::kFileSystemTypeNativeLocal)); storage::kFileSystemTypeNativeLocal));
EXPECT_FALSE(mount_points->HandlesFileSystemMountType( EXPECT_FALSE(mount_points->HandlesFileSystemMountType(
storage::kFileSystemTypeRestrictedNativeLocal)); storage::kFileSystemTypeRestrictedNativeLocal));
EXPECT_FALSE( EXPECT_FALSE(mount_points->HandlesFileSystemMountType(
mount_points->HandlesFileSystemMountType(storage::kFileSystemTypeDrive)); storage::kFileSystemTypeDriveFs));
EXPECT_FALSE(mount_points->HandlesFileSystemMountType( EXPECT_FALSE(mount_points->HandlesFileSystemMountType(
storage::kFileSystemTypeSyncable)); storage::kFileSystemTypeSyncable));
} }
...@@ -270,13 +270,13 @@ TEST(ExternalMountPointsTest, CreateCrackedFileSystemURL) { ...@@ -270,13 +270,13 @@ TEST(ExternalMountPointsTest, CreateCrackedFileSystemURL) {
mount_points->RegisterFileSystem("c", storage::kFileSystemTypeNativeLocal, mount_points->RegisterFileSystem("c", storage::kFileSystemTypeNativeLocal,
storage::FileSystemMountOption(), storage::FileSystemMountOption(),
base::FilePath(DRIVE FPL("/a/b/c"))); base::FilePath(DRIVE FPL("/a/b/c")));
mount_points->RegisterFileSystem("c(1)", storage::kFileSystemTypeDrive, mount_points->RegisterFileSystem("c(1)", storage::kFileSystemTypeDriveFs,
storage::FileSystemMountOption(), storage::FileSystemMountOption(),
base::FilePath(DRIVE FPL("/a/b/c(1)"))); base::FilePath(DRIVE FPL("/a/b/c(1)")));
mount_points->RegisterFileSystem( mount_points->RegisterFileSystem(
"empty_path", storage::kFileSystemTypeSyncable, "empty_path", storage::kFileSystemTypeSyncable,
storage::FileSystemMountOption(), base::FilePath()); storage::FileSystemMountOption(), base::FilePath());
mount_points->RegisterFileSystem("mount", storage::kFileSystemTypeDrive, mount_points->RegisterFileSystem("mount", storage::kFileSystemTypeDriveFs,
storage::FileSystemMountOption(), storage::FileSystemMountOption(),
base::FilePath(DRIVE FPL("/root"))); base::FilePath(DRIVE FPL("/root")));
...@@ -306,17 +306,17 @@ TEST(ExternalMountPointsTest, CreateCrackedFileSystemURL) { ...@@ -306,17 +306,17 @@ TEST(ExternalMountPointsTest, CreateCrackedFileSystemURL) {
const TestCase kTestCases[] = { const TestCase kTestCases[] = {
{FPL("c/d/e"), true, storage::kFileSystemTypeNativeLocal, {FPL("c/d/e"), true, storage::kFileSystemTypeNativeLocal,
DRIVE FPL("/a/b/c/d/e"), "c"}, DRIVE FPL("/a/b/c/d/e"), "c"},
{FPL("c(1)/d/e"), true, storage::kFileSystemTypeDrive, {FPL("c(1)/d/e"), true, storage::kFileSystemTypeDriveFs,
DRIVE FPL("/a/b/c(1)/d/e"), "c(1)"}, DRIVE FPL("/a/b/c(1)/d/e"), "c(1)"},
{FPL("c(1)"), true, storage::kFileSystemTypeDrive, DRIVE FPL("/a/b/c(1)"), {FPL("c(1)"), true, storage::kFileSystemTypeDriveFs, DRIVE FPL("/a/b/c(1)"),
"c(1)"}, "c(1)"},
{FPL("empty_path/a"), true, storage::kFileSystemTypeSyncable, FPL("a"), {FPL("empty_path/a"), true, storage::kFileSystemTypeSyncable, FPL("a"),
"empty_path"}, "empty_path"},
{FPL("empty_path"), true, storage::kFileSystemTypeSyncable, FPL(""), {FPL("empty_path"), true, storage::kFileSystemTypeSyncable, FPL(""),
"empty_path"}, "empty_path"},
{FPL("mount/a/b"), true, storage::kFileSystemTypeDrive, {FPL("mount/a/b"), true, storage::kFileSystemTypeDriveFs,
DRIVE FPL("/root/a/b"), "mount"}, DRIVE FPL("/root/a/b"), "mount"},
{FPL("mount"), true, storage::kFileSystemTypeDrive, DRIVE FPL("/root"), {FPL("mount"), true, storage::kFileSystemTypeDriveFs, DRIVE FPL("/root"),
"mount"}, "mount"},
{FPL("cc"), false, storage::kFileSystemTypeUnknown, FPL(""), ""}, {FPL("cc"), false, storage::kFileSystemTypeUnknown, FPL(""), ""},
{FPL(""), false, storage::kFileSystemTypeUnknown, FPL(""), ""}, {FPL(""), false, storage::kFileSystemTypeUnknown, FPL(""), ""},
...@@ -332,7 +332,7 @@ TEST(ExternalMountPointsTest, CreateCrackedFileSystemURL) { ...@@ -332,7 +332,7 @@ TEST(ExternalMountPointsTest, CreateCrackedFileSystemURL) {
#if defined(FILE_PATH_USES_WIN_SEPARATORS) #if defined(FILE_PATH_USES_WIN_SEPARATORS)
{FPL("c/d\\e"), true, storage::kFileSystemTypeNativeLocal, {FPL("c/d\\e"), true, storage::kFileSystemTypeNativeLocal,
DRIVE FPL("/a/b/c/d/e"), "c"}, DRIVE FPL("/a/b/c/d/e"), "c"},
{FPL("mount\\a\\b"), true, storage::kFileSystemTypeDrive, {FPL("mount\\a\\b"), true, storage::kFileSystemTypeDriveFs,
DRIVE FPL("/root/a/b"), "mount"}, DRIVE FPL("/root/a/b"), "mount"},
#endif #endif
}; };
...@@ -374,13 +374,13 @@ TEST(ExternalMountPointsTest, CrackVirtualPath) { ...@@ -374,13 +374,13 @@ TEST(ExternalMountPointsTest, CrackVirtualPath) {
mount_points->RegisterFileSystem("c", storage::kFileSystemTypeNativeLocal, mount_points->RegisterFileSystem("c", storage::kFileSystemTypeNativeLocal,
storage::FileSystemMountOption(), storage::FileSystemMountOption(),
base::FilePath(DRIVE FPL("/a/b/c"))); base::FilePath(DRIVE FPL("/a/b/c")));
mount_points->RegisterFileSystem("c(1)", storage::kFileSystemTypeDrive, mount_points->RegisterFileSystem("c(1)", storage::kFileSystemTypeDriveFs,
storage::FileSystemMountOption(), storage::FileSystemMountOption(),
base::FilePath(DRIVE FPL("/a/b/c(1)"))); base::FilePath(DRIVE FPL("/a/b/c(1)")));
mount_points->RegisterFileSystem( mount_points->RegisterFileSystem(
"empty_path", storage::kFileSystemTypeSyncable, "empty_path", storage::kFileSystemTypeSyncable,
storage::FileSystemMountOption(), base::FilePath()); storage::FileSystemMountOption(), base::FilePath());
mount_points->RegisterFileSystem("mount", storage::kFileSystemTypeDrive, mount_points->RegisterFileSystem("mount", storage::kFileSystemTypeDriveFs,
storage::FileSystemMountOption(), storage::FileSystemMountOption(),
base::FilePath(DRIVE FPL("/root"))); base::FilePath(DRIVE FPL("/root")));
...@@ -395,17 +395,17 @@ TEST(ExternalMountPointsTest, CrackVirtualPath) { ...@@ -395,17 +395,17 @@ TEST(ExternalMountPointsTest, CrackVirtualPath) {
const TestCase kTestCases[] = { const TestCase kTestCases[] = {
{FPL("c/d/e"), true, storage::kFileSystemTypeNativeLocal, {FPL("c/d/e"), true, storage::kFileSystemTypeNativeLocal,
DRIVE FPL("/a/b/c/d/e"), "c"}, DRIVE FPL("/a/b/c/d/e"), "c"},
{FPL("c(1)/d/e"), true, storage::kFileSystemTypeDrive, {FPL("c(1)/d/e"), true, storage::kFileSystemTypeDriveFs,
DRIVE FPL("/a/b/c(1)/d/e"), "c(1)"}, DRIVE FPL("/a/b/c(1)/d/e"), "c(1)"},
{FPL("c(1)"), true, storage::kFileSystemTypeDrive, DRIVE FPL("/a/b/c(1)"), {FPL("c(1)"), true, storage::kFileSystemTypeDriveFs, DRIVE FPL("/a/b/c(1)"),
"c(1)"}, "c(1)"},
{FPL("empty_path/a"), true, storage::kFileSystemTypeSyncable, FPL("a"), {FPL("empty_path/a"), true, storage::kFileSystemTypeSyncable, FPL("a"),
"empty_path"}, "empty_path"},
{FPL("empty_path"), true, storage::kFileSystemTypeSyncable, FPL(""), {FPL("empty_path"), true, storage::kFileSystemTypeSyncable, FPL(""),
"empty_path"}, "empty_path"},
{FPL("mount/a/b"), true, storage::kFileSystemTypeDrive, {FPL("mount/a/b"), true, storage::kFileSystemTypeDriveFs,
DRIVE FPL("/root/a/b"), "mount"}, DRIVE FPL("/root/a/b"), "mount"},
{FPL("mount"), true, storage::kFileSystemTypeDrive, DRIVE FPL("/root"), {FPL("mount"), true, storage::kFileSystemTypeDriveFs, DRIVE FPL("/root"),
"mount"}, "mount"},
{FPL("cc"), false, storage::kFileSystemTypeUnknown, FPL(""), ""}, {FPL("cc"), false, storage::kFileSystemTypeUnknown, FPL(""), ""},
{FPL(""), false, storage::kFileSystemTypeUnknown, FPL(""), ""}, {FPL(""), false, storage::kFileSystemTypeUnknown, FPL(""), ""},
...@@ -421,7 +421,7 @@ TEST(ExternalMountPointsTest, CrackVirtualPath) { ...@@ -421,7 +421,7 @@ TEST(ExternalMountPointsTest, CrackVirtualPath) {
#if defined(FILE_PATH_USES_WIN_SEPARATORS) #if defined(FILE_PATH_USES_WIN_SEPARATORS)
{FPL("c/d\\e"), true, storage::kFileSystemTypeNativeLocal, {FPL("c/d\\e"), true, storage::kFileSystemTypeNativeLocal,
DRIVE FPL("/a/b/c/d/e"), "c"}, DRIVE FPL("/a/b/c/d/e"), "c"},
{FPL("mount\\a\\b"), true, storage::kFileSystemTypeDrive, {FPL("mount\\a\\b"), true, storage::kFileSystemTypeDriveFs,
DRIVE FPL("/root/a/b"), "mount"}, DRIVE FPL("/root/a/b"), "mount"},
#endif #endif
}; };
......
...@@ -94,7 +94,6 @@ int FileSystemContext::GetPermissionPolicy(FileSystemType type) { ...@@ -94,7 +94,6 @@ int FileSystemContext::GetPermissionPolicy(FileSystemType type) {
case kFileSystemTypeSyncable: case kFileSystemTypeSyncable:
return FILE_PERMISSION_SANDBOX; return FILE_PERMISSION_SANDBOX;
case kFileSystemTypeDrive:
case kFileSystemTypeNativeForPlatformApp: case kFileSystemTypeNativeForPlatformApp:
case kFileSystemTypeNativeLocal: case kFileSystemTypeNativeLocal:
case kFileSystemTypeCloudDevice: case kFileSystemTypeCloudDevice:
......
...@@ -197,7 +197,7 @@ TEST_F(FileSystemContextTest, CrackFileSystemURL) { ...@@ -197,7 +197,7 @@ TEST_F(FileSystemContextTest, CrackFileSystemURL) {
const std::string kIsolatedFileSystemID = isolated_fs.id(); const std::string kIsolatedFileSystemID = isolated_fs.id();
// Register system external mount point. // Register system external mount point.
ASSERT_TRUE(ExternalMountPoints::GetSystemInstance()->RegisterFileSystem( ASSERT_TRUE(ExternalMountPoints::GetSystemInstance()->RegisterFileSystem(
"system", storage::kFileSystemTypeDrive, FileSystemMountOption(), "system", storage::kFileSystemTypeNativeLocal, FileSystemMountOption(),
base::FilePath(DRIVE FPL("/test/sys/")))); base::FilePath(DRIVE FPL("/test/sys/"))));
ASSERT_TRUE(ExternalMountPoints::GetSystemInstance()->RegisterFileSystem( ASSERT_TRUE(ExternalMountPoints::GetSystemInstance()->RegisterFileSystem(
"ext", storage::kFileSystemTypeNativeLocal, FileSystemMountOption(), "ext", storage::kFileSystemTypeNativeLocal, FileSystemMountOption(),
...@@ -249,7 +249,7 @@ TEST_F(FileSystemContextTest, CrackFileSystemURL) { ...@@ -249,7 +249,7 @@ TEST_F(FileSystemContextTest, CrackFileSystemURL) {
DRIVE FPL("/test/isolated/root/file"), kIsolatedFileSystemID}, DRIVE FPL("/test/isolated/root/file"), kIsolatedFileSystemID},
// Should be cracked by system mount points: // Should be cracked by system mount points:
{"system", "external", true /* is_valid */, {"system", "external", true /* is_valid */,
storage::kFileSystemTypeExternal, storage::kFileSystemTypeDrive, storage::kFileSystemTypeExternal, storage::kFileSystemTypeNativeLocal,
DRIVE FPL("/test/sys/root/file"), "system"}, DRIVE FPL("/test/sys/root/file"), "system"},
{kIsolatedFileSystemID, "external", true /* is_valid */, {kIsolatedFileSystemID, "external", true /* is_valid */,
storage::kFileSystemTypeExternal, storage::kFileSystemTypeExternal,
...@@ -331,7 +331,7 @@ TEST_F(FileSystemContextTest, CanServeURLRequest) { ...@@ -331,7 +331,7 @@ TEST_F(FileSystemContextTest, CanServeURLRequest) {
// A request for an external mount point should be served. // A request for an external mount point should be served.
const std::string kExternalMountName = "ext_mount"; const std::string kExternalMountName = "ext_mount";
ASSERT_TRUE(ExternalMountPoints::GetSystemInstance()->RegisterFileSystem( ASSERT_TRUE(ExternalMountPoints::GetSystemInstance()->RegisterFileSystem(
kExternalMountName, storage::kFileSystemTypeDrive, kExternalMountName, storage::kFileSystemTypeNativeLocal,
FileSystemMountOption(), base::FilePath())); FileSystemMountOption(), base::FilePath()));
cracked_url = cracked_url =
context->CrackURL(CreateRawFileSystemURL("external", kExternalMountName)); context->CrackURL(CreateRawFileSystemURL("external", kExternalMountName));
......
...@@ -75,9 +75,6 @@ enum FileSystemType { ...@@ -75,9 +75,6 @@ enum FileSystemType {
// such as MTP or PTP. // such as MTP or PTP.
kFileSystemTypeDeviceMedia, kFileSystemTypeDeviceMedia,
// Indicates a Drive filesystem which provides access to Google Drive.
kFileSystemTypeDrive,
// Indicates a Syncable sandboxed filesystem which can be backed by a // Indicates a Syncable sandboxed filesystem which can be backed by a
// cloud storage service. // cloud storage service.
kFileSystemTypeSyncable, kFileSystemTypeSyncable,
......
...@@ -291,8 +291,6 @@ std::string GetFileSystemTypeString(FileSystemType type) { ...@@ -291,8 +291,6 @@ std::string GetFileSystemTypeString(FileSystemType type) {
return "NativeMedia"; return "NativeMedia";
case kFileSystemTypeDeviceMedia: case kFileSystemTypeDeviceMedia:
return "DeviceMedia"; return "DeviceMedia";
case kFileSystemTypeDrive:
return "Drive";
case kFileSystemTypeSyncable: case kFileSystemTypeSyncable:
case kFileSystemTypeSyncableForInternalSync: case kFileSystemTypeSyncableForInternalSync:
return "Syncable"; return "Syncable";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment