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.base.test; | |
| 6 | |
| 7 import org.junit.rules.TestRule; | |
| 8 | |
| 9 /** | |
|
jbudorick
2017/04/10 19:08:45
This comment should mention the relation to SetUpS
the real yoland
2017/04/12 00:52:34
Done
| |
| 10 * Interface to ensure TestRule that implements it specifies if it would run a s et-up process | |
| 11 * before @Before. | |
| 12 * | |
| 13 * @param <T> TestRule type that implements this SetUpTestRule | |
| 14 */ | |
| 15 public interface SetUpTestRule<T extends TestRule> { | |
| 16 /** | |
| 17 * Set whether the TestRule should run setUp automatically. | |
| 18 * | |
| 19 * So TestRule can be declared in test like this: | |
| 20 * <code> | |
| 21 * @Rule TestRule mRule = new MySetUpTestRule().shouldSetUp(true); | |
| 22 * </code> | |
| 23 * | |
| 24 * @return itself to chain up the calls for convenience | |
| 25 */ | |
| 26 T shouldSetUp(boolean runSetUp); | |
| 27 | |
| 28 /** | |
| 29 * Specify setUp action in this method | |
| 30 */ | |
| 31 void setUp(); | |
| 32 } | |
| OLD | NEW |