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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 |
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 |
dgn
2015/10/22 18:09:23
I think triple backtick make a new paragraph. Did
mlamouri (slow - plz ping)
2015/10/23 13:20:10
No.
Bernhard Bauer
2015/10/23 15:20:21
But if you only want code markup, single backticks
dgn
2015/10/26 10:12:05
It would also be consistent with the code in the r
| |
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 | |
Bernhard Bauer
2015/10/22 16:19:12
Nit: JUnit (capital U) here and elsewhere.
mlamouri (slow - plz ping)
2015/10/23 13:20:10
Done.
| |
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 There are two junit test suites: ```content_junit_tests``` and | |
161 ```chrome_junit_tests```. | |
Bernhard Bauer
2015/10/22 16:19:12
There are more JUnit test suites than that, e.g. b
dgn
2015/10/22 18:09:23
I wish there was a unified junit target with all t
mlamouri (slow - plz ping)
2015/10/23 13:20:10
Changed to mention content_junit_tests and chrome_
| |
162 | |
163 When adding a new junit test, the associated ```BUILD.gn``` file need to be | |
164 updated. For ```chrome_junit_tests```, this is ```chrome/android/BUILD.gn``` and | |
165 for ```content_junit_tests```, this is ```content/public/android/BUILD.gn```. | |
166 | |
167 ```shell | |
168 # Build the test suite. | |
169 ninja -C out/Release content_junit_tests | |
170 ninja -C out/Release chrome_junit_tests | |
171 | |
172 # Run the test suite. | |
173 build/android/test_runner.py junit -s content_junit_tests --release -vvv | |
174 build/android/test_runner.py junit -s chrome_junit_tests --release -vvv | |
175 | |
176 # Run a subset of tests. Contrary to gtests and instrumentation tests, the | |
177 entire package name has to be used. | |
dgn
2015/10/22 18:09:23
Not true. This is working for me: net_junit_tests
mlamouri (slow - plz ping)
2015/10/23 13:20:10
Made the comment less assertive.
Bernhard Bauer
2015/10/23 15:20:21
I think the full package name is matched against t
| |
178 build/android/test_runner.py junit -s chrome_junit_tests --release -vvv | |
179 -f "org.chromium.chrome.browser.media.*" | |
180 ``` | |
181 | |
152 ## Gtests | 182 ## Gtests |
153 | 183 |
154 ```shell | 184 ```shell |
155 # Build a test suite | 185 # Build a test suite |
156 ninja -C out/Release content_unittests_apk | 186 ninja -C out/Release content_unittests_apk |
157 | 187 |
158 # Run a test suite | 188 # Run a test suite |
159 build/android/test_runner.py gtest -s content_unittests --release -vvv | 189 build/android/test_runner.py gtest -s content_unittests --release -vvv |
160 | 190 |
161 # Run a subset of tests | 191 # Run a subset of tests |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
255 See | 285 See |
256 https://sites.google.com/a/chromium.org/dev/developers/testing/webkit-layout-tes ts | 286 https://sites.google.com/a/chromium.org/dev/developers/testing/webkit-layout-tes ts |
257 | 287 |
258 ## Running GPU tests | 288 ## Running GPU tests |
259 | 289 |
260 (e.g. the "Android Debug (Nexus 7)" bot on the chromium.gpu waterfall) | 290 (e.g. the "Android Debug (Nexus 7)" bot on the chromium.gpu waterfall) |
261 | 291 |
262 See http://www.chromium.org/developers/testing/gpu-testing for details. Use | 292 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 | 293 --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. | 294 the bots to see arguments to pass to src/content/test/gpu/run\_gpu\_test.py. |
OLD | NEW |