1 package com.google.android.apps.common.testing.accessibility.framework.integrations.espresso; 2 3 import com.google.android.apps.common.testing.accessibility.framework.AccessibilityViewCheckResult; 4 import com.google.auto.value.AutoValue; 5 import com.google.common.collect.ImmutableList; 6 import org.checkerframework.checker.nullness.qual.Nullable; 7 8 /** Data passed to a listener after one evaluation of accessibility checks. */ 9 @AutoValue 10 public abstract class CheckResultsCallback { 11 12 /** 13 * Results from the evaluation of checks. This may include results whose {@code getType} returns 14 * {@code NOT_RUN} or {@code SUPPRESSED} if a suppressing result matcher was specified. 15 */ getAccessibilityViewCheckResults()16 public abstract ImmutableList<AccessibilityViewCheckResult> getAccessibilityViewCheckResults(); 17 18 /** Path to a screenshot if one was captured and saved to a file. */ getScreenshotPath()19 public abstract @Nullable String getScreenshotPath(); 20 builder()21 public static Builder builder() { 22 return new AutoValue_CheckResultsCallback.Builder(); 23 } 24 25 /** Builder for CheckResultsCallback. */ 26 @AutoValue.Builder 27 public abstract static class Builder { 28 setAccessibilityViewCheckResults( ImmutableList<AccessibilityViewCheckResult> results)29 public abstract Builder setAccessibilityViewCheckResults( 30 ImmutableList<AccessibilityViewCheckResult> results); 31 setScreenshotPath(@ullable String screenshotPath)32 public abstract Builder setScreenshotPath(@Nullable String screenshotPath); 33 build()34 public abstract CheckResultsCallback build(); 35 } 36 } 37