File: testing.md

package info (click to toggle)
chromium 73.0.3683.75-1~deb9u1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,792,156 kB
  • sloc: cpp: 13,473,466; ansic: 1,577,080; python: 898,539; javascript: 655,737; xml: 341,883; asm: 306,070; java: 289,969; perl: 80,911; objc: 67,198; sh: 43,184; cs: 27,853; makefile: 12,092; php: 11,064; yacc: 10,373; tcl: 8,875; ruby: 3,941; lex: 1,800; pascal: 1,473; lisp: 812; awk: 41; jsp: 39; sed: 19; sql: 3
file content (45 lines) | stat: -rw-r--r-- 1,410 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Automated testing for Chrome for iOS

See the [instructions] for how to check out and build Chromium for iOS.

Automated testing is a crucial part of ensuring the quality of Chromium.

## Unit testing

Unit testing is done via gtests. To run a unit test, simply run the test
target (ending in _unittest).

## Integration testing

[EarlGrey] is the integration testing framework used by Chromium for iOS.

### Running EarlGrey tests

EarlGrey tests are based on Apple's [XCUITest].

#### Running tests from Xcode

An entire suite of tests can be run from Xcode.
1. Select the *egtest target you wish to run.
2. ⌘+U to run all the tests. Note: ⌘+R, which is normally used to run an
application, will simply launch the app under test, but will not run the
XCTests.

A subset of tests can be run by selecting the test or test case from the
XCTest navigator on the left side of the screen.

#### Running from the command-line

When running from the command-line, it is required to pass in the *.xctest
target, in addition to the test application.
Example:
```
./out/Debug-iphonesimulator/iossim -d "iPad Retina" -s 8.1 \
out/Debug-iphonesimulator/ios_chrome_integration_egtests.app \
out/Debug-iphonesimulator/ios_chrome_integration_egtests_module.xctest
```


[EarlGrey]: https://github.com/google/EarlGrey
[instructions]: ./build_instructions.md
[XCUITest]: https://developer.apple.com/documentation/xctest