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

Side by Side Diff: scripts/slave/recipes/android_webview_shell_tests.py

Issue 1465343002: [Android] Add context manager to record logcat during step(s). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Removed unused config. Created 5 years 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 | Annotate | Revision Log
OLDNEW
1 # Copyright 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 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 """ 5 """
6 Recipe for running SystemWebViewShell instrumentation layout tests using 6 Recipe for running SystemWebViewShell instrumentation layout tests using
7 system WebView. 7 system WebView.
8 """ 8 """
9 9
10 from recipe_engine.types import freeze 10 from recipe_engine.types import freeze
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 api.chromium_android.adb_install_apk(WEBVIEW_APK) 79 api.chromium_android.adb_install_apk(WEBVIEW_APK)
80 80
81 # Install system WebView shell 81 # Install system WebView shell
82 api.chromium_android.adb_install_apk(WEBVIEW_SHELL_APK) 82 api.chromium_android.adb_install_apk(WEBVIEW_SHELL_APK)
83 83
84 api.adb.list_devices() 84 api.adb.list_devices()
85 85
86 # Run the instrumentation tests from the package. 86 # Run the instrumentation tests from the package.
87 run_tests(api) 87 run_tests(api)
88 88
89 api.chromium_android.logcat_dump() 89 logcat_file = api.chromium.output_dir.join('full_logcat')
90 api.chromium_android.stack_tool_steps() 90 api.chromium_android.logcat_dump(output_logcat_file=logcat_file)
91 api.chromium_android.stack_tool_steps(logcat_file=logcat_file)
91 api.chromium_android.test_report() 92 api.chromium_android.test_report()
92 93
93 def run_tests(api): 94 def run_tests(api):
94 droid = api.chromium_android 95 droid = api.chromium_android
95 mock_test_results = { 96 mock_test_results = {
96 'per_iteration_data': [{'TestA': [{'status': 'SUCCESS'}]}, 97 'per_iteration_data': [{'TestA': [{'status': 'SUCCESS'}]},
97 {'TestB': [{'status': 'FAILURE'}]}] 98 {'TestB': [{'status': 'FAILURE'}]}]
98 } 99 }
99 for suite in INSTRUMENTATION_TESTS: 100 for suite in INSTRUMENTATION_TESTS:
100 json_results_file = api.json.output(add_json_log=False) 101 json_results_file = api.json.output(add_json_log=False)
(...skipping 12 matching lines...) Expand all
113 [test_name for test_name, test_status in test_results.iteritems() 114 [test_name for test_name, test_status in test_results.iteritems()
114 if test_status not in ['SUCCESS', 'SKIPPED']]) 115 if test_status not in ['SUCCESS', 'SKIPPED']])
115 except Exception: # pragma: no cover 116 except Exception: # pragma: no cover
116 failures = [] 117 failures = []
117 step_result.presentation.step_text += api.test_utils.format_step_text( 118 step_result.presentation.step_text += api.test_utils.format_step_text(
118 [['failures:', failures]]) 119 [['failures:', failures]])
119 120
120 121
121 def GenTests(api): 122 def GenTests(api):
122 yield api.test('basic') + api.properties.scheduled() 123 yield api.test('basic') + api.properties.scheduled()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698