中国红是什么颜色| 银耳和雪耳有什么区别| 东莞有什么厂| 一对什么| 就此别过是什么意思| 什么叫菩提| 乌鸡炖什么好吃| 吃什么最补钙| tmc是什么意思| 女人梦到火是什么预兆| 雪莲果什么时候成熟| hiv是什么病毒| 米醋和白醋有什么区别| 心可舒治什么病| 昆仑雪菊有什么作用| 豆腐干炒什么好吃| 直捣黄龙是什么意思| 子宫薄是什么原因造成的| 次日是什么意思| 头发掉的严重是什么原因| 肠子有问题有什么症状| 下作是什么意思| 表水是什么意思| 腋毛上有白色附着物是什么| 综合内科是看什么病| 心绞痛吃什么药最管用| 荨麻疹用什么药膏| 心脏肥大吃什么药好| 互联网是干什么的| 头面是什么| 习是什么结构的字| 水煮肉片用什么肉| 鹞是什么意思| 什么是羊水栓塞| 女性前列腺叫什么| 甲鱼和什么不能一起吃| 12月份什么星座| 毛峰茶属于什么茶| vodka是什么酒| 乔顿男装属于什么档次| 眼睛痒用什么眼药水好| 心情沉重是什么意思| 姜枣茶什么时间喝最好| 89年是什么命| 八个月宝宝可以吃什么水果| 脚后跟疼痛是什么原因| 疾苦的疾是什么意思| 所向披靡是什么意思| 才美不外见的见是什么意思| 老人吃什么水果对身体好| 礼仪是什么意思| 一月25号是什么星座| 钓鱼执法什么意思| 暧昧什么意思| 尿胆原阳性是什么意思| 唐筛主要检查什么| obl是什么意思| 梦魇是什么原因造成的| 为什么喝茶会睡不着| 飞鸟集讲的是什么| 惋惜是什么意思| 牙龈爱出血是什么原因| k金是什么金| 吃猪肝有什么好处| 干眼症是什么| 1924年属什么生肖| 菠萝蜜和什么不能一起吃| 黄色裤子配什么上衣| 1956属什么生肖| 鼻子歪了是什么原因| 脚后跟疼是什么原因引起的| 孕晚期吃什么水果好| 胎停是什么原因造成的| 冰激凌和冰淇淋有什么区别| 和解少阳是什么意思| 鞭长莫及是什么意思| 吃糖醋蒜有什么好处和坏处| 手脱皮吃什么药| 尿潜血是什么原因造成的| 十八反是什么意思| 独角仙生活在什么地方| 乙状结肠管状腺瘤是什么意思| 锡纸什么牌子的好| 胃疼吃什么| 乌龟肺炎用什么药| 随心所欲的欲什么意思| 地贫是什么意思| 电梯房什么楼层最好| 阴毛的作用是什么| 招蚊子咬是什么血型| 鬼怕什么| value是什么意思| 蛋白粉什么时候喝最好| 小腿疼痛挂什么科| 打坐有什么好处| 九月十七是什么星座| 老心慌是什么原因| 间接胆红素偏高什么意思| 霉菌是什么引起的| 佳木斯二院全名叫什么| 浙江大学校长什么级别| 属马的生什么属相的宝宝好| 神经性皮炎吃什么药| cim是什么意思| 远视眼是什么意思| 县人大主任是什么级别| 咳嗽有痰吃什么药好得最快最有效| 乳腺3类是什么意思| 端午节应该吃什么| 蕊五行属什么| 07年属什么生肖| 月光石五行属什么| 做梦梦见火是什么征兆| 人乳头瘤病毒是什么病| 刚生完孩子可以吃什么水果| 知了幼虫叫什么| 8月29日什么星座| 刺梨什么时候成熟| 榴莲对孕妇有什么好处| 荷叶是什么的什么| hcr是什么意思| 38岁属什么生肖| 君子兰用什么土最好| 老年人爱出汗是什么原因| 小孩干咳吃什么药| 血压高有什么危害| 手癣用什么药膏| 腮腺炎挂什么科| 瘿瘤是什么意思| 胃疼为什么后背也疼| 布朗是什么水果| 眼睛胀痛是什么原因| 孕妇喝咖啡有什么危害| 试纸什么时候用最准确| 什么病不能吃豌豆| 亚麻籽吃了有什么好处| 贫血什么症状| 积聚病什么意思| 为什么喜欢| 什么病不能吃丝瓜| 世界上最坚硬的东西是什么| 为什么会下冰雹| 水是什么颜色| 真言是什么意思| 一什么鹿角| 皮肤脱皮是什么原因| 什么头什么臂| 化疗后吃什么药| 谷旦是什么意思| 手上起皮是什么原因| 大便很臭什么原因| 包公是什么生肖| 补骨脂是什么东西| 小蝌蚪吃什么| 单核细胞偏高是什么原因| 先明后不争什么意思| gi值是什么意思| dsa是什么意思| 十月十二号是什么星座| 63年属什么生肖| 睡觉腰疼是什么原因| 男性脾大是什么原因| 为什么白带是褐色的| 矢气是什么意思| 常见的贫血一般是缺什么| 妹控是什么意思| 1981年五行属什么| 软助什么意思| otg线是什么| 吃什么药升血小板最快| 正常是什么意思| 葫芦挂在家里什么位置好| 溜冰是什么意思| 岑读什么| 无期徒刑是什么意思| 为什么耳朵总是嗡嗡响| 什么是指标| 睾丸炎吃什么药| 什么的蜻蜓| 掉头发是身体缺少什么| 独角仙吃什么| 东南五行属什么| 胃溃疡a2期是什么意思| 耳鸣是什么原因导致的| 卵泡不破是什么原因| 风口浪尖是什么意思| 白肉是指什么肉| 再生聚酯纤维是什么面料| 胃病忌什么| 吃什么补心| 经常放屁是什么原因造成的| 肺部斑片状高密度影是什么意思| 改良剂是什么| 轮状胎盘是什么意思| 交是什么结构的字| 常吃木耳有什么好处和坏处| 吃六味地黄丸有什么好处| 为什么黑色吸热| 结婚30年是什么婚姻| 焖子是什么| 人的本性是什么| 高血钾有什么症状| 宫内早孕什么意思| 喝酒眼睛红是什么原因| 大便干吃什么药| 俄罗斯为什么要打乌克兰| 桑黄是什么| 长期熬夜会得什么病| 虚伪是什么意思| coo是什么| 生抽和老抽有什么区别| 中年男人遗精是什么原因| 吐司是什么意思| 两千年前是什么朝代| 孕妇用什么驱蚊最好| 两个土念什么| 武则天叫什么名字| apk是什么格式| 细小是什么| 杨贵妃属什么生肖| 宫颈是什么| 人类免疫缺陷病毒抗体是什么意思| crispi是什么牌子| 东方蝾螈吃什么| 什么是意境| 白茶和绿茶有什么区别| 蓝五行属什么| 肠澼是什么意思| 越字五行属什么| 5月25是什么星座| 趋是什么意思| 摧枯拉朽是什么意思| 6.8什么星座| 什么然什么放| 眩晕症是什么原因| 得偿所愿什么意思| 县局局长什么级别| 办身份证要穿什么衣服| 舌头麻是什么病的前兆| 什么是润年| 肉炒什么好吃| 沉香是什么| 多维元素片有什么作用| 常吃火龙果有什么好处| 背上长毛是什么原因引起的| 祎字五行属什么| 磨破皮了涂什么药| 中国信什么教| 蜱虫是什么| 早上起床咳嗽是什么原因| 屋后有坟有什么影响吗| 什么的云朵| 绮字五行属什么| 怀孕胎盘低有什么影响| 没腿毛的男人代表什么| 酋长是什么意思| 倍感欣慰是什么意思| 八月初六是什么星座| 女人吃什么补肾| 风寒感冒吃什么药最快| 吃什么帮助消化通便| 伺候是什么意思| 儿童嗓子疼吃什么药好| 2月2日什么星座| 百度

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.

Test Types

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.

  • gtest is Google's C++ test framework, which helps you write better C++ tests in Chromium. gtest is test framework for unit tests in Chromium and browser tests are built on top of it.
  • Browser Tests is built on top of gtest, and it is used to write integration tests and e2e tests in Chromium.
  • Web Tests (formerly known as “Layout Tests” or “LayoutTests”) is used by Blink to test many components, including but not limited to layout and rendering. In general, web tests involve loading pages in a test renderer (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.
  • Robolectric is build on top of JUnit 4. It emulates Android APIs so that tests can be run on the host machine instead of on devices / emulators.
  • Instrumentation Tests are JUnit tests that run on devices / emulators.
  • EarlGrey is the integration testing framework used by Chromium for iOS.
  • Telemetry is the performance testing framework used by Chromium. It allows you to perform arbitrary actions on a set of web pages and report metrics about it.
  • Fuzzer Tests is used to uncover potential security & stability problems in Chromium.
  • Tast is a test framework for system integration tests on Chrome OS.

The following table shows which types of test works on which platforms.

LinuxWindowsMacAndroidiOSCrOS
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:

  • components_browsertests
  • content_browsertests

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:

  • unit tests
  • linux_chromeos browser_tests
  • linux_chromeos interactive_ui_tests
  • Crosier tests

When a Tast test fails:

  • If the change is written by a ChromeOS engineer, the ChromeOS gardener can revert it.
  • Otherwise the ChromeOS gardener can revert the Chrome-authored change accompanied by a test from the supported frameworks above or manual repro steps that a Chrome engineer can run under linux_chromeos (preferable) or using Simple Chrome VM instructions.
  • If the above is not possible, the ChromeOS gardener or ChromeOS feature owner should inform the author about the failure, and the author uses their best judgment on whether to revert, fix on trunk, or let ChromeOS engineers update the test (e.g. if test needs an update or if the test is just testing internal implementation details of Chrome but doesn't break user functionality).

General Principles

  • All the tests in Chromium running on CQ and main waterfall should be hermetic and stable.
  • Add unit tests along with the code in same changelist instead of adding tests in future, it is most likely no one will add tests later.
  • Write enough unit tests to have good code coverage, since they are fast and stable.
  • Don't enable tests with external dependencies on CQ and main waterfall, e.g. tests against live sites. It is fine to check in those tests, but only run them on your own bots.
  • Eventually, all tests should implement the Test Executable API command line interface.

What tests are needed for new features

  • Unit Tests are needed no matter where the code is for your feature. It is the best practice to add the unit tests when you add new code or update existing code in the same changelist, check out Code Coverage in Gerrit for the instruction about how to see the code coverage in Gerrit.
  • Browser Tests are recommended for integration tests and e2e tests. It will be great if you add browser tests to cover the major user cases for your feature, even with some mocking.
  • Web Tests are required if you plan to launch new W3C APIs in Chrome.
  • Instrumentation Tests are recommended for features on Android, you only need to write instrumentation features if your feature is supported on Android for integration tests or e2e tests.
  • EarlGrey Tests are recommended for iOS only.
  • Telemetry benchmarking or stories are needed if existing telemetry benchmarks or stories can't cover the performance for your feature, you need to either add new story, but reuse existing metrics or add new benchmarks for your feature. Talk to benchmarking team first before start to add Telemetry benchmarks or stories.
  • Fuzzer Tests are recommended if your feature adds user facing APIs in Chromium, it is recommended to write fuzzer tests to detect the security issue.

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.

How to write new tests

TODO: add the link to the instruction about how to enable new tests in CQ and main waterfall

How to run tests

Run tests locally

Run gtest locally

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.

Run tests remotely(on Swarming)

TODO: add the link to the instruction about how to run tests on Swarming.

How to debug tests

How to deal with flaky tests

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.

Other

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
百度