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

Unified Diff: build/android/pylib/local/device/local_device_instrumentation_test_run.py

Issue 2833773004: [Instrumentation Test Speed] Add trace event to the setup logic (Closed)
Patch Set: Created 3 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/local/device/local_device_instrumentation_test_run.py
diff --git a/build/android/pylib/local/device/local_device_instrumentation_test_run.py b/build/android/pylib/local/device/local_device_instrumentation_test_run.py
index c6a0c9df9431327df1d0ab2561cf2e930232128b..ee49ab5f28678b0d95ef34ec855dd179a0e5ec4d 100644
--- a/build/android/pylib/local/device/local_device_instrumentation_test_run.py
+++ b/build/android/pylib/local/device/local_device_instrumentation_test_run.py
@@ -76,11 +76,21 @@ class LocalDeviceInstrumentationTestRun(
@trace_event.traced
def individual_device_set_up(dev, host_device_tuples):
steps = []
+
def install_helper(apk, permissions):
- return lambda: dev.Install(apk, permissions=permissions)
+ @trace_event.traced("apk_path")
+ def install_helper_internal(apk_path=apk.path):
shenghuazhang 2017/04/21 19:17:22 Add the internal function with apk.path argument s
jbudorick 2017/04/21 20:41:08 Why am I not surprised that ChromePublic.apk takes
+ # pylint: disable=unused-argument
+ dev.Install(apk, permissions=permissions)
+ return install_helper_internal
+
def incremental_install_helper(dev, apk, script):
- return lambda: local_device_test_run.IncrementalInstall(
- dev, apk, script)
+ @trace_event.traced("apk_path")
+ def incremental_install_helper_internal(apk_path=apk.path):
+ # pylint: disable=unused-argument
+ local_device_test_run.IncrementalInstall(
+ dev, apk, script)
+ return incremental_install_helper_internal
if self._test_instance.apk_under_test:
if self._test_instance.apk_under_test_incremental_install_script:
@@ -108,6 +118,7 @@ class LocalDeviceInstrumentationTestRun(
steps.extend(install_helper(apk, None)
for apk in self._test_instance.additional_apks)
+ @trace_event.traced
def set_debug_app():
# Set debug app in order to enable reading command line flags on user
# builds
@@ -120,7 +131,7 @@ class LocalDeviceInstrumentationTestRun(
dev.RunShellCommand(['am', 'set-debug-app', '--persistent',
self._test_instance.package_info.package],
check_return=True)
-
+ @trace_event.traced
def edit_shared_prefs():
for pref in self._test_instance.edit_shared_prefs:
prefs = shared_prefs.SharedPrefs(dev, pref['package'],
@@ -145,6 +156,7 @@ class LocalDeviceInstrumentationTestRun(
str(type(value)), key))
prefs.Commit()
+ @trace_event.traced
def push_test_data():
device_root = posixpath.join(dev.GetExternalStoragePath(),
'chromium_tests_root')
@@ -160,6 +172,7 @@ class LocalDeviceInstrumentationTestRun(
dev.RunShellCommand(['rm', '-rf', device_root], check_return=True)
dev.RunShellCommand(['mkdir', '-p', device_root], check_return=True)
+ @trace_event.traced
def create_flag_changer():
if self._test_instance.flags:
if not self._test_instance.package_info:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698