Chromium Code Reviews| Index: chrome/browser/chromeos/file_manager/file_manager_browsertest_base.cc |
| diff --git a/chrome/browser/chromeos/file_manager/file_manager_browsertest_base.cc b/chrome/browser/chromeos/file_manager/file_manager_browsertest_base.cc |
| index abc7a0fbf9372e038e147ae5df30d6bc71b79a00..6caf07b69503cb6a9a24be5b3f6991df8188a025 100644 |
| --- a/chrome/browser/chromeos/file_manager/file_manager_browsertest_base.cc |
| +++ b/chrome/browser/chromeos/file_manager/file_manager_browsertest_base.cc |
| @@ -184,11 +184,19 @@ class TestVolume { |
| bool CreateRootDirectory(const Profile* profile) { |
| const base::FilePath path = profile->GetPath().Append(name_); |
| - return root_.path() == path || root_.Set(path); |
| + // Ensure that |path| is taken by |root_|. Cannot use |root_.GetPath()| to |
|
vabr (Chromium)
2016/09/07 15:55:06
I'm aware that this is a bit hacky.
I was tempted
|
| + // check if it already is so, because GetPath checks that the current path |
| + // is not empty. |
| + base::FilePath current_root_path = root_.Take(); |
| + if (!current_root_path.empty() && current_root_path != path) { |
| + CHECK(root_.Set(current_root_path)); |
| + return false; |
| + } |
| + return root_.Set(path); |
| } |
| const std::string& name() { return name_; } |
| - const base::FilePath root_path() { return root_.path(); } |
| + const base::FilePath root_path() { return root_.GetPath(); } |
| private: |
| std::string name_; |