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

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

Issue 2770393002: Add setup action interface (Closed)
Patch Set: address comments Created 3 years, 8 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
« no previous file with comments | « base/test/android/javatests/src/org/chromium/base/test/SetUpStatement.java ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 /**
10 * Interface to ensure TestRule that implements it specifies if it would run a s et-up process
jbudorick 2017/04/12 13:04:03 An interface for TestRules that can be configured
the real yoland 2017/04/12 20:56:19 Done
11 * before @Before.
12 *
13 * TestRule that implements this interface should return a {@link SetUpStatement } with
jbudorick 2017/04/12 13:04:03 TestRules that implement this interface should ret
the real yoland 2017/04/12 20:56:19 Done
14 * its {@link TestRule#apply} method.
15 *
16 * @param <T> TestRule type that implements this SetUpTestRule
17 */
18 public interface SetUpTestRule<T extends TestRule> {
19 /**
20 * Set whether the TestRule should run setUp automatically.
21 *
22 * So TestRule can be declared in test like this:
23 * <code>
24 * &#064;Rule TestRule mRule = new MySetUpTestRule().shouldSetUp(true);
25 * </code>
26 *
27 * @return itself to chain up the calls for convenience
28 */
29 T shouldSetUp(boolean runSetUp);
30
31 /**
32 * Specify setUp action in this method
33 */
34 void setUp();
35 }
OLDNEW
« no previous file with comments | « base/test/android/javatests/src/org/chromium/base/test/SetUpStatement.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698