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

Side by Side Diff: base/test/android/javatests/src/org/chromium/base/test/BaseJUnit4ClassRunner.java

Issue 2854823007: Move screenshot capture to Java-side. (Closed)
Patch Set: Move screenshot capture to Java-side. Created 3 years, 7 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 unified diff | Download patch
OLDNEW
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
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 return super.withAfters(method, test, new ScreenshotOnFailureStatement(b ase));
the real yoland 2017/05/09 15:23:28 nit: would be great to add some comments here to n
mikecase (-- gone --) 2017/05/10 02:55:10 Done
164 }
159 } 165 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698