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

Side by Side Diff: build/android/pylib/screenshot.py

Issue 294113003: [Android] Convert to DeviceUtils versions of WaitUntilFullyBooted and GetExternalStoragePath. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 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 unified diff | Download patch
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import os 5 import os
6 import tempfile 6 import tempfile
7 7
8 from pylib import cmd_helper 8 from pylib import cmd_helper
9 9
10 # TODO(jbudorick) Remove once telemetry gets switched over. 10 # TODO(jbudorick) Remove once telemetry gets switched over.
(...skipping 13 matching lines...) Expand all
24 default. 24 default.
25 rotate: If True, the video will be rotated 90 degrees. 25 rotate: If True, the video will be rotated 90 degrees.
26 """ 26 """
27 def __init__(self, device, host_file, megabits_per_second=4, size=None, 27 def __init__(self, device, host_file, megabits_per_second=4, size=None,
28 rotate=False): 28 rotate=False):
29 # TODO(jbudorick) Remove once telemetry gets switched over. 29 # TODO(jbudorick) Remove once telemetry gets switched over.
30 if isinstance(device, pylib.android_commands.AndroidCommands): 30 if isinstance(device, pylib.android_commands.AndroidCommands):
31 device = pylib.device.device_utils.DeviceUtils(device) 31 device = pylib.device.device_utils.DeviceUtils(device)
32 self._device = device 32 self._device = device
33 self._device_file = ( 33 self._device_file = (
34 '%s/screen-recording.mp4' % device.old_interface.GetExternalStorage()) 34 '%s/screen-recording.mp4' % device.GetExternalStoragePath())
35 self._host_file = host_file or ('screen-recording-%s.mp4' % 35 self._host_file = host_file or ('screen-recording-%s.mp4' %
36 device.old_interface.GetTimestamp()) 36 device.old_interface.GetTimestamp())
37 self._host_file = os.path.abspath(self._host_file) 37 self._host_file = os.path.abspath(self._host_file)
38 self._recorder = None 38 self._recorder = None
39 self._recorder_pids = None 39 self._recorder_pids = None
40 self._recorder_stdout = None 40 self._recorder_stdout = None
41 self._is_started = False 41 self._is_started = False
42 42
43 self._args = ['adb'] 43 self._args = ['adb']
44 if self._device.old_interface.GetDevice(): 44 if self._device.old_interface.GetDevice():
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 def Pull(self): 83 def Pull(self):
84 """Pull resulting video file from the device. 84 """Pull resulting video file from the device.
85 85
86 Returns: 86 Returns:
87 Output video file name on the host. 87 Output video file name on the host.
88 """ 88 """
89 self._device.old_interface.PullFileFromDevice( 89 self._device.old_interface.PullFileFromDevice(
90 self._device_file, self._host_file) 90 self._device_file, self._host_file)
91 self._device.old_interface.RunShellCommand('rm -f "%s"' % self._device_file) 91 self._device.old_interface.RunShellCommand('rm -f "%s"' % self._device_file)
92 return self._host_file 92 return self._host_file
OLDNEW
« no previous file with comments | « build/android/pylib/instrumentation/test_runner.py ('k') | build/android/pylib/utils/emulator.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698