Alan Viverette | c15ea9f | 2015-08-26 16:33:17 -0400 | [diff] [blame^] | 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 | |
| 16 | INTRODUCTION |
| 17 | |
| 18 | The Android theme tests ensure that the Holo and Material themes have not been |
| 19 | modified. They consist of API-specific sets of reference images representing |
| 20 | specific themes and widgets that must be identical across devices. To pass the |
| 21 | theme tests, a device must be able to generate images that are identical to the |
| 22 | reference images. |
| 23 | |
| 24 | NOTE: 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 | |
| 28 | INSTRUCTIONS |
| 29 | |
| 30 | I. Generating reference images (CTS maintainers only) |
| 31 | |
| 32 | Reference images are typically only generated for new API revisions. To |
| 33 | generate 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 | |
| 47 | A complete collection of reference images for a given API revision must include |
| 48 | a set for each possible DPI bucket (tvdpi, xxhdpi, etc.) that may be tested. |
| 49 | |
| 50 | |
| 51 | II. Building theme tests |
| 52 | |
| 53 | 1. If you have not already built the CTS tests, run an initial make: |
| 54 | |
| 55 | make cts -j32 |
| 56 | |
| 57 | 2. Subsequent changes to the theme tests, including changes to the reference |
| 58 | images, may be built using mmm: |
| 59 | |
| 60 | mmm cts/hostsidetests/theme -j32 |
| 61 | |
| 62 | |
| 63 | III. Running theme tests |
| 64 | |
| 65 | 1. Connect the device that you wish to test. Confirm that is is connected with: |
| 66 | |
| 67 | adb devices |
| 68 | |
| 69 | 2. Run the theme tests using cts-tradefed: |
| 70 | |
| 71 | cts-tradefed run cts -c android.theme.cts.ThemeHostTest |
| 72 | |
| 73 | 3. Wait for the tests to complete. This should take less than five minutes. |