andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 1 | # Android Test Instructions |
| 2 | |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 3 | [TOC] |
| 4 | |
jbudorick | 25c1738 | 2016-08-03 18:53:07 | [diff] [blame] | 5 | ## Device Setup |
| 6 | |
| 7 | ### Physical Device Setup |
| 8 | |
| 9 | #### ADB Debugging |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 10 | |
Andrew Grieve | b747e71 | 2017-11-23 16:58:31 | [diff] [blame] | 11 | The adb executable exists within the Android SDK: |
| 12 | |
| 13 | ```shell |
| 14 | third_party/android_tools/sdk/platform-tools/adb |
| 15 | ``` |
| 16 | |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 17 | In order to allow the ADB to connect to the device, you must enable USB |
| 18 | debugging: |
andybons | 22afb31 | 2015-08-31 02:24:51 | [diff] [blame] | 19 | |
| 20 | * Before Android 4.1 (Jelly Bean): |
| 21 | * Go to "System Settings" |
| 22 | * Go to "Developer options" |
| 23 | * Check "USB debugging". |
| 24 | * Un-check "Verify apps over USB". |
ntfschr | 09699f44 | 2017-01-12 22:20:46 | [diff] [blame] | 25 | * On Jelly Bean and above, developer options are hidden by default. To unhide |
| 26 | them: |
andybons | 22afb31 | 2015-08-31 02:24:51 | [diff] [blame] | 27 | * Go to "About phone" |
| 28 | * Tap 10 times on "Build number" |
| 29 | * The "Developer options" menu will now be available. |
| 30 | * Check "USB debugging". |
| 31 | * Un-check "Verify apps over USB". |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 32 | |
jbudorick | 25c1738 | 2016-08-03 18:53:07 | [diff] [blame] | 33 | #### Screen |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 34 | |
ntfschr | 09699f44 | 2017-01-12 22:20:46 | [diff] [blame] | 35 | You **must** ensure that the screen stays on while testing: `adb shell svc power |
| 36 | stayon usb` Or do this manually on the device: Settings -> Developer options -> |
| 37 | Stay Awake. |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 38 | |
| 39 | If this option is greyed out, stay awake is probably disabled by policy. In that |
| 40 | case, get another device or log in with a normal, unmanaged account (because the |
| 41 | tests will break in exciting ways if stay awake is off). |
| 42 | |
jbudorick | 25c1738 | 2016-08-03 18:53:07 | [diff] [blame] | 43 | #### Disable Verify Apps |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 44 | |
ntfschr | 09699f44 | 2017-01-12 22:20:46 | [diff] [blame] | 45 | You may see a dialog like [this |
| 46 | one](http://www.samsungmobileusa.com/simulators/ATT_GalaxyMega/mobile/screens/06-02_12.jpg), |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 47 | which states, _Google may regularly check installed apps for potentially harmful |
| 48 | behavior._ This can interfere with the test runner. To disable this dialog, run: |
ntfschr | 09699f44 | 2017-01-12 22:20:46 | [diff] [blame] | 49 | |
| 50 | ``` |
| 51 | adb shell settings put global package_verifier_enable 0 |
| 52 | ``` |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 53 | |
Anthony Berent | 8d3ce02 | 2018-01-15 12:24:36 | [diff] [blame] | 54 | ### Using Emulators |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 55 | |
Anthony Berent | 8d3ce02 | 2018-01-15 12:24:36 | [diff] [blame] | 56 | #### Building for emulation |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 57 | |
Anthony Berent | 8d3ce02 | 2018-01-15 12:24:36 | [diff] [blame] | 58 | The fast Android emulators use the X86 instruction set, so anything run on such |
| 59 | an emulator has to be built for X86. Add |
| 60 | ``` |
| 61 | target_cpu = "x86" |
| 62 | ``` |
| 63 | to your args.gn file. You may want use different out directories for your X86 |
| 64 | and ARM builds. |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 65 | |
Anthony Berent | 8d3ce02 | 2018-01-15 12:24:36 | [diff] [blame] | 66 | #### Setting up your workstation |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 67 | |
Anthony Berent | 8d3ce02 | 2018-01-15 12:24:36 | [diff] [blame] | 68 | The Android emulators support VM acceleration. This, however, needs to be |
| 69 | enabled on your workstation, as described in |
| 70 | https://developer.android.com/studio/run/emulator-acceleration.html#accel-vm. |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 71 | |
Anthony Berent | 8d3ce02 | 2018-01-15 12:24:36 | [diff] [blame] | 72 | #### Creating and running emulators from Android Studio |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 73 | |
Anthony Berent | 8d3ce02 | 2018-01-15 12:24:36 | [diff] [blame] | 74 | The easiest way to create and run an emulator is to use Android Studio's |
| 75 | Virtual Device Manager. See |
| 76 | https://developer.android.com/studio/run/managing-avds.html. |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 77 | |
Anthony Berent | 8d3ce02 | 2018-01-15 12:24:36 | [diff] [blame] | 78 | Creating emulators in Android Studio will modify the current SDK. If you are |
| 79 | using the project's SDK then this can cause problems the next time you sync |
| 80 | the project, so it is normally better to use a different SDK root when |
| 81 | creating emulators. You can set this up either by creating the Android Studio |
| 82 | project using generate_gradle.py's --sdk or --sdk-path options or by |
| 83 | changing the SDK location within AndroidStudio's settings. |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 84 | |
Anthony Berent | 8d3ce02 | 2018-01-15 12:24:36 | [diff] [blame] | 85 | #### Starting an emulator from the command line |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 86 | |
Anthony Berent | 8d3ce02 | 2018-01-15 12:24:36 | [diff] [blame] | 87 | Once you have created an emulator (using Android Studio or otherwise) you can |
| 88 | start it from the command line using the |
| 89 | [emulator](https://developer.android.com/studio/run/emulator-commandline.html) |
| 90 | command: |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 91 | |
Anthony Berent | 8d3ce02 | 2018-01-15 12:24:36 | [diff] [blame] | 92 | ``` |
| 93 | {$ANDROID_SDK_ROOT}/tools/emulator @emulatorName |
| 94 | ``` |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 95 | |
Anthony Berent | 8d3ce02 | 2018-01-15 12:24:36 | [diff] [blame] | 96 | where emulatorName is the name of the emulator you want to start (e.g. |
| 97 | Nexus_5X_API_27). The command |
| 98 | |
| 99 | ``` |
| 100 | {$ANDROID_SDK_ROOT}/tools/emulator -list-avds |
| 101 | ``` |
| 102 | |
| 103 | will list the available emulators. |
| 104 | |
| 105 | #### Creating an emulator from the command line |
| 106 | |
| 107 | New emulators can be created from the command line using the |
| 108 | [avdmanager](https://developer.android.com/studio/command-line/avdmanager.html) |
| 109 | command. This, however, does not provide any way of creating new device types, |
| 110 | and provides far fewer options than the Android Studio UI for creating new |
| 111 | emulators. |
| 112 | |
| 113 | The device types are configured through a devices.xml file. The devices.xml |
| 114 | file for standard device types are within Android Studio's install, and that |
| 115 | for any additional devices you define are in $ANDROID_EMULATOR_HOME (defaulting |
| 116 | to ~/.android/). The contents of devices.xml is, however, undocumented (and |
| 117 | presumably subject to change), so this is best modified using Android Studio. |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 118 | |
| 119 | ## Building Tests |
| 120 | |
jbudorick | 25c1738 | 2016-08-03 18:53:07 | [diff] [blame] | 121 | If you're adding a new test file, you'll need to explicitly add it to a gn |
ntfschr | 09699f44 | 2017-01-12 22:20:46 | [diff] [blame] | 122 | target. If you're adding a test to an existing file, you won't need to make gn |
jbudorick | 25c1738 | 2016-08-03 18:53:07 | [diff] [blame] | 123 | changes, but you may be interested in where your test winds up. In either case, |
| 124 | here are some guidelines for where a test belongs: |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 125 | |
jbudorick | 25c1738 | 2016-08-03 18:53:07 | [diff] [blame] | 126 | ### C++ |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 127 | |
jbudorick | 25c1738 | 2016-08-03 18:53:07 | [diff] [blame] | 128 | C++ test files typically belong in `<top-level directory>_unittests` (e.g. |
| 129 | `base_unittests` for `//base`). There are a few exceptions -- browser tests are |
| 130 | typically their own target (e.g. `content_browsertests` for `//content`, or |
| 131 | `browser_tests` for `//chrome`), and some unit test suites are broken at the |
| 132 | second directory rather than the top-level one. |
| 133 | |
| 134 | ### Java |
| 135 | |
| 136 | Java test files vary a bit more widely than their C++ counterparts: |
| 137 | |
ntfschr | 09699f44 | 2017-01-12 22:20:46 | [diff] [blame] | 138 | - Instrumentation test files -- i.e., tests that will run on a device -- |
| 139 | typically belong in either `<top-level directory>_javatests` or `<top-level |
| 140 | directory>_test_java`. Regardless, they'll wind up getting packaged into one |
| 141 | of a few test APKs: |
ctzsm | 34f54d6 | 2017-04-21 17:04:07 | [diff] [blame] | 142 | - `webview_instrumentation_test_apk` for anything in `//android_webview` |
ntfschr | 09699f44 | 2017-01-12 22:20:46 | [diff] [blame] | 143 | - `content_shell_test_apk` for anything in `//content` or below |
| 144 | - `chrome_public_test_apk` for most things in `//chrome` |
| 145 | - `chrome_sync_shell_test_apk` in a few exceptional cases |
| 146 | - JUnit or Robolectric test files -- i.e., tests that will run on the host -- |
| 147 | typically belong in `<top-level directory>_junit_tests` (e.g. |
| 148 | `base_junit_tests` for `//base`), though here again there are cases |
| 149 | (particularly in `//components`) where suites are split at the second |
| 150 | directory rather than the top-level one. |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 151 | |
| 152 | Once you know what to build, just do it like you normally would build anything |
newt | 17e4d24 | 2015-08-27 09:07:26 | [diff] [blame] | 153 | else, e.g.: `ninja -C out/Release chrome_public_test_apk` |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 154 | |
| 155 | ## Running Tests |
| 156 | |
jbudorick | 25c1738 | 2016-08-03 18:53:07 | [diff] [blame] | 157 | All functional tests should be runnable via the wrapper scripts generated at |
| 158 | build time: |
| 159 | |
| 160 | ```sh |
| 161 | <output directory>/bin/run_<target_name> [options] |
| 162 | ``` |
| 163 | |
| 164 | Note that tests are sharded across all attached devices unless explicitly told |
| 165 | to do otherwise by `-d/--device`. |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 166 | |
| 167 | The commands used by the buildbots are printed in the logs. Look at |
xiaoyin.l | 1003c0b | 2016-12-06 02:51:17 | [diff] [blame] | 168 | https://build.chromium.org/ to duplicate the same test command as a particular |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 169 | builder. |
| 170 | |
jbudorick | 25c1738 | 2016-08-03 18:53:07 | [diff] [blame] | 171 | ### INSTALL\_FAILED\_CONTAINER\_ERROR or INSTALL\_FAILED\_INSUFFICIENT\_STORAGE |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 172 | |
jbudorick | 25c1738 | 2016-08-03 18:53:07 | [diff] [blame] | 173 | If you see this error when the test runner is attempting to deploy the test |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 174 | binaries to the AVD emulator, you may need to resize your userdata partition |
| 175 | with the following commands: |
| 176 | |
| 177 | ```shell |
davve | 7ae32cd | 2015-09-22 06:54:09 | [diff] [blame] | 178 | # Resize userdata partition to be 1G |
mikecase | 7c26305 | 2017-03-30 23:46:11 | [diff] [blame] | 179 | resize2fs android_emulator_sdk/sdk/system-images/android-25/x86/userdata.img 1G |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 180 | |
| 181 | # Set filesystem parameter to continue on errors; Android doesn't like some |
| 182 | # things e2fsprogs does. |
mikecase | 7c26305 | 2017-03-30 23:46:11 | [diff] [blame] | 183 | tune2fs -e continue android_emulator_sdk/sdk/system-images/android-25/x86/userdata.img |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 184 | ``` |
| 185 | |
| 186 | ## Symbolizing Crashes |
| 187 | |
ntfschr | 09699f44 | 2017-01-12 22:20:46 | [diff] [blame] | 188 | Crash stacks are logged and can be viewed using `adb logcat`. To symbolize the |
jyasskin | c1c76ff | 2015-12-18 21:39:52 | [diff] [blame] | 189 | traces, define `CHROMIUM_OUTPUT_DIR=$OUTDIR` where `$OUTDIR` is the argument you |
| 190 | pass to `ninja -C`, and pipe the output through |
| 191 | `third_party/android_platform/development/scripts/stack`. If |
| 192 | `$CHROMIUM_OUTPUT_DIR` is unset, the script will search `out/Debug` and |
| 193 | `out/Release`. For example: |
| 194 | |
| 195 | ```shell |
| 196 | # If you build with |
| 197 | ninja -C out/Debug chrome_public_test_apk |
| 198 | # You can run: |
| 199 | adb logcat -d | third_party/android_platform/development/scripts/stack |
| 200 | |
| 201 | # If you build with |
| 202 | ninja -C out/android chrome_public_test_apk |
| 203 | # You can run: |
| 204 | adb logcat -d | CHROMIUM_OUTPUT_DIR=out/android third_party/android_platform/development/scripts/stack |
| 205 | # or |
| 206 | export CHROMIUM_OUTPUT_DIR=out/android |
| 207 | adb logcat -d | third_party/android_platform/development/scripts/stack |
| 208 | ``` |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 209 | |
mlamouri | 0fbd6cd | 2015-10-26 12:08:11 | [diff] [blame] | 210 | ## JUnit tests |
| 211 | |
| 212 | JUnit tests are Java unittests running on the host instead of the target device. |
| 213 | They are faster to run and therefore are recommended over instrumentation tests |
| 214 | when possible. |
| 215 | |
| 216 | The JUnits tests are usually following the pattern of *target*\_junit\_tests, |
| 217 | for example, `content_junit_tests` and `chrome_junit_tests`. |
| 218 | |
| 219 | When adding a new JUnit test, the associated `BUILD.gn` file must be updated. |
| 220 | For example, adding a test to `chrome_junit_tests` requires to update |
| 221 | `chrome/android/BUILD.gn`. If you are a GYP user, you will not need to do that |
| 222 | step in order to run the test locally but it is still required for GN users to |
| 223 | run the test. |
| 224 | |
| 225 | ```shell |
| 226 | # Build the test suite. |
Andrew Grieve | 4fe9974 | 2017-11-23 19:43:16 | [diff] [blame] | 227 | ninja -C out/Default chrome_junit_tests |
mlamouri | 0fbd6cd | 2015-10-26 12:08:11 | [diff] [blame] | 228 | |
| 229 | # Run the test suite. |
Andrew Grieve | 4fe9974 | 2017-11-23 19:43:16 | [diff] [blame] | 230 | out/Default/run_chrome_junit_tests |
mlamouri | 0fbd6cd | 2015-10-26 12:08:11 | [diff] [blame] | 231 | |
| 232 | # Run a subset of tests. You might need to pass the package name for some tests. |
Andrew Grieve | 4fe9974 | 2017-11-23 19:43:16 | [diff] [blame] | 233 | out/Default/run_chrome_junit_tests -f "org.chromium.chrome.browser.media.*" |
| 234 | ``` |
| 235 | |
| 236 | ### Debugging |
| 237 | |
| 238 | Similar to [debugging apk targets](android_debugging_instructions.md#debugging-java): |
| 239 | |
| 240 | ```shell |
| 241 | out/Default/bin/run_chrome_junit_tests --wait-for-java-debugger |
| 242 | out/Default/bin/run_chrome_junit_tests --wait-for-java-debugger # Specify custom port via --debug-socket=9999 |
mlamouri | 0fbd6cd | 2015-10-26 12:08:11 | [diff] [blame] | 243 | ``` |
| 244 | |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 245 | ## Gtests |
| 246 | |
| 247 | ```shell |
| 248 | # Build a test suite |
jbudorick | 25c1738 | 2016-08-03 18:53:07 | [diff] [blame] | 249 | ninja -C out/Release content_unittests |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 250 | |
| 251 | # Run a test suite |
jbudorick | 9472f11 | 2016-01-27 16:21:56 | [diff] [blame] | 252 | out/Release/bin/run_content_unittests [-vv] |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 253 | |
| 254 | # Run a subset of tests |
jbudorick | 9472f11 | 2016-01-27 16:21:56 | [diff] [blame] | 255 | out/Release/bin/run_content_unittests [-vv] --gtest-filter ByteStreamTest.* |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 256 | ``` |
| 257 | |
| 258 | ## Instrumentation Tests |
| 259 | |
| 260 | In order to run instrumentation tests, you must leave your device screen ON and |
| 261 | UNLOCKED. Otherwise, the test will timeout trying to launch an intent. |
| 262 | Optionally you can disable screen lock under Settings -> Security -> Screen Lock |
| 263 | -> None. |
| 264 | |
jbudorick | 9472f11 | 2016-01-27 16:21:56 | [diff] [blame] | 265 | Next, you need to build the app, build your tests, and then run your tests |
| 266 | (which will install the APK under test and the test APK automatically). |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 267 | |
| 268 | Examples: |
| 269 | |
| 270 | ContentShell tests: |
| 271 | |
| 272 | ```shell |
| 273 | # Build the code under test |
| 274 | ninja -C out/Release content_shell_apk |
| 275 | |
| 276 | # Build the tests themselves |
| 277 | ninja -C out/Release content_shell_test_apk |
| 278 | |
jbudorick | 9472f11 | 2016-01-27 16:21:56 | [diff] [blame] | 279 | # Run the test (will automagically install the APK under test and the test APK) |
| 280 | out/Release/bin/run_content_shell_test_apk [-vv] |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 281 | ``` |
| 282 | |
newt | 17e4d24 | 2015-08-27 09:07:26 | [diff] [blame] | 283 | ChromePublic tests: |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 284 | |
| 285 | ```shell |
| 286 | # Build the code under test |
newt | 17e4d24 | 2015-08-27 09:07:26 | [diff] [blame] | 287 | ninja -C out/Release chrome_public_apk |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 288 | |
| 289 | # Build the tests themselves |
newt | 17e4d24 | 2015-08-27 09:07:26 | [diff] [blame] | 290 | ninja -C out/Release chrome_public_test_apk |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 291 | |
jbudorick | 9472f11 | 2016-01-27 16:21:56 | [diff] [blame] | 292 | # Run the test (will automagically install the APK under test and the test APK) |
| 293 | out/Release/bin/run_chrome_public_test_apk [-vv] |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 294 | ``` |
| 295 | |
| 296 | AndroidWebView tests: |
| 297 | |
| 298 | ```shell |
ctzsm | 34f54d6 | 2017-04-21 17:04:07 | [diff] [blame] | 299 | ninja -C out/Release webview_instrumentation_apk |
| 300 | ninja -C out/Release webview_instrumentation_test_apk |
| 301 | out/Release/bin/run_webview_instrumentation_test_apk [-vv] |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 302 | ``` |
| 303 | |
ntfschr | 09699f44 | 2017-01-12 22:20:46 | [diff] [blame] | 304 | In order to run a subset of tests, use -f to filter based on test class/method |
| 305 | or -A/-E to filter using annotations. |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 306 | |
| 307 | Filtering examples: |
| 308 | |
| 309 | ```shell |
| 310 | # Run a test suite |
jbudorick | 9472f11 | 2016-01-27 16:21:56 | [diff] [blame] | 311 | out/Debug/bin/run_content_shell_test_apk |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 312 | |
| 313 | # Run a specific test class |
jbudorick | 9472f11 | 2016-01-27 16:21:56 | [diff] [blame] | 314 | out/Debug/bin/run_content_shell_test_apk -f AddressDetectionTest.* |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 315 | |
| 316 | # Run a specific test method |
jbudorick | 9472f11 | 2016-01-27 16:21:56 | [diff] [blame] | 317 | out/Debug/bin/run_content_shell_test_apk -f \ |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 318 | AddressDetectionTest#testAddressLimits |
| 319 | |
| 320 | # Run a subset of tests by size (Smoke, SmallTest, MediumTest, LargeTest, |
| 321 | # EnormousTest) |
jbudorick | 9472f11 | 2016-01-27 16:21:56 | [diff] [blame] | 322 | out/Debug/bin/run_content_shell_test_apk -A Smoke |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 323 | |
| 324 | # Run a subset of tests by annotation, such as filtering by Feature |
jbudorick | 9472f11 | 2016-01-27 16:21:56 | [diff] [blame] | 325 | out/Debug/bin/run_content_shell_test_apk -A Feature=Navigation |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 326 | ``` |
| 327 | |
| 328 | You might want to add stars `*` to each as a regular expression, e.g. |
| 329 | `*`AddressDetectionTest`*` |
| 330 | |
Andrew Grieve | 4fe9974 | 2017-11-23 19:43:16 | [diff] [blame] | 331 | ### Debugging |
| 332 | |
| 333 | Similar to [debugging apk targets](android_debugging_instructions.md#debugging-java): |
| 334 | |
| 335 | ```shell |
| 336 | out/Debug/bin/run_content_shell_test_apk --wait-for-java-debugger |
| 337 | ``` |
| 338 | |
| 339 | ### Deobfuscating Java Stacktraces |
| 340 | |
| 341 | If running with `is_debug=false`, Java stacks from logcat need to be fixed up: |
| 342 | |
| 343 | ```shell |
| 344 | out/Release/bin/java_deobfuscate out/Release/apks/ChromePublicTest.apk.mapping < stacktrace.txt |
| 345 | ``` |
| 346 | |
| 347 | Any stacks produced by test runner output will already be deobfuscated. |
| 348 | |
| 349 | |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 350 | ## Running Blink Layout Tests |
| 351 | |
qyearsley | ac3af53 | 2016-11-16 22:07:32 | [diff] [blame] | 352 | See [Layout Tests](testing/layout_tests.md). |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 353 | |
| 354 | ## Running GPU tests |
| 355 | |
| 356 | (e.g. the "Android Debug (Nexus 7)" bot on the chromium.gpu waterfall) |
| 357 | |
xiaoyin.l | 1003c0b | 2016-12-06 02:51:17 | [diff] [blame] | 358 | See https://www.chromium.org/developers/testing/gpu-testing for details. Use |
jbudorick | 25c1738 | 2016-08-03 18:53:07 | [diff] [blame] | 359 | `--browser=android-content-shell`. Examine the stdio from the test invocation on |
| 360 | the bots to see arguments to pass to `src/content/test/gpu/run_gpu_test.py`. |