Commit 3668db8d authored by Wei-Yin Chen (陳威尹)'s avatar Wei-Yin Chen (陳威尹) Committed by Commit Bot

Update JavaDoc about DisableIf and Restriction annotations

Bug: None
Change-Id: Ic31d39ee8be716b4829049db7770ffc1fd1c3273
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2325428Reviewed-by: default avatarYaron Friedman <yfriedman@chromium.org>
Commit-Queue: Yaron Friedman <yfriedman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#793184}
parent a5d47322
......@@ -19,13 +19,22 @@ import java.lang.annotation.Target;
*
* When this annotation is specified multiple times, each condition is 'or'ed together. In the
* following either baz or sdk > 22 will cause the test case to be disabled.
* @DisableIf.Build(supported_abis_includes = "baz")
* @DisableIf.Build(sdk_is_greater_than = 22)
* <code>
* \@DisableIf.Build(supported_abis_includes = "baz")
* \@DisableIf.Build(sdk_is_greater_than = 22)
* </code>
* In the following either baz or tablet will cause the test case to be disabled.
* <code>
* \@DisableIf.Build(supported_abis_includes = "baz")
* \@DisableIf.Device(type = {UiDisableIf.TABLET})
* </code>
*
* When multiple arguments are specified for a single annotation, each condition is 'and'ed
* together. In the following both baz and sdk > 22 will need to be true for this test case to be
* disabled.
* @DisableIf.Build(supported_abis_includes = "baz", sdk_is_greater_than = 22)
* <code>
* \@DisableIf.Build(supported_abis_includes = "baz", sdk_is_greater_than = 22)
* </code>
*/
public class DisableIf {
/** Containing annotations type to wrap {@link DisableIf.Build}. */
......
......@@ -11,9 +11,13 @@ 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({RESTRICTION_TYPE_PHONE, RESTRICTION_TYPE_SMALL_MEMORY})
* applicable on a low-end phone:
* <code>
* \@Restriction({UiRestriction.RESTRICTION_TYPE_PHONE, RESTRICTION_TYPE_LOW_END_DEVICE})
* </code>
* See {@link org.chromium.ui.test.util.UiRestriction} for more restriction types.
* Test classes are free to define restrictions and enforce them using reflection at runtime.
* If the test is temporarily failing in some configurations, use {@link DisableIf} instead.
*/
@Target({ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
......
......@@ -4,10 +4,14 @@
package org.chromium.ui.test.util;
import org.chromium.base.test.util.Restriction;
/**
* UiRestrictions list form factor restrictions, that are usable with
* the @Restriction enum in layers depending on //ui.
* E.g. @Restriction({UiRestriction.RESTRICTION_TYPE_PHONE})
* the {@link Restriction} annotation in layers depending on //ui.
* E.g. <code>
* \@Restriction({UiRestriction.RESTRICTION_TYPE_PHONE})
* </code>
*/
public final class UiRestriction {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment