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/<api>/<dpi>.zip and will overwrite 43 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 691. Connect the device that you wish to test. Confirm that is is connected with: 70 71 adb devices 72 732. Run the theme tests using cts-tradefed: 74 75 cts-tradefed run singleCommand cts --skip-device-info --skip-preconditions \ 76 --skip-connectivity-check --module CtsThemeHostTestCases \ 77 --test android.theme.cts.ThemeHostTest 78 793. Wait for the tests to complete. This should take less than five minutes. 80