Index: scripts/slave/recipe_modules/chromium_android/api.py |
diff --git a/scripts/slave/recipe_modules/chromium_android/api.py b/scripts/slave/recipe_modules/chromium_android/api.py |
index 3dc2fc01ff338c0a3fe6ba5a002514b624fcfa52..3b21386b782ce444be78a7eb0e75f4ed5350fd2e 100644 |
--- a/scripts/slave/recipe_modules/chromium_android/api.py |
+++ b/scripts/slave/recipe_modules/chromium_android/api.py |
@@ -318,8 +318,10 @@ class AndroidApi(recipe_api.RecipeApi): |
import sys |
sys.path.append(sys.argv[1]) |
from devil import devil_env |
+ from devil.android.sdk import adb_wrapper |
devil_env.config.Initialize() |
devil_env.config.PrefetchPaths(dependencies=['adb']) |
+ adb_wrapper.AdbWrapper.StartServer() |
""", |
args=[devil_path]) |
self.m.adb.set_adb_path( |
@@ -1161,6 +1163,52 @@ class AndroidApi(recipe_api.RecipeApi): |
self.asan_device_teardown() |
self.test_report() |
+ def android_build_wrapper(self, logcat_gs_bucket='chromium-android'): |
ghost stip (do not use)
2016/11/09 01:55:56
this wacky construction of a contextmanager-genera
jbudorick
2016/11/09 14:32:36
On looking at this, a config setting probably woul
|
+ @contextlib.contextmanager |
+ def wrapper(bisect_obj): |
+ """A context manager for use as auto_bisect's build_context_mgr. |
+ |
+ This wraps every overall bisect run. |
+ """ |
+ try: |
+ bisect_obj.m.chromium_android.common_tests_setup_steps( |
+ perf_setup=True, remove_system_webview=True) |
+ bisect_obj.m.chromium.runhooks() |
+ |
+ yield |
+ finally: |
+ bisect_obj.ensure_checkout() |
+ bisect_obj.m.chromium_android.common_tests_final_steps( |
+ logcat_gs_bucket=logcat_gs_bucket) |
+ return wrapper |
+ |
+ def android_bisect_test_wrapper(self, logcat_gs_bucket='chromium-android'): |
+ @contextlib.contextmanager |
+ def wrapper(bisect_obj): |
+ """A context manager for use as auto_bisect's test_context_mgr. |
+ |
+ This wraps each individual bisect test. |
+ """ |
+ self.use_devil_adb() |
+ with self.android_test_wrapper(logcat_gs_bucket)(bisect_obj): |
ghost stip (do not use)
2016/11/09 01:55:56
this split is so android_test_wrapper can be used
jbudorick
2016/11/09 14:32:36
I think this belongs in the bisect modules rather
RobertoCN
2016/11/09 22:10:31
+1
ghost stip (do not use)
2016/11/09 23:05:37
Done.
|
+ yield |
+ return wrapper |
+ |
+ def android_test_wrapper(self, logcat_gs_bucket='chromium-android'): |
+ @contextlib.contextmanager |
+ def wrapper(_bisect_obj): |
+ """A context manager for running android test steps.""" |
+ try: |
+ self.spawn_logcat_monitor() |
+ self.spawn_device_monitor() |
+ |
+ yield |
+ finally: |
+ self.shutdown_device_monitor() |
+ self.logcat_dump(gs_bucket=logcat_gs_bucket) |
+ self.stack_tool_steps() |
+ return wrapper |
+ |
def run_bisect_script(self, extra_src='', path_to_config='', **kwargs): |
self.m.step('prepare bisect perf regression', |
[self.m.path['checkout'].join('tools', |