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.chrome.browser; |
| 6 |
| 7 import org.junit.rules.TestRule; |
| 8 import org.junit.runner.Description; |
| 9 import org.junit.runners.model.Statement; |
| 10 |
| 11 import org.chromium.base.CommandLine; |
| 12 import org.chromium.base.test.SetUpTestRule; |
| 13 |
| 14 public class ChromeTestCommandLineInitRule |
| 15 implements TestRule, SetUpTestRule<ChromeTestCommandLineInitRule> { |
| 16 private boolean mShouldSetUp; |
| 17 |
| 18 @Override |
| 19 public ChromeTestCommandLineInitRule shouldSetUp(boolean runSetUp) { |
| 20 mShouldSetUp = runSetUp; |
| 21 return this; |
| 22 } |
| 23 |
| 24 @Override |
| 25 public void setUp() { |
| 26 CommandLine.init(null); |
| 27 } |
| 28 |
| 29 @Override |
| 30 public Statement apply(Statement base, Description description) { |
| 31 return new SetUpTestRule.SetUpStatement(base, this, mShouldSetUp); |
| 32 } |
| 33 } |
OLD | NEW |