OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.base.test.util; | 5 package org.chromium.base.test.util; |
6 | 6 |
7 import java.lang.annotation.ElementType; | 7 import java.lang.annotation.ElementType; |
8 import java.lang.annotation.Retention; | 8 import java.lang.annotation.Retention; |
9 import java.lang.annotation.RetentionPolicy; | 9 import java.lang.annotation.RetentionPolicy; |
10 import java.lang.annotation.Target; | 10 import java.lang.annotation.Target; |
11 | 11 |
12 /** | 12 /** |
13 * An annotation for listing restrictions for a test method. For example, if a t
est method is only | 13 * An annotation for listing restrictions for a test method. For example, if a t
est method is only |
14 * applicable on a phone with small memory: | 14 * applicable on a phone with small memory: |
15 * @Restriction({RESTRICTION_TYPE_PHONE, RESTRICTION_TYPE_SMALL_MEMORY}) | 15 * @Restriction({RESTRICTION_TYPE_PHONE, RESTRICTION_TYPE_SMALL_MEMORY}) |
16 * Test classes are free to define restrictions and enforce them using reflectio
n at runtime. | 16 * Test classes are free to define restrictions and enforce them using reflectio
n at runtime. |
17 */ | 17 */ |
18 @Target(ElementType.METHOD) | 18 @Target({ElementType.METHOD, ElementType.TYPE}) |
19 @Retention(RetentionPolicy.RUNTIME) | 19 @Retention(RetentionPolicy.RUNTIME) |
20 public @interface Restriction { | 20 public @interface Restriction { |
21 /** Specifies the test is only valid on low end devices that have less memor
y. */ | 21 /** Specifies the test is only valid on low end devices that have less memor
y. */ |
22 public static final String RESTRICTION_TYPE_LOW_END_DEVICE = "Low_End_Device
"; | 22 public static final String RESTRICTION_TYPE_LOW_END_DEVICE = "Low_End_Device
"; |
23 | 23 |
24 /** Specifies the test is only valid on non-low end devices. */ | 24 /** Specifies the test is only valid on non-low end devices. */ |
25 public static final String RESTRICTION_TYPE_NON_LOW_END_DEVICE = "Non_Low_En
d_Device"; | 25 public static final String RESTRICTION_TYPE_NON_LOW_END_DEVICE = "Non_Low_En
d_Device"; |
26 | 26 |
27 /** Specifies the test is only valid on a device that can reach the internet
. */ | 27 /** Specifies the test is only valid on a device that can reach the internet
. */ |
28 public static final String RESTRICTION_TYPE_INTERNET = "Internet"; | 28 public static final String RESTRICTION_TYPE_INTERNET = "Internet"; |
29 | 29 |
30 /** | 30 /** |
31 * @return A list of restrictions. | 31 * @return A list of restrictions. |
32 */ | 32 */ |
33 public String[] value(); | 33 public String[] value(); |
34 } | 34 } |
OLD | NEW |