• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

app/22-Nov-2023-2,4081,187

assets/26/22-Nov-2023-

src/android/theme/cts/22-Nov-2023-738448

Android.mkD22-Nov-20231.4 KiB4616

AndroidTest.xmlD22-Nov-20231.3 KiB2712

READMED22-Nov-20233.3 KiB9762

android_device.pyD22-Nov-20234.1 KiB12374

generate_images.shD22-Nov-20231.5 KiB5629

run_theme_capture_device.pyD22-Nov-20235.3 KiB181129

README

1* Copyright (C) 2015 The Android Open Source Project
2*
3* Licensed under the Apache License, Version 2.0 (the "License");
4* you may not use this file except in compliance with the License.
5* You may obtain a copy of the License at
6*
7*      http://www.apache.org/licenses/LICENSE-2.0
8*
9* Unless required by applicable law or agreed to in writing, software
10* distributed under the License is distributed on an "AS IS" BASIS,
11* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12* See the License for the specific language governing permissions and
13* limitations under the License.
14
15
16INTRODUCTION
17
18The Android theme tests ensure that the Holo and Material themes have not been
19modified. They consist of API-specific sets of reference images representing
20specific themes and widgets that must be identical across devices. To pass the
21theme tests, a device must be able to generate images that are identical to the
22reference images.
23
24NOTE: Reference images should only be updated by the CTS test maintainers. Any
25      modifications to the reference images will invalidate the test results.
26
27
28INSTRUCTIONS
29
30I. Generating reference images (CTS maintainers only)
31
32Reference images are typically only generated for new API revisions. To
33generate a new set of reference images, do the following:
34
35  1. Connect one device for each DPI bucket (ldpi, xxxhdpi, etc.) that you wish
36     to generate references images for. Confirm that all devices are connected
37     with:
38
39     adb devices
40
41  2. Image generation occurs on all devices in parallel. Resulting sets of
42     reference images are saved in assets/<platform>/<dpi>.zip and will
43     overwrite any existing sets. Image generation may be started using:
44
45     ./cts/hostsidetests/theme/generate_images.sh
46
47A complete collection of reference images for a given API revision must include
48a set for each possible DPI bucket (tvdpi, xxhdpi, etc.) that may be tested.
49
50For a list of devices and their DPI buckets, see Device Metrics:
51
52    https://design.google.com/devices/
53
54
55II. Building theme tests
56
571. If you have not already built the CTS tests, run an initial make:
58
59   make cts -j32
60
612. Subsequent changes to the theme tests, including changes to the reference
62   images, may be built using mmm:
63
64   mmm cts/hostsidetests/theme -j32
65
66
67III. Running theme tests
68
69To obtain reliable results, theme tests should be run against the device's
70native density; however, many of the tests will also work in a scaled density.
71If you don't possess a device for a given density and would still like to run
72tests for that density, you can manually force scaling via:
73
74  adb shell wm density <dpi>
75
76As of API 24, the results will NOT be 100% reliable due to scaling artifacts.
77To reset the device to its native density, run:
78
79  adb shell wm density reset
80
81Once the device is in the desired state, do the following:
82
83  1. Connect the device that you wish to test. Confirm that is is connected with:
84
85     adb devices
86
87  2. Run the theme tests using cts-tradefed:
88
89     cts-tradefed run singleCommand cts-dev --module CtsThemeHostTestCases \
90         --test android.theme.cts.ThemeHostTest
91
92  3. Wait for the tests to complete. This should take less than five minutes.
93
94If any test failures are encountered, diff PNGs will be generated and collected
95in the "diffs" directory of the CTS results indicated by "Test Result:" in the
96test output.
97