| Name | Date | Size | #Lines | LOC | ||
|---|---|---|---|---|---|---|
| .. | - | - | ||||
| README.md | D | 03-May-2024 | 3 KiB | 36 | 30 | |
| android_test_instructions.md | D | 03-May-2024 | 10.1 KiB | 313 | 218 | |
| components_for_testing.md | D | 03-May-2024 | 6.3 KiB | 163 | 130 | |
| gtest_implementation.md | D | 03-May-2024 | 7.3 KiB | 133 | 109 | |
| instrumentation.md | D | 03-May-2024 | 12.3 KiB | 293 | 231 | |
| junit.md | D | 03-May-2024 | 4.5 KiB | 150 | 105 | |
| junit4.md | D | 03-May-2024 | 11.2 KiB | 288 | 232 | |
| todo.md | D | 03-May-2024 | 253 | 6 | 4 |
README.md
1# Android Testing in Chromium 2 3## Concepts 4 - **Native Unit Tests**: Normal Chromium unit tests based on the [gtest framework](/testing/android/docs/gtest_implementation.md). Tests for native code. 5 - **Java Unit Tests**: JUnit tests that run on the host machine using [Robolectric](http://robolectric.org) to emulate Android APIs. 6 - **Instrumentation Tests**: JUnit tests that run on Android devices (or emulators). 7 - **Unit Instrumentation Tests**: Instrumentation tests that test an individual feature. They do not require starting up ContentShell (or Chrome browser). These use [BaseActivityTestRule](https://source.chromium.org/chromium/chromium/src/+/main:base/test/android/javatests/src/org/chromium/base/test/BaseActivityTestRule.java) or [BlankUiTestActivityTestCase](https://source.chromium.org/chromium/chromium/src/+/main:ui/android/javatests/src/org/chromium/ui/test/util/BlankUiTestActivityTestCase.java) based on `BaseActivityTestRule`. 8 - **Integration Instrumentation Tests**: Instrumentation tests that bring up ContentShell (or Chrome browser) to test a certain feature in the end-to-end flow. These typically use more specialized test rules such as [ContentShellActivityTestRule](https://source.chromium.org/chromium/chromium/src/+/main:content/shell/android/javatests/src/org/chromium/content_shell_apk/ContentShellActivityTestRule.java) or [ChromeActivityTestRule](https://source.chromium.org/chromium/chromium/src/+/main:chrome/test/android/javatests/src/org/chromium/chrome/test/ChromeActivityTestRule.java). 9 10## How do I... 11 12 - **set up** 13 - [... set up a device for local testing?](/testing/android/docs/android_test_instructions.md#physical-device-setup) 14 - [... set up an emulator for local testing?](/docs/android_emulator.md) 15 - **writing tests** 16 - [... write an instrumentation test?](/testing/android/docs/instrumentation.md) 17 - [... write a JUnit or Robolectric test?](/testing/android/docs/junit.md) 18 - [... write a test that needs to mock native calls?](/base/android/jni_generator/README.md#testing-mockable-natives) 19 - **running tests** 20 - [... run a gtest?](/testing/android/docs/android_test_instructions.md#gtests) 21 - [... run an instrumentation test?](/testing/android/docs/android_test_instructions.md#instrumentation-tests) 22 - [... run a JUnit test?](/testing/android/docs/android_test_instructions.md#junit-tests) 23 - [... run the Web tests?](/docs/testing/web_tests.md) 24 - [... run a telemetry test?](https://chromium.googlesource.com/catapult/+/HEAD/telemetry/README.md) 25 - **debugging tests** 26 - [... debug junit tests?](/testing/android/docs/android_test_instructions.md#junit-tests-debugging) 27 - [... debug flaky tests?](/testing/android/docs/todo.md) 28 - **miscellaneous** 29 - [... use code coverage for Java tests?](/build/android/docs/coverage.md) 30 31## How does it work on Android? 32 33 - [gtests](/testing/android/docs/gtest_implementation.md) 34 - [instrumentation tests](https://source.android.com/compatibility/tests/development/instrumentation) 35 - [junit tests](/testing/android/docs/junit.md) 36