| OLD | NEW |
| (Empty) |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 # Use of this source code is governed by a BSD-style license that can be | |
| 3 # found in the LICENSE file. | |
| 4 | |
| 5 """ | |
| 6 Performance testing for the WebView. | |
| 7 """ | |
| 8 | |
| 9 from recipe_engine.types import freeze | |
| 10 | |
| 11 DEPS = [ | |
| 12 'adb', | |
| 13 'depot_tools/bot_update', | |
| 14 'chromium', | |
| 15 'chromium_android', | |
| 16 'depot_tools/gclient', | |
| 17 'recipe_engine/json', | |
| 18 'recipe_engine/path', | |
| 19 'recipe_engine/properties', | |
| 20 'recipe_engine/python', | |
| 21 'recipe_engine/step', | |
| 22 ] | |
| 23 | |
| 24 REPO_URL = 'https://chromium.googlesource.com/chromium/src.git' | |
| 25 | |
| 26 WEBVIEW_APK = 'SystemWebView.apk' | |
| 27 | |
| 28 TELEMETRY_SHELL_APK = 'SystemWebViewShell.apk' | |
| 29 | |
| 30 BUILDER = freeze({ | |
| 31 'perf_id': 'android-webview', | |
| 32 'num_device_shards': 5, | |
| 33 }) | |
| 34 | |
| 35 def RunSteps(api): | |
| 36 api.chromium_android.configure_from_properties('webview_perf', | |
| 37 REPO_NAME='src', | |
| 38 REPO_URL=REPO_URL, | |
| 39 INTERNAL=False, | |
| 40 BUILD_CONFIG='Release') | |
| 41 | |
| 42 # Sync code. | |
| 43 api.gclient.set_config('perf') | |
| 44 api.gclient.apply_config('android') | |
| 45 api.bot_update.ensure_checkout(force=True) | |
| 46 api.chromium_android.clean_local_files() | |
| 47 | |
| 48 # Gyp the chromium checkout. | |
| 49 api.chromium.runhooks() | |
| 50 | |
| 51 # Build the WebView apk, WebView shell and Android testing tools. | |
| 52 api.chromium.compile(targets=['android_tools', | |
| 53 'push_apps_to_background_apk', | |
| 54 'system_webview_apk', | |
| 55 'system_webview_shell_apk']) | |
| 56 | |
| 57 api.chromium_android.spawn_logcat_monitor() | |
| 58 api.chromium_android.device_status_check() | |
| 59 api.chromium_android.provision_devices( | |
| 60 min_battery_level=95, disable_network=True, disable_java_debug=True, | |
| 61 reboot_timeout=180) | |
| 62 | |
| 63 # Install WebView | |
| 64 api.chromium_android.adb_install_apk(WEBVIEW_APK) | |
| 65 | |
| 66 # Install the telemetry shell. | |
| 67 api.chromium_android.adb_install_apk(TELEMETRY_SHELL_APK) | |
| 68 | |
| 69 # Run the tests. | |
| 70 api.adb.list_devices() | |
| 71 perf_tests = api.chromium.list_perf_tests( | |
| 72 browser='android-webview', | |
| 73 num_shards=BUILDER['num_device_shards'], | |
| 74 device=api.adb.devices[0]).json.output | |
| 75 try: | |
| 76 api.chromium_android.run_sharded_perf_tests( | |
| 77 config=api.json.input(data=perf_tests), | |
| 78 chartjson_file=True, | |
| 79 perf_id=BUILDER['perf_id']) | |
| 80 finally: | |
| 81 api.chromium_android.logcat_dump() | |
| 82 api.chromium_android.stack_tool_steps() | |
| 83 api.chromium_android.test_report() | |
| 84 | |
| 85 | |
| 86 def GenTests(api): | |
| 87 yield api.test('basic') + api.properties.scheduled() | |
| OLD | NEW |