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