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

Unified Diff: chrome/android/javatests/src/org/chromium/chrome/browser/ChromeTestCommandLineInitRule.java

Issue 2778103002: Alternative: Convert Chrome NativeLibraryTestBase tests example (Closed)
Patch Set: change BUILD.gn Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/android/javatests/src/org/chromium/chrome/browser/ChromeTestCommandLineInitRule.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/ChromeTestCommandLineInitRule.java b/chrome/android/javatests/src/org/chromium/chrome/browser/ChromeTestCommandLineInitRule.java
new file mode 100644
index 0000000000000000000000000000000000000000..8a2cb28affdb35d2bdb0267f4a9dd8d6ea82dff4
--- /dev/null
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/ChromeTestCommandLineInitRule.java
@@ -0,0 +1,33 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.chrome.browser;
+
+import org.junit.rules.TestRule;
+import org.junit.runner.Description;
+import org.junit.runners.model.Statement;
+
+import org.chromium.base.CommandLine;
+import org.chromium.base.test.SetUpTestRule;
+
+public class ChromeTestCommandLineInitRule
+ implements TestRule, SetUpTestRule<ChromeTestCommandLineInitRule> {
+ private boolean mShouldSetUp;
+
+ @Override
+ public ChromeTestCommandLineInitRule shouldSetUp(boolean runSetUp) {
+ mShouldSetUp = runSetUp;
+ return this;
+ }
+
+ @Override
+ public void setUp() {
+ CommandLine.init(null);
+ }
+
+ @Override
+ public Statement apply(Statement base, Description description) {
+ return new SetUpTestRule.SetUpStatement(base, this, mShouldSetUp);
+ }
+}
« no previous file with comments | « chrome/android/java_sources.gni ('k') | chrome/android/javatests/src/org/chromium/chrome/browser/IntentHandlerTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698