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

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

Issue 1223263009: Disable hardware acceleration for ChromeActivities on low-end devices. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed DocumentModeTestBase to compile Created 5 years, 5 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/document/DocumentModeTestBase.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/document/DocumentModeTestBase.java b/chrome/android/javatests/src/org/chromium/chrome/browser/document/DocumentModeTestBase.java
index 8b8d79a8a300cfa8ffb821a5d89259a7453ad00a..d7833adca4038dc6f9fd984fcdf16887154b9f69 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/document/DocumentModeTestBase.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/document/DocumentModeTestBase.java
@@ -16,6 +16,7 @@ import org.chromium.base.ThreadUtils;
import org.chromium.base.test.util.MinAndroidSdkLevel;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.ChromeApplication;
+import org.chromium.chrome.browser.ChromeTabbedActivity;
import org.chromium.chrome.browser.IntentHandler;
import org.chromium.chrome.browser.tab.EmptyTabObserver;
import org.chromium.chrome.browser.tab.Tab;
@@ -303,4 +304,25 @@ public class DocumentModeTestBase extends MultiActivityTestBase {
}
}));
}
+
+ /**
+ * Starts ChromeTabbedActivity via intent with the specified URL but
+ * doesn't wait for the URL to load.
+ * @return The started activity.
+ */
+ protected ChromeTabbedActivity startTabbedActivity(final String url) {
+ Runnable runnable = new Runnable() {
+ @Override
+ public void run() {
+ Intent intent = new Intent();
+ intent.setAction(Intent.ACTION_VIEW);
+ intent.setClassName(mContext, ChromeTabbedActivity.class.getName());
+ intent.setData(Uri.parse(url));
+ intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_NEW_DOCUMENT);
+ mContext.startActivity(intent);
+ }
+ };
+ return ActivityUtils.waitForActivity(getInstrumentation(), ChromeTabbedActivity.class,
+ runnable);
+ }
}

Powered by Google App Engine
This is Rietveld 408576698