Commit e28bf02a authored by Noel Gordon's avatar Noel Gordon Committed by Commit Bot

Make the getRootPaths command fit for human consumption

Auto formatting and line length limits can produce the unreadable. In a
business where code is read way more than it is writ, making a reader's
eye dance left, right, and back again is tiresome and unnecessary.

Re-write this code for humans: it is both shorter and clearer.

Bug: 833834
Change-Id: I64535fdf6b4cccbc02029d594543d6719fe3c79f
Reviewed-on: https://chromium-review.googlesource.com/1039164Reviewed-by: default avatarStuart Langley <slangley@chromium.org>
Commit-Queue: Noel Gordon <noel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#555313}
parent f9c2cf42
......@@ -647,22 +647,22 @@ void FileManagerBrowserTestBase::OnCommand(const std::string& name,
base::ScopedAllowBlockingForTesting allow_blocking;
if (name == "getTestName") {
// Pass the test case name.
// Obtain the test case name.
*output = GetTestCaseNameParam();
return;
}
if (name == "getRootPaths") {
// Pass the root paths.
base::DictionaryValue res;
res.SetString("downloads",
"/" + util::GetDownloadsMountPointName(profile()));
res.SetString("drive", "/" +
drive::util::GetDriveMountPointPath(profile())
.BaseName()
.AsUTF8Unsafe() +
"/root");
base::JSONWriter::Write(res, output);
// Obtain the root paths.
const auto downloads = util::GetDownloadsMountPointName(profile());
const auto drive = drive::util::GetDriveMountPointPath(profile());
base::DictionaryValue dictionary;
auto drive_root = drive.BaseName().AsUTF8Unsafe().append("/root");
dictionary.SetString("drive", "/" + drive_root);
dictionary.SetString("downloads", "/" + downloads);
base::JSONWriter::Write(dictionary, output);
return;
}
......
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