diff --git a/src/test/java/com/android/tools/r8/keepanno/KeepFieldValueApiTest.java b/src/test/java/com/android/tools/r8/keepanno/KeepFieldValueApiTest.java
index 61c4e54..dfca281 100644
--- a/src/test/java/com/android/tools/r8/keepanno/KeepFieldValueApiTest.java
+++ b/src/test/java/com/android/tools/r8/keepanno/KeepFieldValueApiTest.java
@@ -3,16 +3,18 @@
 // BSD-style license that can be found in the LICENSE file.
 package com.android.tools.r8.keepanno;
 
+import static com.android.tools.r8.utils.codeinspector.Matchers.isAbsent;
 import static com.android.tools.r8.utils.codeinspector.Matchers.isPresent;
 import static org.hamcrest.MatcherAssert.assertThat;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assume.assumeFalse;
+import static org.junit.Assume.assumeTrue;
 
-import com.android.tools.r8.TestBase;
-import com.android.tools.r8.TestParameters;
-import com.android.tools.r8.TestParametersCollection;
 import com.android.tools.r8.keepanno.annotations.KeepForApi;
 import com.android.tools.r8.keepanno.annotations.KeepItemKind;
 import com.android.tools.r8.keepanno.annotations.KeepTarget;
 import com.android.tools.r8.utils.AndroidApiLevel;
+import com.android.tools.r8.utils.Box;
 import com.android.tools.r8.utils.StringUtils;
 import com.android.tools.r8.utils.codeinspector.ClassSubject;
 import com.android.tools.r8.utils.codeinspector.CodeInspector;
@@ -22,53 +24,55 @@
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameter;
 
 @RunWith(Parameterized.class)
-public class KeepFieldValueApiTest extends TestBase {
+public class KeepFieldValueApiTest extends KeepAnnoTestBase {
 
   static final String EXPECTED = StringUtils.lines("B::foo");
 
-  private final TestParameters parameters;
+  @Parameter public KeepAnnoParameters parameters;
 
   @Parameterized.Parameters(name = "{0}")
-  public static TestParametersCollection data() {
-    return getTestParameters()
-        .withDefaultRuntimes()
-        .withApiLevel(AndroidApiLevel.B)
-        .enableApiLevelsForCf()
-        .build();
-  }
-
-  public KeepFieldValueApiTest(TestParameters parameters) {
-    this.parameters = parameters;
+  public static List<KeepAnnoParameters> data() {
+    return createParameters(
+        getTestParameters()
+            .withDefaultRuntimes()
+            .withApiLevel(AndroidApiLevel.B)
+            .enableApiLevelsForCf()
+            .build());
   }
 
   @Test
   public void testReference() throws Exception {
-    testForRuntime(parameters)
+    assumeTrue(parameters.isReference());
+    testForKeepAnno(parameters)
         .addProgramClasses(getLibraryClasses())
         .addProgramClasses(getClientClasses())
-        .run(parameters.getRuntime(), TestClass.class)
+        .run(TestClass.class)
         .assertSuccessWithOutput(EXPECTED);
   }
 
   @Test
-  public void testWithRuleExtraction() throws Exception {
-    Path lib =
-        testForR8(parameters.getBackend())
-            .enableExperimentalKeepAnnotations()
-            .addProgramClasses(getLibraryClasses())
-            .setMinApi(parameters)
-            .compile()
-            .inspect(this::checkLibraryOutput)
-            .writeToZip();
+  public void testShrinker() throws Exception {
+    assumeFalse(parameters.isReference());
+    assertTrue(parameters.isShrinker());
+    Box<Path> lib = new Box<>();
+    testForKeepAnno(parameters)
+        .addProgramClasses(getLibraryClasses())
+        .setExcludedOuterClass(getClass())
+        .applyIfShrinker(b -> lib.set(b.compile().inspect(this::checkLibraryOutput).writeToZip()));
 
     testForD8(parameters.getBackend())
         .addProgramClasses(getClientClasses())
-        .addProgramFiles(lib)
-        .setMinApi(parameters)
+        .addProgramFiles(lib.get())
+        .setMinApi(parameters.parameters())
         .run(parameters.getRuntime(), TestClass.class)
-        .assertSuccessWithOutput(EXPECTED);
+        // TODO(b/322104143): The -keepclasseswithmembers rule does not keep B and its members.
+        .applyIf(
+            parameters.isPG(),
+            r -> r.assertFailureWithErrorThatThrows(ClassNotFoundException.class),
+            r -> r.assertSuccessWithOutput(EXPECTED));
   }
 
   public List<Class<?>> getLibraryClasses() {
@@ -84,6 +88,11 @@
     assertThat(aClass, isPresent());
     assertThat(aClass.uniqueFieldWithFinalName("CLASS"), isPresent());
     ClassSubject bClass = inspector.clazz(B.class);
+    if (parameters.isPG()) {
+      // TODO(b/322104143): The -keepclasseswithmembers rule does not keep B and its members.
+      assertThat(bClass, isAbsent());
+      return;
+    }
     assertThat(bClass, isPresent());
     assertThat(bClass.uniqueMethodWithOriginalName("foo"), isPresent());
     assertThat(bClass.uniqueMethodWithOriginalName("bar"), isPresent());
