| Index: chrome/browser/chromeos/file_manager/path_util_unittest.cc
|
| diff --git a/chrome/browser/chromeos/file_manager/path_util_unittest.cc b/chrome/browser/chromeos/file_manager/path_util_unittest.cc
|
| index f7ad12162f5a8ee9a46959d87fc694221b4a1724..dd65977b9ac13e5a9cd99eb2599c4afe355ec8fa 100644
|
| --- a/chrome/browser/chromeos/file_manager/path_util_unittest.cc
|
| +++ b/chrome/browser/chromeos/file_manager/path_util_unittest.cc
|
| @@ -5,6 +5,7 @@
|
| #include "chrome/browser/chromeos/file_manager/path_util.h"
|
|
|
| #include "base/files/file_path.h"
|
| +#include "base/sys_info.h"
|
| #include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h"
|
| #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h"
|
| #include "chrome/browser/chromeos/profiles/profile_helper.h"
|
| @@ -20,9 +21,29 @@ namespace file_manager {
|
| namespace util {
|
| namespace {
|
|
|
| +const char kLsbRelease[] =
|
| + "CHROMEOS_RELEASE_NAME=Chrome OS\n"
|
| + "CHROMEOS_RELEASE_VERSION=1.2.3.4\n";
|
| +
|
| +// Sets a valid Chrome OS version info so IsRunningOnChromeOS() returns true.
|
| +class ScopedSetRunningOnChromeOS {
|
| + public:
|
| + ScopedSetRunningOnChromeOS(const std::string& lsb_release,
|
| + const base::Time& lsb_release_time) {
|
| + base::SysInfo::SetChromeOSVersionInfoForTest(lsb_release, lsb_release_time);
|
| + }
|
| + ~ScopedSetRunningOnChromeOS() {
|
| + base::SysInfo::SetChromeOSVersionInfoForTest("", base::Time());
|
| + }
|
| +
|
| + private:
|
| + DISALLOW_COPY_AND_ASSIGN(ScopedSetRunningOnChromeOS);
|
| +};
|
| +
|
| TEST(FileManagerPathUtilTest, MultiProfileDownloadsFolderMigration) {
|
| content::TestBrowserThreadBundle thread_bundle;
|
| TestingProfile profile;
|
| + ScopedSetRunningOnChromeOS fake_release(kLsbRelease, base::Time());
|
|
|
| // This looks like "/home/chronos/u-hash/Downloads" in the production
|
| // environment.
|
|
|