Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4685)

Unified Diff: chrome/test/android/javatests/src/org/chromium/chrome/test/ChromeJUnit4ClassRunner.java

Issue 2760153002: Convert chrome compositor test's InstrumentationTestCases (Closed)
Patch Set: Address comments Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/android/javatests/src/org/chromium/chrome/test/ChromeInstrumentationTestRunner.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/android/javatests/src/org/chromium/chrome/test/ChromeJUnit4ClassRunner.java
diff --git a/chrome/test/android/javatests/src/org/chromium/chrome/test/ChromeJUnit4ClassRunner.java b/chrome/test/android/javatests/src/org/chromium/chrome/test/ChromeJUnit4ClassRunner.java
new file mode 100644
index 0000000000000000000000000000000000000000..e063ca25abc5925b4890e16e31ec0abf48211dd5
--- /dev/null
+++ b/chrome/test/android/javatests/src/org/chromium/chrome/test/ChromeJUnit4ClassRunner.java
@@ -0,0 +1,37 @@
+// Copyright 2017 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.chrome.test;
+
+import android.support.test.InstrumentationRegistry;
+
+import org.junit.runners.model.InitializationError;
+
+import org.chromium.base.test.BaseJUnit4ClassRunner;
+import org.chromium.base.test.util.SkipCheck;
+import org.chromium.chrome.test.ChromeInstrumentationTestRunner.ChromeDisableIfSkipCheck;
+import org.chromium.chrome.test.ChromeInstrumentationTestRunner.ChromeRestrictionSkipCheck;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * A custom runner for //chrome JUnit4 tests.
+ */
+public class ChromeJUnit4ClassRunner extends BaseJUnit4ClassRunner {
+ /**
+ * Create a ChromeJUnit4ClassRunner to run {@code klass} and initialize values
+ *
+ * @throws InitializationError if the test class malformed
+ */
+ public ChromeJUnit4ClassRunner(final Class<?> klass) throws InitializationError {
+ super(klass, defaultSkipChecks(), null);
+ }
+
+ private static List<SkipCheck> defaultSkipChecks() {
+ return Arrays.asList(new SkipCheck[] {
+ new ChromeRestrictionSkipCheck(InstrumentationRegistry.getTargetContext()),
+ new ChromeDisableIfSkipCheck(InstrumentationRegistry.getTargetContext())});
+ }
+}
« no previous file with comments | « chrome/test/android/javatests/src/org/chromium/chrome/test/ChromeInstrumentationTestRunner.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698