Chromium Code Reviews| 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; |
| 11 | 11 |
| 12 import org.junit.runner.notification.RunNotifier; | 12 import org.junit.runner.notification.RunNotifier; |
| 13 import org.junit.runners.model.FrameworkMethod; | 13 import org.junit.runners.model.FrameworkMethod; |
| 14 import org.junit.runners.model.InitializationError; | 14 import org.junit.runners.model.InitializationError; |
| 15 import org.junit.runners.model.Statement; | |
| 15 | 16 |
| 16 import org.chromium.base.CollectionUtil; | 17 import org.chromium.base.CollectionUtil; |
| 17 import org.chromium.base.test.BaseTestResult.PreTestHook; | 18 import org.chromium.base.test.BaseTestResult.PreTestHook; |
| 18 import org.chromium.base.test.util.DisableIfSkipCheck; | 19 import org.chromium.base.test.util.DisableIfSkipCheck; |
| 19 import org.chromium.base.test.util.MinAndroidSdkLevelSkipCheck; | 20 import org.chromium.base.test.util.MinAndroidSdkLevelSkipCheck; |
| 20 import org.chromium.base.test.util.RestrictionSkipCheck; | 21 import org.chromium.base.test.util.RestrictionSkipCheck; |
| 21 import org.chromium.base.test.util.SkipCheck; | 22 import org.chromium.base.test.util.SkipCheck; |
| 22 | 23 |
| 23 import java.lang.reflect.Method; | 24 import java.lang.reflect.Method; |
| 24 import java.util.ArrayList; | 25 import java.util.ArrayList; |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 149 * Loop through all the {@code SkipCheck}s to confirm whether a test should be ignored | 150 * Loop through all the {@code SkipCheck}s to confirm whether a test should be ignored |
| 150 */ | 151 */ |
| 151 private boolean shouldSkip(FrameworkMethod method) { | 152 private boolean shouldSkip(FrameworkMethod method) { |
| 152 for (SkipCheck s : mSkipChecks) { | 153 for (SkipCheck s : mSkipChecks) { |
| 153 if (s.shouldSkip(method)) { | 154 if (s.shouldSkip(method)) { |
| 154 return true; | 155 return true; |
| 155 } | 156 } |
| 156 } | 157 } |
| 157 return false; | 158 return false; |
| 158 } | 159 } |
| 160 | |
| 161 @Override | |
| 162 protected Statement withAfters(FrameworkMethod method, Object test, Statemen t base) { | |
| 163 base = new ScreenshotOnFailureStatement(base); | |
| 164 return super.withAfters(method, test, base); | |
|
jbudorick
2017/05/05 01:21:58
nit:
return super.withAfters(method, test, new
mikecase (-- gone --)
2017/05/05 18:09:19
Done!
| |
| 165 } | |
| 159 } | 166 } |
| OLD | NEW |