Reland of Migrate DeviceUtils.ReadFile to adb_wrapper
Original description:
The implementation is based on a simple 'cat' run by shell on the
device (with optional as_root).
Interface changes:
- The return value is a string (instead of a list of lines).
- An exception is raised if the file cannot be read
(instead of returning an empty list).
Original CL: https://codereview.chromium.org/775333002/
BUG=267773
Committed: https://crrev.com/a8d3b82a9c779568ee64ec5c261c6c7024ef8759
Cr-Commit-Position: refs/heads/master@{#307881}
My previous search for clients (searching for device\.WriteFile) missed this
one.
This time I also searched for anything containing "pylib WriteFile" or
"telemetry WriteFile" (there are lots of things which are called WriteFile, but
are not from DeviceUtils).
Do let me know if you think I might be missing something else.
skyostil@chromium.org: Please review changes in:
telemetry/core/backends/chrome/android_browser_backend.py
https://codereview.chromium.org/794583004/diff/40001/tools/telemetry/telemetr...
File tools/telemetry/telemetry/core/backends/chrome/android_browser_backend.py
(right):
https://codereview.chromium.org/794583004/diff/40001/tools/telemetry/telemetr...
tools/telemetry/telemetry/core/backends/chrome/android_browser_backend.py:227:
cmdline_file, as_root=True)
Turns out, this was silently failing (and returning empty contents) because of
the missing as_root=True
Sami
tools/telemetry/telemetry/core/backends/chrome/android_browser_backend.py lgtm (and the other bits too that didn't change from the previous version).
On 2014/12/11 01:56:24, jbudorick wrote:
> lgtm
>
>
https://codereview.chromium.org/794583004/diff/40001/tools/telemetry/telemetr...
> File tools/telemetry/telemetry/core/backends/chrome/android_browser_backend.py
> (right):
>
>
https://codereview.chromium.org/794583004/diff/40001/tools/telemetry/telemetr...
> tools/telemetry/telemetry/core/backends/chrome/android_browser_backend.py:227:
> cmdline_file, as_root=True)
> On 2014/12/10 17:22:27, perezju wrote:
> > Turns out, this was silently failing (and returning empty contents) because
of
> > the missing as_root=True
>
> ... and implementing ReadFile with RunShellCommand(..., check_return=True)
> exposed that error?
Yes, that's one of the interface changes. To raise an exception when the command
fails, instead of returning empty contents.
A revert of this CL (patchset #3 id:40001) has been created in
https://codereview.chromium.org/796013004/ by perezju@chromium.org.
The reason for reverting is: Broke again android perf bots and nexus 7 debug
with error:
CRITICAL:root:Cannot set Chrome command line. Fix this by flashing to a
userdebug build..
Issue 794583004: Reland of Migrate DeviceUtils.ReadFile to adb_wrapper
(Closed)
Created 6 years ago by perezju
Modified 6 years ago
Reviewers: jbudorick, Sami
Base URL: https://chromium.googlesource.com/chromium/src.git@master
Comments: 2