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

Unified Diff: tools/telemetry/telemetry/core/backends/chrome/android_browser_backend.py

Issue 197883005: [Telementry][Android] Only copy changed or missing files of profile (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add shebang to satisfy presubmit checks Created 6 years, 9 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
« no previous file with comments | « build/android/pylib/efficient_android_directory_copy.sh ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/core/backends/chrome/android_browser_backend.py
diff --git a/tools/telemetry/telemetry/core/backends/chrome/android_browser_backend.py b/tools/telemetry/telemetry/core/backends/chrome/android_browser_backend.py
index 2d28d220c07d55812b679bffab4c7536ddea53fa..56a79d3f61b2ef9d94cc3ca87b91443dbbd6d6bb 100644
--- a/tools/telemetry/telemetry/core/backends/chrome/android_browser_backend.py
+++ b/tools/telemetry/telemetry/core/backends/chrome/android_browser_backend.py
@@ -75,9 +75,6 @@ class ChromeBackendSettings(AndroidBrowserBackendSettings):
return 'localabstract:chrome_devtools_remote'
def PushProfile(self, new_profile_dir):
- # Clear the old profile first, since copying won't delete files.
- self.RemoveProfile()
-
# Pushing the profile is slow, so we don't want to do it every time.
# Avoid this by pushing to a safe location using PushIfNeeded, and
# then copying into the correct location on each test run.
@@ -90,11 +87,9 @@ class ChromeBackendSettings(AndroidBrowserBackendSettings):
saved_profile_location = '/sdcard/profile/%s' % profile_base
self.adb.Adb().PushIfNeeded(new_profile_dir, saved_profile_location)
- self.adb.RunShellCommand('cp -r %s/* %s' % (saved_profile_location,
- self.profile_dir),
- timeout_time = 60)
- # We now need to give the ownership back to the browser UID
+ self.adb.Adb().EfficientDeviceDirectoryCopy(saved_profile_location,
+ self.profile_dir)
dumpsys = self.adb.RunShellCommand('dumpsys package %s' % self.package)
id_line = next(line for line in dumpsys if 'userId=' in line)
uid = re.search('\d+', id_line).group()
@@ -106,7 +101,6 @@ class ChromeBackendSettings(AndroidBrowserBackendSettings):
self.adb.RunShellCommand('chown %s.%s %s' %
(uid, uid, extended_path))
-
class ContentShellBackendSettings(AndroidBrowserBackendSettings):
def __init__(self, adb, package):
super(ContentShellBackendSettings, self).__init__(
@@ -201,10 +195,10 @@ class AndroidBrowserBackend(chrome_browser_backend.ChromeBrowserBackend):
self._adb.CloseApplication(self._backend_settings.package)
if self._adb.Adb().CanAccessProtectedFileContents():
- if not self.browser_options.dont_override_profile:
- self._backend_settings.RemoveProfile()
if self.browser_options.profile_dir:
self._backend_settings.PushProfile(self.browser_options.profile_dir)
+ elif not self.browser_options.dont_override_profile:
+ self._backend_settings.RemoveProfile()
self._forwarder_factory = android_forwarder.AndroidForwarderFactory(
self._adb, use_rndis_forwarder)
« no previous file with comments | « build/android/pylib/efficient_android_directory_copy.sh ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698