Testing is an essential component of software development in Chromium, it ensures Chrome is behaving as we expect, and is critical to find bugs and regressions at early stage.
This document covers the high level overview of testing in Chromium, including what type of tests we have, what's the purpose for each test type, what tests are needed for new features etc.
There are several different types of tests in Chromium to serve different purposes, some types of test are running on multiple platforms, others are specific for one platform.
content_shell
) and comparing the rendered output or JavaScript output against an expected output file. Web Tests are required to launch new W3C API support in Chromium.The following table shows which types of test works on which platforms.
Linux | Windows | Mac | Android | iOS | CrOS | |
---|---|---|---|---|---|---|
gtest(C++) | √ | √ | √ | √ | √ | √ |
Browser Tests(C++) | √ | √ | √ | √ | ||
Web Tests(HTML, JS) | √ | √ | √ | |||
Telemetry(Python) | √ | √ | √ | √ | √ | |
Robolectric(Java) | √ | |||||
Instrumentation Tests(Java) | √ | |||||
EarlGrey | √ | |||||
Fuzzer Tests(C++) | √ | √ | √ | √ | √ | |
Tast(Golang) | √ |
Browser Tests Note
Only subset of browser tests are enabled on Android:
Other browser tests are not supported on Android yet. crbug/611756 tracks the effort to enable them on Android.
Web Tests Note
Web Tests were enabled on Android K before, but it is disabled on Android platform now, see this thread for more context.
Tast Tests Note
Tast tests are written, maintained and gardened by ChromeOS engineers.
ChromeOS tests that Chrome engineers support should be (re)written in the following priority order:
When a Tast test fails:
Right now, code coverage is the only way we have to measure test coverage. The following is the recommended thresholds for different code coverage levels:
level 1(improving): >0%
level 2(acceptable): 60%
level 3(commendable): 75%
level 4(exemplary): 90%
Go to code coverage dashboard to check the code coverage for your project.
TODO: add the link to the instruction about how to enable new tests in CQ and main waterfall
Before you can run a gtest, you need to build the appropriate launcher target that contains your test, such as blink_unittests
:
autoninja -C out/Default blink_unittests
To run specific tests, rather than all tests in a launcher, pass --gtest_filter=
with a pattern. The simplest pattern is the full name of a test (SuiteOrFixtureName.TestName), but you can use wildcards:
out/Default/blink_unittests --gtest_filter='Foo*'
Use --help
for more ways to select and run tests.
TODO: add the link to the instruction about how to run tests on Swarming.
Go to LUCI Analysis to find reports about flaky tests in your projects.
If you cannot fix a flaky test in a short timeframe, disable it first to reduce development pain for other and then fix it later. “How do I disable a flaky test” has instructions on how to disable a flaky test.
Tests are not configured to upload metrics, such as UMA, UKM or crash reports.
什么叫变应性鼻炎 | 鸡精吃多了有什么危害 | 什么是历史虚无主义 | 敌人是什么意思 | 女以念什么 |
世上谁嫌男人丑的前一句是什么 | 猫来家里有什么预兆 | 没什么打什么 | 蔻驰香水属于什么档次 | 什么东西掉进水里不会湿 |
勃起不够硬吃什么药 | 什么情况下做胃镜 | 备注是什么意思 | 阴道里面有个肉球是什么 | 范冰冰和洪金宝什么关系 |
杰五行属性是什么 | 肚子拉稀吃什么药 | 拿铁咖啡什么意思 | 幼小衔接班是什么意思 | 生蚝有什么功效与作用 |
为什么人会死hcv7jop9ns0r.cn | 南瓜子吃多了有什么副作用hcv9jop3ns1r.cn | 北京为什么是首都hcv9jop1ns2r.cn | 愚不可及是什么意思hcv7jop9ns6r.cn | 皮牙子是什么意思hcv9jop5ns9r.cn |
妇科做活检是什么意思hcv8jop7ns0r.cn | 1月29日什么星座hcv9jop6ns3r.cn | 什么争什么斗hcv9jop5ns1r.cn | 什么是冰晶hcv8jop2ns8r.cn | 口腔脱皮是什么原因引起的hcv9jop4ns4r.cn |
股癣是什么样的adwl56.com | 桃子跟什么不能一起吃hcv9jop2ns9r.cn | 盐卤是什么hcv7jop9ns7r.cn | 卫衣是什么hcv8jop5ns7r.cn | 你想成为什么样的人sanhestory.com |
lively是什么意思hcv8jop8ns4r.cn | 垂线是什么hcv8jop9ns3r.cn | mg什么意思hcv7jop6ns4r.cn | 保安的职责是什么hcv8jop4ns4r.cn | 无花果不能和什么一起吃bfb118.com |