Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(179)

Unified Diff: chrome/browser/chromeos/file_manager/file_manager_browsertest_base.cc

Issue 2318023002: //chrome/browser/chromeos: Change ScopedTempDir::path() to GetPath() (Closed)
Patch Set: Just rebased Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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/12 19:40:37 I'm aware that this is a bit hacky. I was tempted
achuithb 2016/09/13 20:55:19 I'm really not sure either. Is it possible to pull
vabr (Chromium) 2016/09/14 10:58:20 Sure: https://codereview.chromium.org/2345473002 I
+ // check if it already is so, because GetPath checks that the current path
+ // is not empty.
+ base::FilePath current_root_path = root_.Take();
achuithb 2016/09/13 20:55:19 const
vabr (Chromium) 2016/09/14 10:58:20 Now obsolete after the above described changes (ma
+ 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(); }
achuithb 2016/09/13 20:55:19 Get rid of this const return type, but make the fu
vabr (Chromium) 2016/09/14 10:58:20 Looking at the callsites, they never move away the
private:
std::string name_;

Powered by Google App Engine
This is Rietveld 408576698