Commit 63a20b1a authored by Austin Tankiang's avatar Austin Tankiang Committed by Commit Bot

Clean up download_prefs code using legacy drive sync client

DriveFS is going to be used regardless of its feature flag, and the
legacy drive sync client will be deleted, so clean up code that relies
on the legacy drive sync client.

Bug: 1002339
Change-Id: I85827f39bd174362a9a9e37eb5721384fea37d69
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1798947Reviewed-by: default avatarMin Qin <qinmin@chromium.org>
Commit-Queue: Austin Tankiang <austinct@chromium.org>
Cr-Commit-Position: refs/heads/master@{#697056}
parent a889b49a
...@@ -13,11 +13,9 @@ ...@@ -13,11 +13,9 @@
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
#include "base/test/scoped_feature_list.h"
#include "chrome/browser/chromeos/drive/drive_integration_service.h" #include "chrome/browser/chromeos/drive/drive_integration_service.h"
#include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h" #include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h"
#include "chrome/browser/chromeos/profiles/profile_helper.h" #include "chrome/browser/chromeos/profiles/profile_helper.h"
#include "chromeos/constants/chromeos_features.h"
#include "components/drive/drive_pref_names.h" #include "components/drive/drive_pref_names.h"
#include "content/public/test/test_service_manager_context.h" #include "content/public/test/test_service_manager_context.h"
#endif #endif
...@@ -221,32 +219,8 @@ TEST(DownloadPrefsTest, DownloadDirSanitization) { ...@@ -221,32 +219,8 @@ TEST(DownloadPrefsTest, DownloadDirSanitization) {
parent_reference.value()); parent_reference.value());
EXPECT_EQ(prefs.DownloadPath(), default_dir); EXPECT_EQ(prefs.DownloadPath(), default_dir);
// Drive
{
base::test::ScopedFeatureList features;
features.InitAndDisableFeature(chromeos::features::kDriveFs);
auto* integration_service =
drive::DriveIntegrationServiceFactory::GetForProfile(&profile);
integration_service->SetEnabled(true);
// My Drive root.
ExpectValidDownloadDir(
&profile, &prefs,
base::FilePath("/special/drive-0123456789abcdef/root"));
// My Drive/foo.
ExpectValidDownloadDir(
&profile, &prefs,
base::FilePath("/special/drive-0123456789abcdef/root/foo"));
// Invalid path without one of the drive roots.
profile.GetPrefs()->SetString(prefs::kDownloadDefaultDirectory,
"/special/drive-0123456789abcdef");
EXPECT_EQ(prefs.DownloadPath(), default_dir);
}
// DriveFS // DriveFS
{ {
base::test::ScopedFeatureList features;
features.InitAndEnableFeature(chromeos::features::kDriveFs);
// Create new profile for enabled feature to work. // Create new profile for enabled feature to work.
TestingProfile profile2(base::FilePath("/home/chronos/u-0123456789abcdef")); TestingProfile profile2(base::FilePath("/home/chronos/u-0123456789abcdef"));
chromeos::FakeChromeUserManager user_manager; chromeos::FakeChromeUserManager user_manager;
......
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