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

Unified Diff: content/shell/android/javatests/src/org/chromium/content_shell_apk/ContentShellActivityTestRule.java

Issue 2739603003: Add TestRules for content shell test and refactor test bases (Closed)
Patch Set: Address +boliu's comments 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: content/shell/android/javatests/src/org/chromium/content_shell_apk/ContentShellActivityTestRule.java
diff --git a/content/shell/android/javatests/src/org/chromium/content_shell_apk/ContentShellActivityTestRule.java b/content/shell/android/javatests/src/org/chromium/content_shell_apk/ContentShellActivityTestRule.java
index df1fcdf9b579506327b93ae2eaa4ddd6cd7073f0..c1ca6228200dc719e6084b02e376a2556a3cf2ee 100644
--- a/content/shell/android/javatests/src/org/chromium/content_shell_apk/ContentShellActivityTestRule.java
+++ b/content/shell/android/javatests/src/org/chromium/content_shell_apk/ContentShellActivityTestRule.java
@@ -52,26 +52,6 @@ public class ContentShellActivityTestRule extends ActivityTestRule<ContentShellA
}
@Override
- public ContentShellActivity getActivityForTestCommon() {
- return getActivity();
- }
-
- @Override
- public Instrumentation getInstrumentationForTestCommon() {
- return InstrumentationRegistry.getInstrumentation();
- }
-
- @Override
- public ContentShellActivity launchActivityWithIntentForTestCommon(Intent t) {
- return launchActivity(t);
- }
-
- @Override
- public void runOnUiThreadForTestCommon(Runnable runnable) throws Throwable {
- runOnUiThread(runnable);
- }
-
- @Override
protected void beforeActivityLaunched() {
mDelegate.assertScreenIsOn();
}
@@ -181,4 +161,44 @@ public class ContentShellActivityTestRule extends ActivityTestRule<ContentShellA
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface RerunWithUpdatedContainerView {}
+
+ @Override
+ public ContentShellActivity getActivityForTestCommon() {
+ return getActivity();
+ }
+
+ @Override
+ public Instrumentation getInstrumentationForTestCommon() {
+ return InstrumentationRegistry.getInstrumentation();
+ }
+
+ @Override
+ public ContentShellActivity launchActivityWithIntentForTestCommon(Intent t) {
+ return launchActivity(t);
+ }
+
+ @Override
+ public void runOnUiThreadForTestCommon(Runnable runnable) throws Throwable {
+ runOnUiThread(runnable);
+ }
+
+ @Override
+ public ContentViewCore getContentViewCoreForTestCommon() {
+ return getContentViewCore();
+ }
+
+ @Override
+ public WebContents getWebContentsForTestCommon() {
+ return getWebContents();
+ }
+
+ @Override
+ public void waitForActiveShellToBeDoneLoadingForTestCommon() {
+ waitForActiveShellToBeDoneLoading();
+ }
+
+ @Override
+ public ContentShellActivity launchContentShellWithUrlForTestCommon(String url) {
+ return launchContentShellWithUrl(url);
+ }
}

Powered by Google App Engine
This is Rietveld 408576698