Docs: Changes to source.android.com
- 230969164 Add details about supported deviceless tests by Android Partner Docs <[email protected]>
- 230954177 Devsite localized content from translation request 1089952. by Android Partner Docs <[email protected]>
- 230924636 Devsite localized content from translation request 1092604. by Android Partner Docs <[email protected]>
- 230924621 Devsite localized content from translation request 1091268. by Android Partner Docs <[email protected]>
- 230811847 Please review this new content for "Automotive Power Mana... by Janet Davies <[email protected]>
- 230794111 Add HWASan to the docs ready for bootcamp. by Android Partner Docs <[email protected]>
- 230779068 Link to NDK docs on DAC from first reference to Make by Android Partner Docs <[email protected]>
- 230744983 Devsite localized content from translation request 1092191. by Android Partner Docs <[email protected]>
- 230744981 Devsite localized content from translation request 1093422. by Android Partner Docs <[email protected]>
- 230744964 Devsite localized content from translation request 1094193. by Android Partner Docs <[email protected]>
- 230742820 Moving Marshmallow 6.0 to No Release Planned as CTS 6.0 w... by Android Partner Docs <[email protected]>
- 230614628 Fixed broken links (they were relative and not absolute f... by Christina Nguyen <[email protected]>
- 230384953 Remove rogue parenthesis by Danielle Roberts <[email protected]>
- 230375898 Fix broken links to subpages with absolute paths by Android Partner Docs <[email protected]>
- 230364707 Devsite localized content from translation request 1093572. by Android Partner Docs <[email protected]>
- 230364690 Devsite localized content from translation request 1093439. by Android Partner Docs <[email protected]>
- 230364619 Devsite localized content from translation request 1089936. by Android Partner Docs <[email protected]>
- 230364605 Devsite localized content from translation request 1086836. by Android Partner Docs <[email protected]>
- 230364588 Devsite localized content from translation request 1093713. by Android Partner Docs <[email protected]>
- 230364494 Devsite localized content from translation request 1093448. by Android Partner Docs <[email protected]>
- 230364465 Devsite localized content from translation request 1091295. by Android Partner Docs <[email protected]>
- 230364454 Devsite localized content from translation request 1092609. by Android Partner Docs <[email protected]>
- 230364368 Devsite localized content from translation request 1048174. by Android Partner Docs <[email protected]>
- 230364354 Devsite localized content from translation request 1047598. by Android Partner Docs <[email protected]>
- 230364346 Devsite localized content from translation request 1089969. by Android Partner Docs <[email protected]>
- 230020584 Update the guide for using vendor provided bcc by Android Partner Docs <[email protected]>
- 229999258 Fix a typo in gsi.html by Android Partner Docs <[email protected]>
- 229997798 Add file_patterns attribute documentation by Android Partner Docs <[email protected]>
- 229991256 Update the characters for zh-cn and zh-tw in the Security... by Danielle Roberts <[email protected]>
- 229977174 Moving time zones to Updates (from Permissions); also upd... by Heidi von Markham <[email protected]>
- 229831729 Devsite localized content from translation request 1090171. by Android Partner Docs <[email protected]>
- 229831714 Devsite localized content from translation request 1090622. by Android Partner Docs <[email protected]>
- 229831667 Devsite localized content from translation request 1015775. by Android Partner Docs <[email protected]>
- 229831656 Devsite localized content from translation request 1088392. by Android Partner Docs <[email protected]>
- 229831644 Devsite localized content from translation request 1090166. by Android Partner Docs <[email protected]>
- 229581198 Devsite localized content from translation request 1086821. by Android Partner Docs <[email protected]>
- 229425689 Fixing typos for Shutdown (to shutdown) by Heidi von Markham <[email protected]>
- 229416134 Update a paragraph in the permission model section of the... by Luke Haviland <[email protected]>
- 229402835 Devsite localized content from translation request 553155. by Android Partner Docs <[email protected]>
- 229305053 Devsite localized content from translation request 1091266. by Android Partner Docs <[email protected]>
- 229305046 Devsite localized content from translation request 1091273. by Android Partner Docs <[email protected]>
- 229245843 Devsite localized content from translation request 1015221. by Android Partner Docs <[email protected]>
- 228916961 Fix typo by Kenneth Lau <[email protected]>
- 228796242 Change "Optional" to "Required" by Kenneth Lau <[email protected]>
- 228720589 Devsite localized content from translation request 1090636. by Android Partner Docs <[email protected]>
- 228612958 Added Joshua Laney's information to November security ack... by Luke Haviland <[email protected]>
- 228585561 Update versions file by Kenneth Lau <[email protected]>
- 228557861 Devsite localized content from translation request 1089965. by Android Partner Docs <[email protected]>
- 228541590 Fix HTML. by Android Partner Docs <[email protected]>
- 228525372 Replace unresolved variable reference in localized files. by Android Partner Docs <[email protected]>
- 228439111 Add missing < by Android Partner Docs <[email protected]>
- 228436522 Adding the January Android bulletin acknowledgements by Luke Haviland <[email protected]>
- 228407590 Correct the naming of EGL extension, and point the link t... by Android Partner Docs <[email protected]>
- 228395277 Rename Test Config to Build Config to better reflect Soon... by Android Partner Docs <[email protected]>
- 228340013 Devsite localized content from translation request 1044284. by Android Partner Docs <[email protected]>
- 228340002 Devsite localized content from translation request 1048178. by Android Partner Docs <[email protected]>
- 228339974 Devsite localized content from translation request 1089289. by Android Partner Docs <[email protected]>
- 228339806 Devsite localized content from translation request 999875. by Android Partner Docs <[email protected]>
- 228339785 Devsite localized content from translation request 1046259. by Android Partner Docs <[email protected]>
- 228339757 Devsite localized content from translation request 1049718. by Android Partner Docs <[email protected]>
- 228267452 Add information on gdbclient.py by Kenneth Lau <[email protected]>
- 228261450 Adding the Android AOSP links to the Android January secu... by Luke Haviland <[email protected]>
- 228247613 Fill in security levels for December 2018 builds. by Android Partner Docs <[email protected]>
- 228241115 Add January 2019 builds. by Android Partner Docs <[email protected]>
- 228208289 Remove _toc-*.yaml files that are no longer used due to r... by Christina Nguyen <[email protected]>
- 228205865 Devsite localized content from translation request 1048626. by Android Partner Docs <[email protected]>
- 228205856 Devsite localized content from translation request 1048155. by Android Partner Docs <[email protected]>
- 228205845 Devsite localized content from translation request 1047886. by Android Partner Docs <[email protected]>
- 228186179 Adding the January 2019 security Android/Pixel bulletins. by Luke Haviland <[email protected]>
- 228183717 Add BCC native stack dump documentation by Android Partner Docs <[email protected]>
- 228181974 Devsite localized content from translation request 1089935. by Android Partner Docs <[email protected]>
- 227911224 Add more information on cts-dev and also --skip-precondit... by Android Partner Docs <[email protected]>
- 227772142 Update image path by Danielle Roberts <[email protected]>
- 227719040 Fix broken links by Kenneth Lau <[email protected]>
- 227715850 Devsite localized content from translation request 1045494. by Android Partner Docs <[email protected]>
- 227715841 Devsite localized content from translation request 1044265. by Android Partner Docs <[email protected]>
- 227715826 Devsite localized content from translation request 1087340. by Android Partner Docs <[email protected]>
- 227709199 Fix path on images by Danielle Roberts <[email protected]>
- 227620512 Devsite localized content from translation request 1032286. by Android Partner Docs <[email protected]>
- 227620508 Devsite localized content from translation request 1087344. by Android Partner Docs <[email protected]>
- 227620485 Devsite localized content from translation request 1087104. by Android Partner Docs <[email protected]>
- 227620481 Devsite localized content from translation request 1046261. by Android Partner Docs <[email protected]>
- 227620479 Devsite localized content from translation request 1087239. by Android Partner Docs <[email protected]>
- 227617540 Devsite localized content from translation request 1007762. by Android Partner Docs <[email protected]>
- 227617535 Devsite localized content from translation request 1089145. by Android Partner Docs <[email protected]>
- 227617491 Devsite localized content from translation request 1087109. by Android Partner Docs <[email protected]>
- 227617482 Devsite localized content from translation request 1047584. by Android Partner Docs <[email protected]>
- 227617480 Devsite localized content from translation request 1089449. by Android Partner Docs <[email protected]>
- 227617378 Devsite localized content from translation request 1087099. by Android Partner Docs <[email protected]>
- 227610447 Add variable tag to CTS downloads page by Danielle Roberts <[email protected]>
- 227595909 Add link to camera section on CTS setup page by Kenneth Lau <[email protected]>
- 227595777 Change title to title case by Kenneth Lau <[email protected]>
- 227546776 Newline between function and param descriptions. by Android Partner Docs <[email protected]>
- 227546753 Small edits to system best practices by Danielle Roberts <[email protected]>
- 227033873 Document "run cts-dev" command, present CTS V2 first by Android Partner Docs <[email protected]>
- 226772000 Devsite localized content from translation request 1041964. by Android Partner Docs <[email protected]>
- 226552899 Announce Adiantum on SAC home page by Danielle Roberts <[email protected]>
- 226550934 Add Adiantum docs to encryption section by Danielle Roberts <[email protected]>
- 226530870 Devsite localized content from translation request 1046265. by Android Partner Docs <[email protected]>
- 226497667 Devsite localized content from translation request 1047878. by Android Partner Docs <[email protected]>
(And 26 more changes)
PiperOrigin-RevId: 230969164
Change-Id: I2bf51b3793304247e04b953816961605fe1ba4bf
diff --git a/zh-cn/compatibility/tests/development/atest.html b/zh-cn/compatibility/tests/development/atest.html
index 68bd31c..0a0e5e6 100644
--- a/zh-cn/compatibility/tests/development/atest.html
+++ b/zh-cn/compatibility/tests/development/atest.html
@@ -24,15 +24,21 @@
<h1 id="atest" class="page-title">Atest</h1>
-<p>Atest 是一个命令行工具,用户可以使用这种工具在本地编译、安装并运行 Android 测试。本文介绍了如何使用 Atest 运行 Android 测试。</p>
+<p>Atest 是一个命令行工具,可让用户在本地编译、安装并运行 Android 测试,同时可以大大加快重新运行测试的速度,而无需您了解 <a href="/devices/tech/test_infra/tradefed">Trade Federation 自动化测试框架</a>命令行选项。本文介绍了如何使用 Atest 运行 Android 测试。</p>
-<p>要了解如何编写测试,请参阅 <a href="https://android.googlesource.com/platform/platform_testing/+/master/docs/index.md" class="external">Android 平台测试</a>。在编写测试的编译脚本文件 (<code>Android.mk</code>) 时,请包含变量 <code>LOCAL_COMPATIBILITY_SUITE</code>。建议使用 <code>device-test</code> 作为默认值。</p>
+<p>要了解有关如何针对 Android 编写测试的一般信息,请参阅 <a href="/compatibility/tests/index.md">Android 平台测试</a>。</p>
-<p>要详细了解 Atest 的总体结构,请参阅 <a href="https://android.googlesource.com/platform/tools/tradefederation/+/master/atest/docs/atest_structure.md" class="external">Atest 开发者指南</a>。要了解如何向 Atest 添加功能,请参阅 <a href="https://android.googlesource.com/platform/tools/tradefederation/+/master/atest/docs/developer_workflow.md" class="external">Atest 开发者工作流程</a>。</p>
+<p>要了解 Atest 的总体结构,请参阅 <a href="https://android.googlesource.com/platform/tools/tradefederation/+/master/atest/docs/atest_structure.md" class="external">Atest 开发者指南</a>。</p>
+
+<p>要向 Atest 添加功能,请按照 <a href="https://android.googlesource.com/platform/tools/tradefederation/+/master/atest/docs/developer_workflow.md" class="external">Atest 开发者工作流程</a>操作。</p>
<h2 id="setting_up_your_environment">设置您的环境</h2>
-<p>要运行 Atest,您必须设置环境。</p>
+<p>要运行 Atest,请按照以下部分中的步骤来设置您的环境。</p>
+
+<h3 id="set_environment_variable">设置环境变量</h3>
+
+<p>按照<a href="/compatibility/tests/development/test-mapping#packaging_build_script_rules">打包构建脚本规则</a>为 <a href="/compatibility/tests/development/blueprints">Soong</a> 设置 test_suite,或为 Make 设置 LOCAL_COMPATIBILITY_SUITE。</p>
<h3 id="1_run_envsetupsh">1. 运行 envsetup.sh</h3>
diff --git a/zh-cn/compatibility/tests/development/blueprints.html b/zh-cn/compatibility/tests/development/blueprints.html
index 5b04446..6264734 100644
--- a/zh-cn/compatibility/tests/development/blueprints.html
+++ b/zh-cn/compatibility/tests/development/blueprints.html
@@ -22,13 +22,17 @@
limitations under the License.
-->
-<h1 id="soong_and_blueprints" class="page-title">Soong 和 Blueprint</h1>
+<h1 id="simple_test_configuration" class="page-title">简单的测试配置</h1>
<p>每个新的测试模块都必须具有配置文件,以使用模块元数据、编译时依赖项和打包指令来指引编译系统。</p>
-<p><a href="https://android.googlesource.com/platform/build/soong/">Soong 编译系统</a>在 Android 8.0 (Oreo) 中引入,在 Android Q 中实现了对 <code>android_test</code> 的支持,现在可在 Android 开源项目 (AOSP) master 分支中找到它。要查找基于 Make 的系统的相应说明,请参阅 <a href="https://android.googlesource.com/platform/platform_testing/+/master/docs/development/instr-self-e2e.md#Makefile">AOSP 中此页面的原始版本</a>。</p>
+<p><a href="https://android.googlesource.com/platform/build/soong/">Soong 编译系统</a>在 Android 8.0 (Oreo) 中引入,在 Android Q 中实现了对 <code>android_test</code> 的支持,现在可在 Android 开源项目 (AOSP) master 分支中找到它。</p>
-<p>对于 Soong,请参阅以下 Blueprint 或 <code>.bp</code> 文件示例,它是以 JSON 格式编写的:<a href="https://android.googlesource.com/platform/platform_testing/+/master/tests/example/instrumentation/Android.bp">/platform_testing/tests/example/instrumentation/Android.bp</a></p>
+<p>Soong 使用 Blueprint 文件或 <code>.bp</code> 文件,这些文件与 JSON 类似,用于对要编译的模块进行简单的声明性描述。此格式取代了以前的版本中使用的基于 Make 的系统。要适应自定义测试或使用 Android <a href="compatibility/cts">兼容性测试套件</a> (CTS),请改为按照<a href="/compatibility/tests/development/test-config">复杂的测试配置</a>操作。</p>
+
+<h2 id="example">示例</h2>
+
+<p>以下条目均来自这一示例 Blueprint 配置文件:<a href="https://android.googlesource.com/platform/platform_testing/+/master/tests/example/instrumentation/Android.bp">/platform_testing/tests/example/instrumentation/Android.bp</a></p>
<p>为方便起见,下面附上快照:</p>
<pre class="prettyprint"><code>android_test {
@@ -42,6 +46,8 @@
</code></pre>
<p>请注意,开头的 <code>android_test</code> 声明表示这是一个测试。相反,如果开头为 <code>android_app</code>,则表示这是一个编译软件包。</p>
+<h2 id="settings">设置</h2>
+
<p>下面对各项设置进行了解释:</p>
<pre class="prettyprint"><code> name: "HelloWorldTests",
</code></pre>
@@ -53,7 +59,7 @@
<p>在本例中,可能对测试普遍有用的内容如下:</p>
-<p><code>android-support-test</code> 是 Android 测试支持库的预编译项,包括新的测试运行器 <code>AndroidJUnitRunner</code>:它替代了现已弃用的内置 <code>InstrumentationTestRunner</code>,并且支持 JUnit4 测试框架。要了解详情,请参阅 developer.android.com 上的<a href="https://developer.android.com/training/testing/">在 Android 平台上测试应用</a>。</p>
+<p><code>android-support-test</code> 是 Android 测试支持库的预编译项,包括新的测试运行器 <code>AndroidJUnitRunner</code>:它替代了现已弃用的内置 <code>InstrumentationTestRunner</code>,并且支持 JUnit4 测试框架。如需了解详情,请参阅<a href="https://developer.android.com/training/testing/">在 Android 平台上测试应用</a>。</p>
<p>如果要编译一个新的插桩模块,则开始时应始终将 <code>android-support-test</code> 库作为测试运行器。平台源代码树还包括其他有用的测试框架,如 <code>ub-uiautomator</code>、<code>mockito-target</code>、<code>easymock</code> 等等。</p>
<pre class="prettyprint"><code> certificate: "platform",
@@ -65,8 +71,8 @@
<p>在其他情况下,根本不需要此设置:编译系统将直接使用默认的内置证书(基于编译变体)对其进行签名,并且它通常称为 <code>dev-keys</code>。</p>
<pre class="prettyprint"><code> test_suites: ["device-tests"],
</code></pre>
-<p><code>test_suites</code> 设置使 Trade Federation 自动化测试框架很容易发现测试。可以在此处添加其他套件(如 CTS),以便可以共享此测试。</p>
-
-<p><code>${ANDROID_PRODUCT_OUT}/testcases/HelloWorldTests/HelloWorldTests.apk</code></p>
+<p><code>test_suites</code> 设置使 Trade Federation 自动化测试框架很容易发现测试。可以在此处添加其他套件(如 CTS),以便共享此测试。</p>
+<pre class="prettyprint"><code>${ANDROID_PRODUCT_OUT}/testcases/HelloWorldTests/HelloWorldTests.apk
+</code></pre>
</body></html>
\ No newline at end of file
diff --git a/zh-cn/compatibility/tests/development/index.html b/zh-cn/compatibility/tests/development/index.html
index 924e661..8e60805 100644
--- a/zh-cn/compatibility/tests/development/index.html
+++ b/zh-cn/compatibility/tests/development/index.html
@@ -24,46 +24,40 @@
<h1 id="test_development_workflow" class="page-title">测试开发工作流</h1>
-<p>要将测试集成到平台连续测试服务,它们应该符合以下准则。</p>
+<p>要将测试集成到平台连续测试服务,它们应该符合本页面中的准则并遵循以下建议流程。</p>
+
+<ol>
+<li>使用 <a href="https://android.googlesource.com/platform/build/soong/">Soong 编译系统</a>以实现<a href="blueprints">简单的测试配置</a>。</li>
+<li>使用 <a href="test-mapping">Test Mapping</a> 直接在 Android 源代码树中轻松地创建提交前测试规则和提交后测试规则。</li>
+<li>使用 <a href="atest">Atest</a> 在本地运行测试。</li>
+</ol>
<h2 id="test_types">测试类型</h2>
<p>支持的测试类型包括:</p>
<ul>
-<li>标准<a href="https://developer.android.com/studio/test/">插桩</a>测试<ul>
-<li>支持功能测试和指标测试</li>
+<li><a href="/compatibility/tests/development/instrumentation">插桩测试</a>,这种测试支持功能测试和指标测试。要获取常规应用测试指导,请参阅<a href="https://developer.android.com/studio/test/" class="external">测试您的应用</a>。</li>
+<li><a href="/compatibility/tests/development/native">原生测试</a>,这种测试支持以下类型:<ul>
+<li>使用 <a href="https://github.com/google/googletest" class="external">gtest</a> 框架进行的<a href="/compatibility/tests/development/native-func-e2e">原生功能测试</a></li>
+<li><a href="/compatibility/tests/development/metrics.md">原生指标测试</a>,它是使用 <a href="https://github.com/google/benchmark" class="external">google-benchmark</a> 进行的原生基准测试 </li>
</ul></li>
-<li>原生测试<ul>
-<li>功能:<a href="https://github.com/google/googletest">gtest</a> 框架</li>
-<li>指标:使用 <a href="https://github.com/google/benchmark">google-benchmark</a> 进行原生基准测试</li>
-</ul></li>
-<li><a href="https://android.googlesource.com/platform/tools/tradefederation/+/master/src/com/android/tradefed/testtype/AndroidJUnitTest.java">主机 Java (Junit) 测试</a></li>
+<li>使用 JUnit 进行的 <a href="/compatibility/tests/development/jar">JAR 主机测试</a></li>
</ul>
<p>功能测试对测试用例进行通过或未通过测试的断言,而指标测试通常重复执行操作以收集时间指标。</p>
-<p>采用标准化的输入/输出格式后,不再需要对每个测试进行自定义结果解析和后处理,并且通用自动化测试框架可用于符合惯例的所有测试。</p>
+<p>采用标准化的输入/输出格式后,不再需要对每个测试进行自定义结果解析和后处理,并且通用自动化测试框架可用于符合惯例的所有测试。如需了解 Android 附带的连续测试框架,请参阅 <a href="/devices/tech/test_infra/tradefed">Trade Federation 概览</a>。</p>
<h2 id="test_case_guidelines">测试用例准则</h2>
-<p>通过连续测试服务执行的测试用例应该是<strong>封闭</strong>测试:</p>
+<p>通过连续测试服务执行的测试用例应该是<strong>封闭</strong>测试,也就是说,所有依赖项均已声明并与测试一起提供。如需了解此原则,请参阅 <a href="https://testing.googleblog.com/2012/10/hermetic-servers.html" class="external">Google Testing Blog 网站上的“Hermetic Servers”一文</a>。简而言之,封闭测试<strong>无</strong>需:</p>
<ul>
-<li>无 Google 帐号登录</li>
-<li>无连接设置(电话/WLAN/蓝牙/NFC)</li>
-<li>不传入测试参数</li>
-<li>自动化测试框架不对特定的测试用例执行设置或拆解</li>
-</ul>
-
-<h2 id="building_tests">编译测试</h2>
-
-<p>如果您不熟悉添加和执行测试的工作流,请参阅:</p>
-
-<ul>
-<li><a href="/compatibility/tests/development/instrumentation.md">插桩测试</a>(支持功能测试和指标测试)</li>
-<li><a href="/compatibility/tests/development/native.md">原生测试</a></li>
-<li><a href="/compatibility/tests/development/metrics.md">原生指标测试</a></li>
+<li>使用 Google 帐号登录</li>
+<li>配置连接(电话/Wi-Fi/蓝牙/NFC)</li>
+<li>传入测试参数</li>
+<li>由自动化测试框架对特定的测试用例执行设置或拆解</li>
</ul>
</body></html>
\ No newline at end of file
diff --git a/zh-cn/compatibility/tests/development/instr-app-e2e.html b/zh-cn/compatibility/tests/development/instr-app-e2e.html
index 161b940..e18ca48 100644
--- a/zh-cn/compatibility/tests/development/instr-app-e2e.html
+++ b/zh-cn/compatibility/tests/development/instr-app-e2e.html
@@ -22,9 +22,9 @@
limitations under the License.
-->
-<h1 id="instrumentation_targeting_an_application_a_complete_example" class="page-title">针对应用的插桩:完整的示例</h1>
+<h1 id="targeting_an_application_example" class="page-title">针对应用的插桩测试示例</h1>
-<p>如果您不熟悉 Android 平台开发,那么您可能会发现,这个从头开始添加全新插桩测试的完整示例很有用,可以帮助了解所涉及的典型工作流。</p>
+<p>此类插桩测试与针对常规 Android 应用的测试没有什么不同。值得注意的是,包含插桩的测试应用需要与其针对的应用使用相同的证书进行签名。</p>
<p>请注意,本指南假定您已掌握平台源代码树工作流的一些相关知识。如果没有,请参阅 https://source.android.com/source/requirements。本文介绍的示例是编写新的插桩测试,其中目标软件包设置为其自己的测试应用软件包。如果您不熟悉相关概念,请仔细阅读<a href="../development/index.md">平台测试简介</a>。</p>
@@ -42,15 +42,11 @@
<p>有关源代码所在位置的更多说明,请参阅<a href="instr-self-e2e.md">自插桩测试的端到端示例</a>。</p>
-<h2 id="blueprints">Blueprint</h2>
-
-<p>每个新的测试模块都必须具有 Blueprint Soong 配置文件,以使用模块元数据、编译时依赖项和打包指令来指引编译系统。详情请参阅 <a href="blueprints.md">Soong 和 Blueprint</a>。</p>
-
<h2 id="manifest_file">清单文件</h2>
<p>就像常规应用一样,每个插桩测试模块都需要一个清单文件。如果您将该文件命名为 <code>AndroidManifest.xml</code> 并在 <code>Android.mk</code> 旁边为测试 tmodule 提供该文件,则 <code>BUILD_PACKAGE</code> 核心 makefile 将自动包含该文件。</p>
-<p>在继续深入阅读以下内容之前,强烈建议您先查阅<a href="https://developer.android.com/guide/topics/manifest/manifest-intro.html">有关清单文件的外部文档</a>。</p>
+<p>在继续深入阅读以下内容之前,强烈建议您先查阅<a href="https://developer.android.com/guide/topics/manifest/manifest-intro.html" class="external">应用清单概览</a>。</p>
<p>此文档概述了清单文件的基本组成部分及其功能。</p>
@@ -101,9 +97,13 @@
</code></pre>
<p>上述代码将插桩的目标软件包设置为 <code>com.android.shell.tests</code>。通过 <code>am instrument</code> 命令调用插桩时,框架将重启 <code>com.android.shell.tests</code> 进程,并将插桩代码注入该进程以执行测试。这也意味着,测试代码可以访问在接受测试的应用中运行的所有类实例,并且或许能够操纵状态,具体取决于公开的测试钩子。</p>
-<h2 id="test_configuration_file">测试配置文件</h2>
+<h2 id="simple_configuration_file">简单配置文件</h2>
-<p>为了简化测试执行过程,您还需要为 Android 的自动化测试框架 <a href="https://source.android.com/devices/tech/test_infra/tradefed/">Trade Federation</a> 编写测试配置文件。</p>
+<p>每个新的测试模块都必须具有配置文件,以使用模块元数据、编译时依赖项和打包指令来指引编译系统。在大多数情况下,基于 Soong 的 Blueprint 文件选项就足够了。如需了解详情,请参阅<a href="blueprints.md">简单的测试配置</a>。</p>
+
+<h2 id="complex_configuration_file">复杂配置文件</h2>
+<aside class="special"><strong>重要提示</strong>:<span>只有 CTS 测试或需要特殊设置(如停用蓝牙或收集示例数据)的测试需要遵循本部分中的说明。其他所有用例均可通过<a href="blueprints">简单的测试配置</a>来涵盖。如需了解适用于本部分的详细信息,请参阅<a href="test-config">复杂的测试配置</a>。</span></aside>
+<p>对于更复杂的测试,您还需要为 Android 的自动化测试框架 <a href="/devices/tech/test_infra/tradefed/">Trade Federation</a> 编写测试配置文件。</p>
<p>测试配置可以指定特殊的设备设置选项和默认参数来提供测试类。</p>
@@ -174,7 +174,7 @@
<h2 id="build_and_test_locally">在本地编译和测试</h2>
-<p>对于最常见的用例,请使用 <a href="https://android.googlesource.com/platform/tools/tradefederation/+/master/atest/README.md">Atest</a>。</p>
+<p>对于最常见的用例,请使用 <a href="/compatibility/tests/development/atest">Atest</a>。</p>
<p>对于更为复杂的用例,如果需要更繁琐的自定义,请遵循<a href="instrumentation.md">插桩说明</a>。</p>
diff --git a/zh-cn/compatibility/tests/development/instr-self-e2e.html b/zh-cn/compatibility/tests/development/instr-self-e2e.html
index e621cf5..a8d8e67 100644
--- a/zh-cn/compatibility/tests/development/instr-self-e2e.html
+++ b/zh-cn/compatibility/tests/development/instr-self-e2e.html
@@ -22,13 +22,29 @@
limitations under the License.
-->
-<h1 id="self-instrumenting_tests_a_complete_example" class="page-title">自插桩测试:完整的示例</h1>
+<h1 id="self-instrumenting_tests_example" class="page-title">自插桩测试示例</h1>
-<p>如果您不熟悉 Android 平台开发,那么您可能会发现,这个从头开始添加全新插桩测试的完整示例很有用,可以帮助了解所涉及的典型工作流。</p>
+<p>当启动插桩测试时,系统会重启其目标软件包,并且会注入和启动插桩代码以执行测试。一种例外情况是,这里的目标软件包不能是 Android 应用框架本身,即软件包 <code>android</code>,因为这样做会导致出现一种矛盾情况:需要重启 Android 框架,而正是该框架支持系统功能,包括插桩本身。</p>
-<p>请注意,本指南假定您已掌握平台源代码树工作流的一些相关知识。如果没有,请参阅 https://source.android.com/source/requirements。本文介绍的示例是编写新的插桩测试,其中目标软件包设置为其自己的测试应用软件包。如果您不熟悉相关概念,请仔细阅读<a href="/compatibility/tests/">平台测试概述</a>。</p>
+<p>这意味着,插桩测试无法将本身注入到 Android 框架(也称为系统服务器)以执行测试。为了测试 Android 框架,测试代码只能调用公共 API Surface,或者通过平台源代码树中可用的 Android 接口定义语言 (<a href="https://developer.android.com/guide/components/aidl.html" class="external">AIDL</a>) 公开的 API Surface。对于此类测试,针对任何特定软件包都没有意义。因此,按照惯例会将此类插桩声明为针对其自己的测试应用软件包,如其自己的 <code>AndroidManifest.xml</code> 中的 <code><manifest></code> 标记所定义。</p>
-<p>本指南使用以下测试作为示例:</p>
+<p>根据要求,此类测试应用软件包还可以:</p>
+
+<ul>
+<li>捆绑测试所需的 Activity。</li>
+<li>与系统共享用户 ID。</li>
+<li>使用平台密钥进行签名。</li>
+<li>根据框架源代码而不是公共 SDK 进行编译。</li>
+</ul>
+
+<p>此类插桩测试有时称为自插桩。以下是平台源代码中自插桩测试的一些示例:</p>
+
+<ul>
+<li><a href="https://android.googlesource.com/platform/frameworks/base/+/master/core/tests/">frameworks/base/core/tests/</a></li>
+<li><a href="https://android.googlesource.com/platform/frameworks/base/+/master/services/tests/servicestests/">frameworks/base/services/tests/servicestests</a></li>
+</ul>
+
+<p>本文介绍的示例是编写新的插桩测试,其中目标软件包设置为其自己的测试应用软件包。本指南使用以下测试作为示例:</p>
<ul>
<li><a href="https://android.googlesource.com/platform/platform_testing/+/master/tests/example/instrumentation/">Hello World 插桩测试</a></li>
@@ -49,15 +65,11 @@
<p>不管是什么样的结构,您最终都需要在 <code>tests</code> 目录或新建子目录中添加文件,并且文件应类似于示例 gerrit 更改中的 <code>instrumentation</code> 目录中的文件。下面几部分将进一步详细说明各个文件。</p>
-<h2 id="blueprints">Blueprint</h2>
-
-<p>每个新的测试模块都必须具有 Blueprint Soong 配置文件,以使用模块元数据、编译时依赖项和打包指令来指引编译系统。详情请参阅 <a href="blueprints.md">Soong 和 Blueprint</a>。</p>
-
<h2 id="manifest_file">清单文件</h2>
<p>就像常规应用一样,每个插桩测试模块都需要一个清单文件。如果您将该文件命名为 <code>AndroidManifest.xml</code> 并在 <code>Android.mk</code> 旁边为测试 tmodule 提供该文件,则 <code>BUILD_PACKAGE</code> 核心 makefile 将自动包含该文件。</p>
-<p>在继续深入阅读以下内容之前,强烈建议您先查阅<a href="https://developer.android.com/guide/topics/manifest/manifest-intro.html">有关清单文件的外部文档</a>。</p>
+<p>在继续深入阅读以下内容之前,强烈建议您先查阅<a href="https://developer.android.com/guide/topics/manifest/manifest-intro.html" class="external">应用清单概览</a>。</p>
<p>此文档概述了清单文件的基本组成部分及其功能。有关示例,请参阅 <a href="https://android.googlesource.com/platform/platform_testing/+/master/tests/example/instrumentation/AndroidManifest.xml">platform_testing/tests/example/instrumentation/AndroidManifest.xml</a>。</p>
@@ -101,9 +113,13 @@
</code></pre>
<p>您可能已经注意到,上述代码声明的 <code>targetPackage</code> 与此文件的 <code>manifest</code> 标记中声明的 <code>package</code> 属性相同。如<a href="../basics/index.md">测试基础知识</a>中所述,此类插桩测试通常用于测试框架 API,所以除了它们本身之外,拥有特定的目标应用软件包并不是很有意义。</p>
-<h2 id="test_configuration_file">测试配置文件</h2>
-<aside class="special"><strong>重要提示</strong>:<span>只有 CTS 测试或需要特殊设置(如停用蓝牙或收集示例数据)的测试需要遵循本部分中的说明。其他所有用例均可通过使用 <a href="https://android.googlesource.com/platform/tools/tradefederation/+/master/atest/README.md">Atest</a> 来涵盖。</span></aside>
-<p>对于这些更复杂的用例,您还需要为 Android 的自动化测试框架 <a href="https://source.android.com/devices/tech/test_infra/tradefed/">Trade Federation</a> 编写测试配置文件。</p>
+<h2 id="simple_configuration_file">简单配置文件</h2>
+
+<p>每个新的测试模块都必须具有配置文件,以使用模块元数据、编译时依赖项和打包指令来指引编译系统。在大多数情况下,基于 Soong 的 Blueprint 文件选项就足够了。如需了解详情,请参阅<a href="blueprints.md">简单的测试配置</a>。</p>
+
+<h2 id="complex_configuration_file">复杂配置文件</h2>
+<aside class="special"><strong>重要提示</strong>:<span>只有 CTS 测试或需要特殊设置(如停用蓝牙或收集示例数据)的测试需要遵循本部分中的说明。其他所有用例均可通过<a href="blueprints">简单的测试配置</a>来涵盖。如需了解适用于本部分的更多详细信息,请参阅<a href="test-config">复杂的测试配置</a>。</span></aside>
+<p>对于这些更复杂的用例,您还需要为 Android 的自动化测试框架 <a href="/devices/tech/test_infra/tradefed/">Trade Federation</a> 编写测试配置文件。</p>
<p>测试配置可以指定特殊的设备设置选项和默认参数来提供测试类。有关示例,请参阅 <a href="/platform_testing/+/master/tests/example/instrumentation/AndroidTest.xml">/platform_testing/tests/example/instrumentation/AndroidTest.xml</a>。</p>
@@ -178,9 +194,9 @@
<p>要访问 <code>Instrumentation</code> 类的实例,只需在 <code>InstrumentationRegistry</code> 类上调用静态方法 <code>getInstrumentation()</code>:</p>
<pre class="prettyprint lang-java"><code>Instrumentation instrumentation = InstrumentationRegistry.getInstrumentation()
</code></pre>
-<h2 id="build_and_test_locally">在本地编译和测试:</h2>
+<h2 id="build_and_test_locally">在本地编译和测试</h2>
-<p>对于最常见的用例,请使用 <a href="https://android.googlesource.com/platform/tools/tradefederation/+/master/atest/README.md">Atest</a>。</p>
+<p>对于最常见的用例,请使用 <a href="/compatibility/tests/development/atest">Atest</a>。</p>
<p>对于更为复杂的用例,如果需要更繁琐的自定义,请遵循<a href="instrumentation.md">插桩说明</a>。</p>
diff --git a/zh-cn/compatibility/tests/development/instrumentation.html b/zh-cn/compatibility/tests/development/instrumentation.html
index 1164965..eb64df9 100644
--- a/zh-cn/compatibility/tests/development/instrumentation.html
+++ b/zh-cn/compatibility/tests/development/instrumentation.html
@@ -24,6 +24,23 @@
<h1 id="instrumentation_tests" class="page-title">插桩测试</h1>
+<p>请先阅读 developer.android.com 上的<a href="https://developer.android.com/studio/test/" class="external">测试应用</a>一文。请注意,在平台测试中使用插桩测试的方式有一些差异。</p>
+
+<p>总的来说,插桩测试提供了一种通过 <code>am instrument</code> 命令启动的特殊测试执行环境,其中目标应用进程会重启并使用基本的应用上下文进行初始化,并在应用进程虚拟机内启动插桩线程。您的测试代码在此插桩线程上开始执行,并附带一个 <code>Instrumentation</code> 实例,该实例可提供对应用上下文和 API 的访问权限,以操纵接受测试的应用进程。</p>
+
+<h2 id="key_concepts">主要概念</h2>
+
+<ul>
+<li>插桩必须在应用软件包中声明,并在应用软件包清单的 <code><manifest></code> 标记下嵌套 <a href="https://developer.android.com/guide/topics/manifest/instrumentation-element.html"><code><instrumentation></code></a> 标记。</li>
+<li>从技术层面来讲,应用软件包清单可以包含多个 <code><instrumentation></code> 标记,但通常不采用这种方式使用此清单。</li>
+<li>每个 <code><instrumentation></code> 必须包含:<ul>
+<li><code>android:name</code> 属性:它应该是测试应用中所包含 <a href="https://developer.android.com/reference/android/app/Instrumentation.html"><code>Instrumentation</code></a> 的子类的名称,它通常是正在使用的测试运行器,例如 <code>android.support.test.runner.AndroidJUnitRunner</code></li>
+<li>必须定义 <code>android:targetPackage</code> 属性。其值应该设置为接受测试的应用软件包。</li>
+</ul></li>
+</ul>
+
+<h2 id="summary_of_steps">步骤总结</h2>
+
<ol>
<li><p>下面是框架服务封闭测试的常见位置:</p>
<pre class="prettyprint"><code>frameworks/base/core/tests/coretests
@@ -36,7 +53,7 @@
<li><a href="instr-app-e2e.md">针对应用的插桩:完整的示例</a></li>
</ul></li>
<li><p>如果要将测试添加到上述某个位置,请遵循现有惯例。如果要设置一个新的测试模块,请在上述某个位置按照 <code>AndroidManifest.xml</code> 和 <code>Android.mk</code> 的设置进行操作</p></li>
-<li><p>有关示例,请参阅 <a href="https://android.googlesource.com/platform/frameworks/base.git/+/master/core/tests/coretests/">/frameworks/base.git/+/master/core/tests/coretests/</a>。请注意,以下行会安装额外的应用:</p>
+<li><p>有关示例,请参阅 <a href="https://android.googlesource.com/platform/frameworks/base.git/+/master/core/tests/coretests/">frameworks/base/core/tests/coretests/</a>。请注意,以下行会安装额外的应用:</p>
<pre class="prettyprint"><code><option name="test-file-name" value="FrameworksCoreTests.apk" />
<option name="test-file-name" value="BstatsTestApp.apk" />
</code></pre></li>
@@ -47,7 +64,7 @@
<li><p>运行测试:</p>
<ul>
-<li><p>最简单的解决方案是使用 Atest,如下所示:</p>
+<li><p>最简单的解决方案是使用 <a href="/compatibility/tests/development/atest">Atest</a>,如下所示:</p>
<pre class="prettyprint"><code>atest FrameworksCoreTests
</code></pre></li>
<li><p>或者,对于更复杂的测试,请使用 Trade Federation 自动化测试框架:</p></li>
diff --git a/zh-cn/compatibility/tests/development/metrics.html b/zh-cn/compatibility/tests/development/metrics.html
index 35ee36f..56fb11b 100644
--- a/zh-cn/compatibility/tests/development/metrics.html
+++ b/zh-cn/compatibility/tests/development/metrics.html
@@ -24,32 +24,34 @@
<h1 id="native_metric_tests" class="page-title">原生指标测试</h1>
-<p>如前所述,原生指标测试通常用于执行 HAL 或直接与较低级别的系统服务交互,要利用连续测试服务,应使用 <a href="https://github.com/google/benchmark">google-benchmark</a> 框架编译原生指标测试。</p>
+<p>原生指标测试通常用于执行硬件抽象层 (HAL) 或直接与较低级别的系统服务交互。要利用连续测试服务,应使用 <a href="https://github.com/google/benchmark" class="external">google-benchmark</a> 框架编译原生指标测试。</p>
-<p>下面是一些常规说明:</p>
+<h2 id="example">示例</h2>
+
+<p>请参阅示例原生测试模块设置,位于:<a href="https://android.googlesource.com/platform/bionic/+/master/benchmarks/bionic_benchmarks.cpp">bionic/benchmarks/bionic-benchmarks</a></p>
+
+<h2 id="summary_of_steps">步骤总结</h2>
<ol>
-<li>参阅示例原生测试模块设置,位于:<code>bionic/benchmarks/bionic-benchmarks</code></li>
-<li>测试模块 makefile 应使用 <code>BUILD_NATIVE_BENCHMARK</code> 编译规则,以便自动包含 google-benchmark 依赖项</li>
+<li>测试模块配置文件应使用 <code>BUILD_NATIVE_BENCHMARK</code> 编译规则,以便自动包含 google-benchmark 依赖项。</li>
<li><p>使用 make 命令编译测试模块:</p>
<pre class="prettyprint lang-shell"><code>make -j40 bionic-benchmarks
</code></pre></li>
<li><p>使用 Trade Federation 自动化测试框架自动安装和运行:</p>
<pre class="prettyprint"><code>make tradefed-all -j
tradefed.sh run template/local_min --template:map test=bionic-benchmarks
-1. Manually Install and Run:
-1. Push the generated test binary onto device:
-
- ```shell
- adb push ${OUT}/data/benchmarktest/bionic-benchmarks/bionic-benchmarks32 \
- /data/benchmarktest/bionic-benchmarks/bionic-benchmarks32
- ```
-1. Execute the test by invoking test binary on device:
-
- ```shell
- adb shell /data/benchmarktest/bionic-benchmarks/bionic-benchmarks32
- ```
</code></pre></li>
+<li><p>手动安装并运行,如下所示:</p>
+
+<ol>
+<li><p>将生成的测试二进制文件推送到设备:</p>
+<pre class="prettyprint"><code>adb push ${OUT}/data/benchmarktest/bionic-benchmarks/bionic-benchmarks32 \
+ /data/benchmarktest/bionic-benchmarks/bionic-benchmarks32
+</code></pre></li>
+<li><p>通过在设备上调用测试二进制文件执行测试:</p>
+<pre class="prettyprint"><code>adb shell /data/benchmarktest/bionic-benchmarks/bionic-benchmarks32
+</code></pre></li>
+</ol></li>
</ol>
</body></html>
\ No newline at end of file
diff --git a/zh-cn/compatibility/tests/development/native-func-e2e.html b/zh-cn/compatibility/tests/development/native-func-e2e.html
index 17023aa..f78a292 100644
--- a/zh-cn/compatibility/tests/development/native-func-e2e.html
+++ b/zh-cn/compatibility/tests/development/native-func-e2e.html
@@ -22,19 +22,13 @@
limitations under the License.
-->
-<h1 id="adding_a_new_native_test_a_complete_example" class="page-title">添加新的原生测试:完整的示例</h1>
+<h1 id="adding_a_new_native_test_example" class="page-title">添加新的原生测试示例</h1>
-<p>如果您不熟悉 Android 平台开发,那么您可能会发现,这个从头开始添加全新原生测试的完整示例很有用,可以帮助了解所涉及的典型工作流。</p>
-
-<p>请注意,本指南假定您已掌握平台源代码树工作流的一些相关知识。如果没有,请参阅 https://source.android.com/source/requirements。</p>
-
-<p>此外,如果您也不熟悉 C++ 的 gtest 框架,请访问 <a href="https://github.com/google/googletest">gtest 项目网站</a>以查看其他文档。</p>
+<p>如果您不熟悉 Android 平台开发,那么您可能会发现,这个从头开始添加全新原生测试的完整示例很有用,可以帮助您了解所涉及的典型工作流。此外,如果您也不熟悉 C++ 的 gtest 框架,请访问 <a href="https://github.com/google/googletest">gtest 项目网站</a>以查看其他文档。</p>
<p>本指南使用以下测试作为示例:</p>
-<ul>
-<li><a href="https://android.googlesource.com/platform/platform_testing/+/master/tests/example/native/">Hello World 原生测试</a></li>
-</ul>
+<p><a href="https://android.googlesource.com/platform/platform_testing/+/master/tests/example/native/">Hello World 原生测试</a></p>
<p>建议您先浏览代码以获得粗略的印象,然后再继续。</p>
@@ -87,10 +81,6 @@
</code></pre>
<p>不管是什么样的结构,您最终都需要在 <code>tests</code> 目录或新建子目录中添加文件,并且文件应类似于示例 gerrit 更改中的 <code>native</code> 目录中的文件。下面几部分将进一步详细说明各个文件。</p>
-<h2 id="blueprints">Blueprint</h2>
-
-<p>每个新的测试模块都必须具有 Blueprint Soong 配置文件,以使用模块元数据、编译时依赖项和打包指令来指引编译系统。详情请参阅 <a href="blueprints.md">Soong 和 Blueprint</a>。</p>
-
<h2 id="source_code">源代码</h2>
<p>有关示例,请参阅 <a href="https://android.googlesource.com/platform/platform_testing/+/master/tests/example/native/HelloWorldTest.cpp">Hello World 原生测试</a>。</p>
@@ -125,17 +115,19 @@
<li>https://github.com/google/googletest/blob/master/googletest/docs/Primer.md</li>
</ul>
-<h2 id="test_configuration">测试配置</h2>
-<aside class="special"><strong>重要提示</strong>:<span>只有 CTS 测试或需要特殊设置(如停用蓝牙或收集示例数据)的测试需要遵循本部分中的说明。其他所有用例均可通过使用 <a href="https://android.googlesource.com/platform/tools/tradefederation/+/master/atest/README.md">Atest</a> 来涵盖。</span></aside>
-<p>为了简化测试执行过程,您可以编写类似以下映射的测试映射:<a href="https://android.googlesource.com/platform/platform_testing/+/master/tests/example/native/TEST_MAPPING">/platform/platform_testing/tests/example/native/TEST_MAPPING</a>。</p>
+<h2 id="simple_configuration_file">简单配置文件</h2>
+<p>每个新的测试模块都必须具有配置文件,以使用模块元数据、编译时依赖项和打包指令来指引编译系统。在大多数情况下,基于 Soong 的 Blueprint 文件选项就足够了。如需了解详情,请参阅<a href="blueprints.md">简单的测试配置</a>。</p>
+
+<h2 id="complex_configuration_file">复杂配置文件</h2>
+<aside class="special"><strong>重要提示</strong>:<span>只有 CTS 测试或需要特殊设置(如停用蓝牙或收集示例数据)的测试需要遵循本部分中的说明。其他所有用例均可通过<a href="blueprints.md">简单的测试配置</a>来涵盖。如需了解适用于本部分的详细信息,请参阅<a href="compatibility/tests/development/test-config">复杂的测试配置</a>。</span></aside>
<p>要改用 Trade Federation,请为 Android 的自动化测试框架 <a href="/devices/tech/test_infra/tradefed/">Trade Federation</a> 编写测试配置文件。</p>
<p>测试配置可以指定特殊的设备设置选项和默认参数来提供测试类。</p>
<h2 id="build_and_test_locally">在本地编译和测试</h2>
-<p>对于最常见的用例,请使用 <a href="https://android.googlesource.com/platform/tools/tradefederation/+/master/atest/README.md">Atest</a>。</p>
+<p>对于最常见的用例,请使用 <a href="/compatibility/tests/development/atest">Atest</a>。</p>
<p>对于更为复杂的用例,如果需要更繁琐的自定义,请遵循<a href="instrumentation.md">插桩说明</a>。</p>
diff --git a/zh-cn/compatibility/tests/development/native.html b/zh-cn/compatibility/tests/development/native.html
index 9d9fee6..68aece9 100644
--- a/zh-cn/compatibility/tests/development/native.html
+++ b/zh-cn/compatibility/tests/development/native.html
@@ -24,25 +24,36 @@
<h1 id="native_tests" class="page-title">原生测试</h1>
-<p>如前所述,原生测试通常用于执行 HAL 或直接与较低级别的系统服务交互,要利用连续测试服务,应使用 <a href="https://github.com/google/googletest">gtest</a> 框架编译原生测试。</p>
+<p>平台的原生测试通常会访问较低级别的 HAL,或针对各种系统服务执行原始 IPC。因此,测试方法通常与接受测试的服务密切相关。</p>
-<p>下面是一些常规说明:</p>
+<p>请使用 <a href="https://github.com/google/googletest" class="external">gtest</a> 框架编译原生测试。这是与持续测试基础架构集成的先决条件。</p>
+
+<h2 id="examples">示例</h2>
+
+<p>以下是平台源代码中原生测试的一些示例:</p>
+
+<ul>
+<li><a href="https://android.googlesource.com/platform/frameworks/av/+/master/camera/tests/">frameworks/av/camera/tests</a></li>
+<li><a href="https://android.googlesource.com/platform/frameworks/native/+/master/libs/gui/tests/">frameworks/native/libs/gui/tests</a></li>
+</ul>
+
+<h2 id="summary_of_steps">步骤总结</h2>
<ol>
-<li>参阅示例原生测试模块设置,位于:<code>libs/hwui/unit_tests</code></li>
-<li>测试模块 makefile 应使用 <code>BUILD_NATIVE_TEST</code> 编译规则,以便自动包含 gtest 依赖项</li>
-<li>编写<a href="test-config.md">测试配置</a>。</li>
+<li>参阅示例原生测试模块设置,位于:<a href="https://android.googlesource.com/platform/frameworks/base/+/master/libs/hwui/tests/unit/">frameworks/base/libs/hwui/tests/unit/</a></li>
+<li>测试模块配置应使用 <code>BUILD_NATIVE_TEST</code> 编译规则,以便自动包含 gtest 依赖项</li>
+<li>编写测试配置。请参阅<a href="/compatibility/tests/development/blueprints">简单配置</a>选项和<a href="/compatibility/tests/development/test-config">复杂配置</a>选项。</li>
<li><p>使用 <code>mmm</code> 或 <code>mma</code>(取决于它是增量编译还是完整编译)编译测试模块,例如:</p>
<pre class="prettyprint lang-shell"><code>make hwui_unit_tests -j
</code></pre></li>
-<li><p>使用 <a href="https://android.googlesource.com/platform/tools/tradefederation/+/master/atest/README.md">Atest</a> 运行测试:</p>
+<li><p>使用 <a href="/compatibility/tests/development/atest">Atest</a> 在本地运行测试:</p>
<pre class="prettyprint"><code>atest hwui_unit_tests
</code></pre></li>
-<li><p>或者,使用 Trade Federation 自动化测试框架运行:</p>
+<li><p>使用 Trade Federation 自动化测试框架运行测试:</p>
<pre class="prettyprint"><code>make tradefed-all -j
tradefed.sh run template/local_min --template:map test=hwui_unit_tests
</code></pre></li>
-<li><p>如果使用 Trade Federation,请手动安装并运行:</p>
+<li><p>手动安装并运行:</p>
<ol>
<li><p>将生成的测试二进制文件推送到设备:</p>
diff --git a/zh-cn/compatibility/tests/development/test-config.html b/zh-cn/compatibility/tests/development/test-config.html
index 66d4784..1fd2a92 100644
--- a/zh-cn/compatibility/tests/development/test-config.html
+++ b/zh-cn/compatibility/tests/development/test-config.html
@@ -22,8 +22,8 @@
limitations under the License.
-->
-<h1 id="test_module_configuration" class="page-title">测试模块配置</h1>
-<aside class="special"><strong>重要提示</strong>:<span>只有 CTS 测试或需要特殊设置(如停用蓝牙或收集示例数据)的测试需要遵循此页面上的说明。其他所有用例均可通过使用 <a href="https://android.googlesource.com/platform/tools/tradefederation/+/master/atest/README.md">Atest</a> 来涵盖。</span></aside>
+<h1 id="complex_test_configuration" class="page-title">复杂的测试配置</h1>
+<aside class="special"><strong>重要提示</strong>:<span>只有 Android <a href="compatibility/cts">兼容性测试套件</a> (CTS) 测试或需要特殊设置(如停用蓝牙或收集示例数据)的测试需要遵循此页面上的说明。其他所有用例均可通过使用 Blueprint 的基于 Soong 的<a href="blueprints.md">简单的测试配置</a>来涵盖,这些 Blueprint 能够自动处理以前手动执行的大部分配置操作。</span></aside>
<p>某些测试模块可能需要执行在测试用例本身内无法执行的自定义设置和拆解步骤。典型的示例可能包括:</p>
<ul>
@@ -34,13 +34,13 @@
<p>过去,组件团队通常依靠编写主机端测试来执行此类任务,这需要了解 Trade Federation 自动化测试框架,并且通常会提高测试模块的复杂性。</p>
-<p>我们引入了测试模块配置的概念(借鉴于 CTS)来支持此类任务,只需几行配置即可完成上面列出的常见任务。为了获得最大的灵活性,您甚至可以实现自己的目标准备器(由 <a href="/reference/com/android/tradefed/targetprep/ITargetPreparer.html">ITargetPreparer</a> 或 <a href="/reference/com/android/tradefed/targetprep/ITargetCleaner.html">ITargetCleaner</a> 定义),并对其进行配置以在您自己的测试模块配置中使用。</p>
+<p>我们引入了测试模块配置的概念(借鉴于 CTS)来支持此类任务,只需几行配置即可完成上面列出的常见任务。为了达到最大的灵活性,您甚至可以实现自己的目标准备器(由 <a href="/reference/com/android/tradefed/targetprep/ITargetPreparer.html">ITargetPreparer</a> 或 <a href="/reference/com/android/tradefed/targetprep/ITargetCleaner.html">ITargetCleaner</a> 定义),并对其进行配置以在您自己的测试模块配置中使用。</p>
<p>测试模块的测试模块配置是添加到顶级模块源文件夹的必需 XML 文件,名为“AndroidTest.xml”。该 XML 文件遵循 Trade Federation 自动化测试框架使用的配置文件的格式。目前,通过测试模块配置处理的主要标记是“target_preparer”和“test”标记。</p>
<h2 id="target_preparers">目标准备器</h2>
-<p>顾名思义,“target_preparer”标记会定义目标准备器(请参阅 <a href="/reference/com/android/tradefed/targetprep/ITargetPreparer.html">ITargetPreparer</a>),该目标准备器提供了一种设置方法,在执行测试模块以进行测试之前会调用该方法;如果“target_preparer”标记中引用的类也实现 <a href="/reference/com/android/tradefed/targetprep/ITargetCleaner.html">ITargetCleaner</a>,则在测试模块完成后将调用其拆解方法。</p>
+<p>顾名思义,“target_preparer”标记会定义目标准备器(请参阅 <a href="/reference/com/android/tradefed/targetprep/ITargetPreparer.html">ITargetPreparer</a>),该目标准备器提供了一种设置方法,在执行测试模块以进行测试之前会调用该方法;如果“target_preparer”标记中引用的类也实现了 <a href="/reference/com/android/tradefed/targetprep/ITargetCleaner.html">ITargetCleaner</a>,则在测试模块完成后将调用其拆解方法。</p>
<p>要使用内置的通用模块配置,请在测试模块的顶级文件夹中添加一个新文件“AndroidTest.xml”,并在该文件里填充以下内容:</p>
<pre class="prettyprint lang-xml"><code><?xml version="1.0" encoding="utf-8"?>
@@ -62,7 +62,9 @@
<li>在测试模块完成之后,执行 shell 命令“settings put secure accessibility_enabled 0”</li>
</ol>
-<p>在此特定示例中,分别在测试模块执行之前/之后启用/停用可访问性。通过一个简单的示例演示,可以详细介绍如何使用“option”标记。如上所示,该标记可以有两个属性:名称和值。名称属性指示选项的名称,并进一步分解成由冒号分隔的两部分:一部分是准备器的简称,另一部分是准备器提供的实际选项名称。值字段的确切目的取决于准备器如何定义选项:它可以是字符串、数字、布尔值,甚至是文件路径等等。在上面的示例中,名称“run-command:run-command”表示我们正在为由简称为“run-command”的目标准备器定义的选项“run-command”设置值;名称“run-command:teardown-command”表示我们正在为也是由简称为“run-command”的同一目标准备器定义的选项“teardown-command”设置值。下面总结了三个常见的目标准备器:</p>
+<p>在此特定示例中,分别在测试模块执行之前/之后启用/停用可访问性。通过一个简单的示例演示,可以详细介绍如何使用“option”标记。如上所示,该标记可以有两个属性:名称和值。名称属性指示选项的名称,并进一步分解成由冒号分隔的两部分:一部分是准备器的简称,另一部分是准备器提供的实际选项名称。</p>
+
+<p>值字段的确切用途取决于准备器如何定义选项:它可以是字符串、数字、布尔值,甚至可以是文件路径等等。在上面的示例中,名称“run-command:run-command”表示我们正在为由简称为“run-command”的目标准备器定义的选项“run-command”设置值;名称“run-command:teardown-command”表示我们正在为也是由简称为“run-command”的同一目标准备器定义的选项“teardown-command”设置值。下面总结了三个常见的目标准备器:</p>
<ul>
<li><p>类名:<a href="https://android.googlesource.com/platform/tools/tradefederation/+/master/src/com/android/tradefed/targetprep/PushFilePreparer.java">PushFilePreparer</a></p>
diff --git a/zh-cn/compatibility/tests/development/test-mapping.html b/zh-cn/compatibility/tests/development/test-mapping.html
index e76cdaa..57820d6 100644
--- a/zh-cn/compatibility/tests/development/test-mapping.html
+++ b/zh-cn/compatibility/tests/development/test-mapping.html
@@ -44,7 +44,7 @@
<h2 id="packaging_build_script_rules">打包构建脚本规则</h2>
-<p>为了让 <a href="/devices/tech/test_infra/tradefed">Trade Federation 自动化测试框架</a>针对指定构建运行 Test Mapping 的测试模块,这些模块必须针对 <a href="blueprints">Soong</a> 将 <strong>test_suite</strong>(或针对 Make 将 <strong>LOCAL_COMPATIBILITY_SUITE</strong>)设为以下两个套件之一:</p>
+<p>为了让 <a href="/devices/tech/test_infra/tradefed">Trade Federation 自动化测试框架</a>针对指定版本运行 Test Mapping 的测试模块,这些模块必须针对 <a href="blueprints">Soong</a> 将 <strong>test_suite</strong>(或针对 Make 将 <strong>LOCAL_COMPATIBILITY_SUITE</strong>)设为以下两个套件之一:</p>
<ul>
<li><strong>device-tests</strong> - 针对特定设备 CPU 构建</li>
diff --git a/zh-cn/compatibility/tests/index.html b/zh-cn/compatibility/tests/index.html
index 6844579..eb05a67 100644
--- a/zh-cn/compatibility/tests/index.html
+++ b/zh-cn/compatibility/tests/index.html
@@ -26,23 +26,23 @@
<p>本内容面向 Android 平台开发者。在了解如何在 Android 平台上进行测试之前,请参阅 <a href="/devices/architecture">Android 平台架构</a>,大致了解相关的信息。</p>
-<h2 id="whats_new">新增内容</h2>
+<h2 id="whats_new">新变化</h2>
<h3 id="test_development_workflow">测试开发工作流</h3>
<p><a href="/compatibility/tests/development">测试开发工作流</a>小节现在包含介绍性材料,其中包括所有主要测试类型的端到端示例。</p>
-<h3 id="blueprints">Blueprint</h3>
+<h3 id="simple_test_configuration">简单的测试配置</h3>
-<p><a href="https://android.googlesource.com/platform/build/soong/">Soong 编译系统</a>在 Android 8.0 (Oreo) 中引入,在 Android Q 中实现了对 <code>android_test</code> 的支持,现在可在 Android 开源项目 (AOSP) master 分支中找到它。</p>
+<p><a href="https://android.googlesource.com/platform/build/soong/">Soong 编译系统</a>在 Android 8.0 (Oreo) 中引入,在 Android Q 中实现了对 <code>android_test</code> 的支持,现在可在 Android 开源项目 (AOSP) master 分支中找到它。Soong 基于 Blueprint 的配置比以前的 Make 解决方案简单得多。</p>
<h3 id="atest">Atest</h3>
-<p><a href="https://android.googlesource.com/platform/tools/tradefederation/+/master/atest/README.md" class="external">Atest</a> 是一个命令行工具,用户可以使用这种工具在本地编译、安装并运行 Android 测试。建议采用此标准对您的功能进行初始测试。</p>
+<p><a href="/compatibility/tests/development/atest">Atest</a> 是一个命令行工具,用户可以使用该工具在本地编译、安装并运行 Android 测试。建议采用此标准对您的功能进行初始测试。</p>
<h2 id="what_and_how_to_test">测试什么以及如何测试</h2>
-<p>平台测试通常与一个或多个 Android 系统服务或 HAL 层交互、执行受测对象的功能,并断言测试结果的正确性。</p>
+<p>平台测试通常与一个或多个 Android 系统服务或硬件抽象层 (HAL) 交互、执行受测对象的功能,并断言测试结果的正确性。</p>
<p>因此,平台测试可以:</p>
@@ -53,69 +53,19 @@
<li>私有 API(@hide 或受保护,软件包私有)</li>
</ul></li>
<li>直接通过原始 binder/IPC 代理调用 Android 系统服务</li>
-<li>通过低级 API 或 IPC 接口直接与 HAL 交互</li>
+<li>通过低级别 API 或 IPC 接口直接与 HAL 交互</li>
</ol>
-<p>上面的类型 1 和 2 通常编写为<strong>插桩测试</strong>,而类型 3 通常使用 gtest 框架编写为<strong>原生测试</strong>。</p>
+<p>类型 1 和 2 通常编写为<a href="/compatibility/tests/development/instrumentation">插桩测试</a>,而类型 3 通常使用 <a href="https://github.com/google/googletest" class="external">gtest</a> 框架编写为<a href="/compatibility/tests/development/native">原生测试</a>。</p>
-<h2 id="instrumentation_tests_for_the_platform">平台的插桩测试</h2>
-
-<p>您可能已经阅读 <code>developer.android.com</code> 上的<a href="https://developer.android.com/studio/test/">测试应用</a>一文,不过,在平台测试中使用插桩测试的方式可能仍有一些差异。</p>
-
-<p>简言之,插桩测试提供了一种通过 <code>am instrument</code> 命令启动的特殊测试执行环境,其中目标应用进程会重启并使用基本的应用上下文进行初始化,并在应用进程虚拟机内启动插桩线程。您的测试代码在此插桩线程上开始执行,并附带一个 <code>Instrumentation</code> 实例,该实例可提供对应用上下文和 API 的访问权限,以操纵接受测试的应用进程。</p>
-
-<p>关于插桩的一些关键概念:</p>
+<p>如需了解详情,请参阅我们的端到端示例:</p>
<ul>
-<li>插桩必须在应用软件包中声明,并在应用软件包清单的 <code><manifest></code> 标记下嵌套 <a href="https://developer.android.com/guide/topics/manifest/instrumentation-element.html"><code><instrumentation></code></a> 标记</li>
-<li>应用软件包清单在技术上可能包含多个 <code><instrumentation></code> 标记,不过它不常以这种方式使用</li>
-<li>每个 <code><instrumentation></code> 必须包含:<ul>
-<li><code>android:name</code> 属性:它应该是测试应用中包含的 <a href="https://developer.android.com/reference/android/app/Instrumentation.html"><code>Instrumentation</code></a> 的子类的名称,通常是正在使用的测试运行器,例如 <code>android.support.test.runner.AndroidJUnitRunner</code></li>
-<li>必须定义 <code>android:targetPackage</code> 属性。其值应该设置为接受测试的应用软件包</li>
-</ul></li>
+<li><a href="/compatibility/tests/development/instr-app-e2e.md">针对应用的插桩</a></li>
+<li><a href="/compatibility/tests/development/instr-self-e2e.md">自插桩测试</a></li>
+<li><a href="/compatibility/tests/development/native-func-e2e.md">原生测试</a></li>
</ul>
-<p>对于平台测试,通常有两类插桩测试:</p>
-
-<h3 id="instrumentation_tests_targeting_applications">针对应用的插桩测试</h3>
-
-<p>此类插桩测试与针对常规 Android 应用的测试没有什么不同。值得注意的是,包含插桩的测试应用需要与其针对的应用使用相同的证书进行签名。</p>
-
-<p>要了解详情,请参阅我们的<a href="/compatibility/tests/development/instr-app-e2e.md">端到端示例</a>。</p>
-
-<h3 id="instrumentation_tests_targeting_themselves">针对本身的插桩测试</h3>
-
-<p>如前所述,当启动插桩时,会重启其目标软件包,并且会注入和启动插桩代码以执行测试。一种例外情况是,这里的目标软件包不能是 Android 应用框架本身,即软件包 <code>android</code>,因为这样做会导致出现一种矛盾情况:需要重启 Android 框架,而正是该框架支持系统功能,包括插桩本身。</p>
-
-<p>这意味着,插桩测试无法将本身注入到 Android 框架(也称为系统服务器)以执行测试。为了测试 Android 框架,测试代码只能调用公共 API Surface,或者通过平台源代码树中可用的 <a href="https://developer.android.com/guide/components/aidl.html">AIDL</a> 公开的 API Surface。对于此类测试,针对任何特定软件包都没有意义,因此,按照惯例会将此类插桩声明为针对其自己的测试应用软件包,如其自己的 <code>AndroidManifest.xml</code> 中的 <code><manifest></code> 标记所定义。</p>
-
-<p>根据要求,此类测试应用软件包还可以:</p>
-
-<ul>
-<li>捆绑测试所需的 Activity。</li>
-<li>与系统共享用户 ID。</li>
-<li>使用平台密钥进行签名。</li>
-<li>根据框架源代码而不是公共 SDK 进行编译。</li>
-</ul>
-
-<p>此类插桩测试有时称为自插桩。下面是采用平台源代码的此类插桩测试的一些示例:</p>
-<pre class="prettyprint"><code>frameworks/base/core/tests/coretests
-frameworks/base/services/tests/servicestests
-</code></pre>
-<p>要了解详情,请参阅我们的<a href="/compatibility/tests/development/instr-self-e2e.md">端到端示例</a>。</p>
-
-<h2 id="native_tests_for_the_platform">平台的原生测试</h2>
-
-<p>平台测试的原生测试通常会访问较低级别的 HAL,或者针对各种系统服务执行原始 IPC,因此测试方法通常与接受测试的服务密切相关,这超出了本文档的范畴。</p>
-
-<p>强烈建议使用 <a href="https://github.com/google/googletest">gtest</a> 框架编译原生测试,这是与持续测试基础架构集成的先决条件。</p>
-
-<p>下面是采用平台源代码的此类原生测试的一些示例:</p>
-<pre class="prettyprint"><code>frameworks/av/camera/tests
-frameworks/native/libs/gui/tests
-</code></pre>
-<p>要了解详情,请参阅我们的<a href="/compatibility/tests/development/native-func-e2e.md">端到端示例</a>。</p>
-
<p>请熟悉以下工具,因为它们是在 Android 系统中进行测试所固有的工具。</p>
<h2 id="compatibility_test_suite_cts">兼容性测试套件 (CTS)</h2>