| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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.testing.local; | 5 package org.chromium.testing.local; |
| 6 | 6 |
| 7 import org.junit.runner.Computer; | 7 import org.junit.runner.Computer; |
| 8 import org.junit.runner.Description; | 8 import org.junit.runner.Description; |
| 9 import org.junit.runner.Runner; | 9 import org.junit.runner.Runner; |
| 10 import org.junit.runner.manipulation.Filter; | 10 import org.junit.runner.manipulation.Filter; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 mLogger.testCaseStarted(mRunner.getDescription(), | 44 mLogger.testCaseStarted(mRunner.getDescription(), |
| 45 mRunner.getDescription().testCount()); | 45 mRunner.getDescription().testCount()); |
| 46 mRunner.run(notifier); | 46 mRunner.run(notifier); |
| 47 mLogger.testCaseFinished(mRunner.getDescription(), | 47 mLogger.testCaseFinished(mRunner.getDescription(), |
| 48 mRunner.getDescription().testCount(), | 48 mRunner.getDescription().testCount(), |
| 49 System.currentTimeMillis() - startTimeMillis); | 49 System.currentTimeMillis() - startTimeMillis); |
| 50 } | 50 } |
| 51 | 51 |
| 52 public void filter(Filter filter) throws NoTestsRemainException { | 52 public void filter(Filter filter) throws NoTestsRemainException { |
| 53 if (mRunner instanceof Filterable) { | 53 if (mRunner instanceof Filterable) { |
| 54 ((Filterable)mRunner).filter(filter); | 54 ((Filterable) mRunner).filter(filter); |
| 55 } | 55 } |
| 56 } | 56 } |
| 57 } | 57 } |
| 58 | 58 |
| 59 /** | 59 /** |
| 60 * Returns a suite of unit tests with each class runner wrapped by a | 60 * Returns a suite of unit tests with each class runner wrapped by a |
| 61 * GtestSuiteRunner. | 61 * GtestSuiteRunner. |
| 62 */ | 62 */ |
| 63 @Override | 63 @Override |
| 64 public Runner getSuite(final RunnerBuilder builder, Class<?>[] classes) | 64 public Runner getSuite(final RunnerBuilder builder, Class<?>[] classes) |
| 65 throws InitializationError { | 65 throws InitializationError { |
| 66 return super.getSuite( | 66 return super.getSuite( |
| 67 new RunnerBuilder() { | 67 new RunnerBuilder() { |
| 68 @Override | 68 @Override |
| 69 public Runner runnerForClass(Class<?> testClass) throws Thro
wable { | 69 public Runner runnerForClass(Class<?> testClass) throws Thro
wable { |
| 70 return new GtestSuiteRunner(builder.runnerForClass(testC
lass)); | 70 return new GtestSuiteRunner(builder.runnerForClass(testC
lass)); |
| 71 } | 71 } |
| 72 }, classes); | 72 }, classes); |
| 73 } | 73 } |
| 74 | 74 |
| 75 } | 75 } |
| 76 | 76 |
| OLD | NEW |