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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
113 All functional tests are run using `build/android/test_runner.py`. | 113 All functional tests are run using `build/android/test_runner.py`. |
114 Tests are sharded across all attached devices. In order to run tests, call: | 114 Tests are sharded across all attached devices. In order to run tests, call: |
115 `build/android/test_runner.py <test_type> [options]` | 115 `build/android/test_runner.py <test_type> [options]` |
116 For a list of valid test types, see `test_runner.py --help`. For | 116 For a list of valid test types, see `test_runner.py --help`. For |
117 help on a specific test type, run `test_runner.py <test_type> --help`. | 117 help on a specific test type, run `test_runner.py <test_type> --help`. |
118 | 118 |
119 The commands used by the buildbots are printed in the logs. Look at | 119 The commands used by the buildbots are printed in the logs. Look at |
120 http://build.chromium.org/ to duplicate the same test command as a particular | 120 http://build.chromium.org/ to duplicate the same test command as a particular |
121 builder. | 121 builder. |
122 | 122 |
123 If you build in an output directory other than "out", you may have to tell | 123 If you build in an output directory other than "out", you may have to tell |
dgn
2015/10/26 10:12:05
nit: s/"out"/`out` and for a few other file names
| |
124 test\_runner.py where you place it. Say you build your android code in | 124 test\_runner.py where you place it. Say you build your android code in |
125 out\_android, then do `export CHROMIUM_OUT_DIR=out_android` before running the | 125 out\_android, then do `export CHROMIUM_OUT_DIR=out_android` before running the |
126 command below. You have to do this even if your "out" directory is a symlink | 126 command below. You have to do this even if your "out" directory is a symlink |
127 pointing to "out_android". | 127 pointing to "out_android". You can also use ```--output-directory``` to point |
128 to the path of your output directory, for example, | |
129 ```--output-directory=out_android/Debug```. | |
128 | 130 |
129 ## INSTALL\_FAILED\_CONTAINER\_ERROR or INSTALL\_FAILED\_INSUFFICIENT\_STORAGE | 131 ## INSTALL\_FAILED\_CONTAINER\_ERROR or INSTALL\_FAILED\_INSUFFICIENT\_STORAGE |
130 | 132 |
131 If you see this error when test\_runner.py is attempting to deploy the test | 133 If you see this error when test\_runner.py is attempting to deploy the test |
132 binaries to the AVD emulator, you may need to resize your userdata partition | 134 binaries to the AVD emulator, you may need to resize your userdata partition |
133 with the following commands: | 135 with the following commands: |
134 | 136 |
135 ```shell | 137 ```shell |
136 # Resize userdata partition to be 1G | 138 # Resize userdata partition to be 1G |
137 resize2fs android_emulator_sdk/sdk/system-images/android-19/x86/userdata.img 1G | 139 resize2fs android_emulator_sdk/sdk/system-images/android-19/x86/userdata.img 1G |
138 | 140 |
139 # Set filesystem parameter to continue on errors; Android doesn't like some | 141 # Set filesystem parameter to continue on errors; Android doesn't like some |
140 # things e2fsprogs does. | 142 # things e2fsprogs does. |
141 tune2fs -e continue android_emulator_sdk/sdk/system-images/android-19/x86/userda ta.img | 143 tune2fs -e continue android_emulator_sdk/sdk/system-images/android-19/x86/userda ta.img |
142 ``` | 144 ``` |
143 | 145 |
144 ## Symbolizing Crashes | 146 ## Symbolizing Crashes |
145 | 147 |
146 Crash stacks are logged and can be viewed using adb logcat. To symbolize the | 148 Crash stacks are logged and can be viewed using adb logcat. To symbolize the |
147 traces, pipe the output through | 149 traces, pipe the output through |
148 `third_party/android_platform/development/scripts/stack`. If you build in an | 150 `third_party/android_platform/development/scripts/stack`. If you build in an |
149 output directory other than "out", pass | 151 output directory other than "out", pass |
150 `--chrome-symbols-dir=out_directory/{Debug,Release}/lib` to the script as well. | 152 `--chrome-symbols-dir=out_directory/{Debug,Release}/lib` to the script as well. |
151 | 153 |
154 ## JUnit tests | |
155 | |
156 JUnit tests are Java unittests running on the host instead of the target device. | |
157 They are faster to run and therefore are recommended over instrumentation tests | |
158 when possible. | |
159 | |
160 The JUnits tests are usually following the pattern of *target*\_junit\_tests, | |
161 for example, ```content_junit_tests``` and ```chrome_junit_tests```. | |
162 | |
163 When adding a new JUnit test, the associated ```BUILD.gn``` file must be updated | |
164 . For example, adding a test to ```chrome_junit_tests``` requires to update | |
Bernhard Bauer
2015/10/23 15:20:21
Does this work, or do you get a space before the p
mlamouri (slow - plz ping)
2015/10/26 11:12:18
It works.
| |
165 ```chrome/android/BUILD.gn```. If you are a GYP user, you will not need to do | |
166 that step in order to run the test locally but it is still required for GN users | |
167 to run the test. | |
168 | |
169 ```shell | |
170 # Build the test suite. | |
171 ninja -C out/Release chrome_junit_tests | |
dgn
2015/10/26 10:12:05
Why do you demo it with a release build? Aren't we
mlamouri (slow - plz ping)
2015/10/26 11:12:18
Consistency with the rest of the documentation. We
| |
172 | |
173 # Run the test suite. | |
174 build/android/test_runner.py junit -s chrome_junit_tests --release -vvv | |
175 | |
176 # Run a subset of tests. You might need to pass the package name for some tests. | |
177 build/android/test_runner.py junit -s chrome_junit_tests --release -vvv | |
178 -f "org.chromium.chrome.browser.media.*" | |
179 ``` | |
180 | |
152 ## Gtests | 181 ## Gtests |
153 | 182 |
154 ```shell | 183 ```shell |
155 # Build a test suite | 184 # Build a test suite |
156 ninja -C out/Release content_unittests_apk | 185 ninja -C out/Release content_unittests_apk |
157 | 186 |
158 # Run a test suite | 187 # Run a test suite |
159 build/android/test_runner.py gtest -s content_unittests --release -vvv | 188 build/android/test_runner.py gtest -s content_unittests --release -vvv |
160 | 189 |
161 # Run a subset of tests | 190 # Run a subset of tests |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
255 See | 284 See |
256 https://sites.google.com/a/chromium.org/dev/developers/testing/webkit-layout-tes ts | 285 https://sites.google.com/a/chromium.org/dev/developers/testing/webkit-layout-tes ts |
257 | 286 |
258 ## Running GPU tests | 287 ## Running GPU tests |
259 | 288 |
260 (e.g. the "Android Debug (Nexus 7)" bot on the chromium.gpu waterfall) | 289 (e.g. the "Android Debug (Nexus 7)" bot on the chromium.gpu waterfall) |
261 | 290 |
262 See http://www.chromium.org/developers/testing/gpu-testing for details. Use | 291 See http://www.chromium.org/developers/testing/gpu-testing for details. Use |
263 --browser=android-content-shell. Examine the stdio from the test invocation on | 292 --browser=android-content-shell. Examine the stdio from the test invocation on |
264 the bots to see arguments to pass to src/content/test/gpu/run\_gpu\_test.py. | 293 the bots to see arguments to pass to src/content/test/gpu/run\_gpu\_test.py. |
OLD | NEW |