Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 package org.chromium.chrome.test; | |
| 6 | |
| 7 import android.support.test.InstrumentationRegistry; | |
| 8 | |
| 9 import org.junit.runners.model.InitializationError; | |
| 10 | |
| 11 import org.chromium.base.test.BaseJUnit4ClassRunner; | |
| 12 import org.chromium.base.test.util.SkipCheck; | |
| 13 import org.chromium.chrome.test.ChromeInstrumentationTestRunner.ChromeDisableIfS kipCheck; | |
| 14 import org.chromium.chrome.test.ChromeInstrumentationTestRunner.ChromeRestrictio nSkipCheck; | |
| 15 | |
| 16 import java.util.Arrays; | |
| 17 import java.util.List; | |
| 18 | |
| 19 /** | |
| 20 * A custom runner for JUnit4 tests for chrome java tests | |
|
jbudorick
2017/03/22 15:58:07
nit: A custom runner for //chrome JUnit4 tests.
the real yoland
2017/03/22 17:43:33
Done
| |
| 21 */ | |
| 22 public class ChromeJUnit4ClassRunner extends BaseJUnit4ClassRunner { | |
| 23 /** | |
| 24 * Create a ChromeJUnit4ClassRunner to run {@code klass} and initialize valu es | |
| 25 * | |
| 26 * @throws InitializationError if the test class malformed | |
| 27 */ | |
| 28 public ChromeJUnit4ClassRunner(final Class<?> klass) throws InitializationEr ror { | |
| 29 super(klass, defaultSkipChecks(), null); | |
| 30 } | |
| 31 | |
| 32 private static List<SkipCheck> defaultSkipChecks() { | |
| 33 return Arrays.asList(new SkipCheck[] { | |
| 34 new ChromeRestrictionSkipCheck(InstrumentationRegistry.getTarget Context()), | |
| 35 new ChromeDisableIfSkipCheck(InstrumentationRegistry.getTargetCo ntext())}); | |
| 36 } | |
| 37 } | |
| OLD | NEW |