| OLD | NEW |
| (Empty) | |
| 1 # Copyright 2016 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 from recipe_engine import recipe_api |
| 6 from recipe_engine.types import freeze |
| 7 |
| 8 DEPS = [ |
| 9 'adb', |
| 10 'archive', |
| 11 'chromedriver', |
| 12 'chromium', |
| 13 'chromium_android', |
| 14 'commit_position', |
| 15 'depot_tools/bot_update', |
| 16 'depot_tools/gclient', |
| 17 'recipe_engine/platform', |
| 18 'recipe_engine/properties', |
| 19 ] |
| 20 |
| 21 BUILDERS = freeze({ |
| 22 'chromium.fyi': { |
| 23 'Android ChromeDriver Tests (dbg)': { |
| 24 'config': 'main_builder', |
| 25 'target': 'Debug', |
| 26 # Whether or not to update the test results log (Android only). |
| 27 'update_log': True, |
| 28 'android_packages': [ |
| 29 'chrome_beta', |
| 30 'chrome_public', |
| 31 'chrome_stable', |
| 32 'chromedriver_webview_shell', |
| 33 ], |
| 34 'install_apks': [ |
| 35 'ChromeDriverWebViewShell.apk', |
| 36 'ChromePublic.apk', |
| 37 ], |
| 38 }, |
| 39 }, |
| 40 }) |
| 41 |
| 42 REPO_URL = 'https://chromium.googlesource.com/chromium/src.git' |
| 43 |
| 44 def RunSteps(api): |
| 45 mastername = api.properties['mastername'] |
| 46 buildername = api.properties['buildername'] |
| 47 builder = BUILDERS[mastername][buildername] |
| 48 api.chromium_android.configure_from_properties( |
| 49 builder['config'], |
| 50 REPO_NAME='src', |
| 51 REPO_URL=REPO_URL, |
| 52 INTERNAL=False, |
| 53 BUILD_CONFIG=builder['target']) |
| 54 android_packages = builder.get('android_packages') |
| 55 update_log = builder.get('update_log') |
| 56 platform = api.chromedriver.get_chromedriver_platform(bool(android_packages)) |
| 57 |
| 58 api.gclient.set_config('chromium') |
| 59 api.gclient.apply_config('android') |
| 60 api.bot_update.ensure_checkout() |
| 61 api.chromium_android.clean_local_files() |
| 62 api.chromium.runhooks() |
| 63 api.chromium_android.run_tree_truth() |
| 64 |
| 65 api.adb.root_devices() |
| 66 api.chromium_android.spawn_logcat_monitor() |
| 67 api.chromium_android.device_status_check() |
| 68 api.chromium_android.provision_devices( |
| 69 min_battery_level=95, disable_network=True, disable_java_debug=True, |
| 70 reboot_timeout=180) |
| 71 |
| 72 api.archive.download_and_unzip_build( |
| 73 step_name='extract build', |
| 74 target=api.chromium.c.BUILD_CONFIG, |
| 75 build_url=None, |
| 76 build_archive_url=api.properties.get('parent_build_archive_url')) |
| 77 commit_position = api.commit_position.parse_revision( |
| 78 api.properties['got_revision_cp']) |
| 79 |
| 80 if builder['install_apks']: |
| 81 for apk in builder['install_apks']: |
| 82 api.chromium_android.adb_install_apk(apk) |
| 83 |
| 84 api.chromedriver.download_prebuilts() |
| 85 passed = api.chromedriver.run_all_tests( |
| 86 android_packages=android_packages) |
| 87 api.chromedriver.archive_server_logs() |
| 88 |
| 89 if update_log: |
| 90 api.chromedriver.update_test_results_log(platform, commit_position, passed) |
| 91 |
| 92 api.chromium_android.logcat_dump() |
| 93 api.chromium_android.stack_tool_steps() |
| 94 api.chromium_android.test_report() |
| 95 |
| 96 def GenTests(api): |
| 97 sanitize = lambda s: ''.join(c if c.isalnum() else '_' for c in s) |
| 98 |
| 99 yield ( |
| 100 api.test('%s_basic' % sanitize('Android ChromeDriver Tests (dbg)')) + |
| 101 api.properties.generic( |
| 102 buildername='Android ChromeDriver Tests (dbg)', |
| 103 slavename='slavename', |
| 104 mastername='chromium.fyi') + |
| 105 api.properties( |
| 106 parent_build_archive_url='gs://test-domain/test-archive.zip', |
| 107 got_revision='4f4b02f6b7fa20a3a25682c457bbc8ad589c8a00', |
| 108 got_revision_cp='refs/heads/master@{#333333}')) |
| OLD | NEW |