// Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package org.chromium.base.test.util;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * An annotation for listing restrictions for a test method. For example, if a test method is only
 * applicable on a phone with small memory:
 *     @Restriction({"Phone", "smallMemory"})
 * Test classes are free to define restrictions and enforce them using reflection at runtime.
 */
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface Restriction {
    /**
     * @return A list of restrictions.
     */
    public String[] value();
}
@@ -535,30 +535,61 @@
 on(%7B
-%22Phone%22, %22smallMemory%22
+RESTRICTION_TYPE_PHONE, RESTRICTION_TYPE_SMALL_MEMORY
 %7D)%0A 
@@ -749,16 +749,16 @@
 UNTIME)%0A
-
 public @
@@ -781,16 +781,451 @@
 ction %7B%0A
+    /** Specifies the test is only valid on phone form factors. */%0A    public static final String RESTRICTION_TYPE_PHONE = %22Phone%22;%0A%0A    /** Specifies the test is only valid on tablet form factors. */%0A    public static final String RESTRICTION_TYPE_TABLET = %22Tablet%22;%0A%0A    /** Specifies the test is only valid on devices with a small amount of memory. */%0A    public static final String RESTRICTION_TYPE_SMALL_MEMORY = %22Small_Memory%22;%0A%0A
     /**%0A

Convert from strings to enums for Restrictions.