| OLD | NEW |
| 1 # Android Test Instructions | 1 # Android Test Instructions |
| 2 | 2 |
| 3 Device Setup Tests are runnable on physical devices or emulators. See the | 3 Device Setup Tests are runnable on physical devices or emulators. See the |
| 4 instructions below for setting up either a physical device or an emulator. | 4 instructions below for setting up either a physical device or an emulator. |
| 5 | 5 |
| 6 [TOC] | 6 [TOC] |
| 7 | 7 |
| 8 ## Physical Device Setup **ADB Debugging** | 8 ## Physical Device Setup **ADB Debugging** |
| 9 | 9 |
| 10 In order to allow the ADB to connect to the device, you must enable USB | 10 In order to allow the ADB to connect to the device, you must enable USB |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 by the Android SDK. When doing so, be sure to enable GPU emulation in hardware | 88 by the Android SDK. When doing so, be sure to enable GPU emulation in hardware |
| 89 settings, since Chromium requires it to render. | 89 settings, since Chromium requires it to render. |
| 90 | 90 |
| 91 ## Building Tests | 91 ## Building Tests |
| 92 | 92 |
| 93 It may not be immediately obvious where your test code gets compiled to, so here | 93 It may not be immediately obvious where your test code gets compiled to, so here |
| 94 are some general rules: | 94 are some general rules: |
| 95 | 95 |
| 96 * If your test code lives under /content, it will probably be built as part of | 96 * If your test code lives under /content, it will probably be built as part of |
| 97 the content\_shell\_test\_apk * If your test code lives under /chrome (or | 97 the content\_shell\_test\_apk * If your test code lives under /chrome (or |
| 98 higher), it will probably be built as part of the chrome\_shell\_test\_apk * | 98 higher), it will probably be built as part of the chrome\_public\_test\_apk * |
| 99 (Please fill in more details here if you know them). | 99 (Please fill in more details here if you know them). |
| 100 | 100 |
| 101 NB: We used to call the chrome\_shell\_test\_apk the | 101 NB: We used to call the chrome\_public\_test\_apk the |
| 102 chromium\_shell\_test\_apk. There may still be references to this kicking | 102 chromium\_shell\_test\_apk. There may still be references to this kicking |
| 103 around, but wherever you see chromium\_shell\_test you should replace with | 103 around, but wherever you see chromium\_shell\_test you should replace with |
| 104 chrome\_shell\_test. | 104 chrome\_public\_test. |
| 105 | 105 |
| 106 Once you know what to build, just do it like you normally would build anything | 106 Once you know what to build, just do it like you normally would build anything |
| 107 else, e.g.: `ninja -C out/Release chrome_shell_test_apk` | 107 else, e.g.: `ninja -C out/Release chrome_public_test_apk` |
| 108 | 108 |
| 109 ## Running Tests | 109 ## Running Tests |
| 110 | 110 |
| 111 All functional tests are run using `build/android/test_runner.py`. | 111 All functional tests are run using `build/android/test_runner.py`. |
| 112 Tests are sharded across all attached devices. In order to run tests, call: | 112 Tests are sharded across all attached devices. In order to run tests, call: |
| 113 `build/android/test_runner.py <test_type> [options]` | 113 `build/android/test_runner.py <test_type> [options]` |
| 114 For a list of valid test types, see `test_runner.py --help`. For | 114 For a list of valid test types, see `test_runner.py --help`. For |
| 115 help on a specific test type, run `test_runner.py <test_type> --help`. | 115 help on a specific test type, run `test_runner.py <test_type> --help`. |
| 116 | 116 |
| 117 The commands used by the buildbots are printed in the logs. Look at | 117 The commands used by the buildbots are printed in the logs. Look at |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 ninja -C out/Release content_shell_test_apk | 183 ninja -C out/Release content_shell_test_apk |
| 184 | 184 |
| 185 # Install the code under test | 185 # Install the code under test |
| 186 build/android/adb_install_apk.py out/Release/apks/ContentShell.apk | 186 build/android/adb_install_apk.py out/Release/apks/ContentShell.apk |
| 187 | 187 |
| 188 # Run the test (will automagically install the test APK) | 188 # Run the test (will automagically install the test APK) |
| 189 build/android/test_runner.py instrumentation --test-apk=ContentShellTest \ | 189 build/android/test_runner.py instrumentation --test-apk=ContentShellTest \ |
| 190 --isolate-file-path content/content_shell_test_apk.isolate --release -vv | 190 --isolate-file-path content/content_shell_test_apk.isolate --release -vv |
| 191 ``` | 191 ``` |
| 192 | 192 |
| 193 ChromeShell tests: | 193 ChromePublic tests: |
| 194 | 194 |
| 195 ```shell | 195 ```shell |
| 196 # Build the code under test | 196 # Build the code under test |
| 197 ninja -C out/Release chrome_shell_apk | 197 ninja -C out/Release chrome_public_apk |
| 198 | 198 |
| 199 # Build the tests themselves | 199 # Build the tests themselves |
| 200 ninja -C out/Release chrome_shell_test_apk | 200 ninja -C out/Release chrome_public_test_apk |
| 201 | 201 |
| 202 # Install the code under test | 202 # Install the code under test |
| 203 build/android/adb_install_apk.py out/Release/apks/ChromeShell.apk | 203 build/android/adb_install_apk.py out/Release/apks/ChromePublic.apk |
| 204 | 204 |
| 205 # Run the test (will automagically install the test APK) | 205 # Run the test (will automagically install the test APK) |
| 206 build/android/test_runner.py instrumentation --test-apk=ChromeShellTest \ | 206 build/android/test_runner.py instrumentation --test-apk=ChromePublicTest \ |
| 207 --isolate-file-path chrome/chrome_shell_test_apk.isolate --release -vv | 207 --isolate-file-path chrome/chrome_public_test_apk.isolate --release -vv |
| 208 ``` | 208 ``` |
| 209 | 209 |
| 210 AndroidWebView tests: | 210 AndroidWebView tests: |
| 211 | 211 |
| 212 ```shell | 212 ```shell |
| 213 ninja -C out/Release android_webview_apk | 213 ninja -C out/Release android_webview_apk |
| 214 ninja -C out/Release android_webview_test_apk | 214 ninja -C out/Release android_webview_test_apk |
| 215 build/android/adb_install_apk.py out/Release/apks/AndroidWebView.apk \ | 215 build/android/adb_install_apk.py out/Release/apks/AndroidWebView.apk \ |
| 216 build/android/test_runner.py instrumentation --test-apk=AndroidWebViewTest \ | 216 build/android/test_runner.py instrumentation --test-apk=AndroidWebViewTest \ |
| 217 --test_data webview:android_webview/test/data/device_files --release -vvv | 217 --test_data webview:android_webview/test/data/device_files --release -vvv |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 See | 253 See |
| 254 https://sites.google.com/a/chromium.org/dev/developers/testing/webkit-layout-tes
ts | 254 https://sites.google.com/a/chromium.org/dev/developers/testing/webkit-layout-tes
ts |
| 255 | 255 |
| 256 ## Running GPU tests | 256 ## Running GPU tests |
| 257 | 257 |
| 258 (e.g. the "Android Debug (Nexus 7)" bot on the chromium.gpu waterfall) | 258 (e.g. the "Android Debug (Nexus 7)" bot on the chromium.gpu waterfall) |
| 259 | 259 |
| 260 See http://www.chromium.org/developers/testing/gpu-testing for details. Use | 260 See http://www.chromium.org/developers/testing/gpu-testing for details. Use |
| 261 --browser=android-content-shell. Examine the stdio from the test invocation on | 261 --browser=android-content-shell. Examine the stdio from the test invocation on |
| 262 the bots to see arguments to pass to src/content/test/gpu/run\_gpu\_test.py. | 262 the bots to see arguments to pass to src/content/test/gpu/run\_gpu\_test.py. |
| OLD | NEW |