OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.base.test; | 5 package org.chromium.base.test; |
6 | 6 |
7 import android.content.Context; | 7 import android.content.Context; |
8 import android.support.test.InstrumentationRegistry; | 8 import android.support.test.InstrumentationRegistry; |
9 import android.support.test.internal.runner.junit4.AndroidJUnit4ClassRunner; | 9 import android.support.test.internal.runner.junit4.AndroidJUnit4ClassRunner; |
10 import android.support.test.internal.util.AndroidRunnerParams; | 10 import android.support.test.internal.util.AndroidRunnerParams; |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 new RestrictionSkipCheck(InstrumentationRegistry.getTargetContext())
, | 112 new RestrictionSkipCheck(InstrumentationRegistry.getTargetContext())
, |
113 new MinAndroidSdkLevelSkipCheck(), | 113 new MinAndroidSdkLevelSkipCheck(), |
114 new DisableIfSkipCheck() | 114 new DisableIfSkipCheck() |
115 }); | 115 }); |
116 } | 116 } |
117 | 117 |
118 /** | 118 /** |
119 * Change this static function to add or take out default {@code PreTestHook
}s. | 119 * Change this static function to add or take out default {@code PreTestHook
}s. |
120 */ | 120 */ |
121 private static List<PreTestHook> defaultPreTestHooks() { | 121 private static List<PreTestHook> defaultPreTestHooks() { |
122 return new ArrayList<PreTestHook>(); | 122 return null; |
123 } | 123 } |
124 | 124 |
125 /** | 125 /** |
126 * Evaluate whether a FrameworkMethod is ignored based on {@code SkipCheck}s
. | 126 * Evaluate whether a FrameworkMethod is ignored based on {@code SkipCheck}s
. |
127 */ | 127 */ |
128 @Override | 128 @Override |
129 protected boolean isIgnored(FrameworkMethod method) { | 129 protected boolean isIgnored(FrameworkMethod method) { |
130 return super.isIgnored(method) || shouldSkip(method); | 130 return super.isIgnored(method) || shouldSkip(method); |
131 } | 131 } |
132 | 132 |
(...skipping 19 matching lines...) Expand all Loading... |
152 */ | 152 */ |
153 private boolean shouldSkip(FrameworkMethod method) { | 153 private boolean shouldSkip(FrameworkMethod method) { |
154 for (SkipCheck s : mSkipChecks) { | 154 for (SkipCheck s : mSkipChecks) { |
155 if (s.shouldSkip(method)) { | 155 if (s.shouldSkip(method)) { |
156 return true; | 156 return true; |
157 } | 157 } |
158 } | 158 } |
159 return false; | 159 return false; |
160 } | 160 } |
161 } | 161 } |
OLD | NEW |