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

Unified Diff: tools/testing/dart/browser_controller.dart

Issue 43773005: Adds test target for Dartium on Android. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 2 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
« no previous file with comments | « no previous file | tools/testing/dart/test_options.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testing/dart/browser_controller.dart
===================================================================
--- tools/testing/dart/browser_controller.dart (revision 29259)
+++ tools/testing/dart/browser_controller.dart (working copy)
@@ -576,6 +576,44 @@
}
+class DartiumOnAndroid extends Browser {
+ static const String viewAction = 'android.intent.action.VIEW';
+ static const String dartiumPackage = 'com.google.android.apps.chrome';
+
+ AdbDevice _adbDevice;
+
+ DartiumOnAndroid(this._adbDevice);
+
+ Future<bool> start(String url) {
+ var dartiumIntent = new Intent(
+ viewAction, dartiumPackage, '.Main', url);
+
+ return _adbDevice.waitForBootCompleted().then((_) {
+ return _adbDevice.forceStop(dartiumIntent.package);
+ }).then((_) {
+ return _adbDevice.killAll();
+ }).then((_) {
+ return _adbDevice.adbRoot();
+ }).then((_) {
+ return _adbDevice.setProp("DART_FORWARDING_PRINT", "1");
+ }).then((_) {
+ return _adbDevice.startActivity(dartiumIntent).then((_) => true);
+ });
+ }
+
+ Future<bool> close() {
+ if (_adbDevice != null) {
+ return _adbDevice.forceStop(dartiumPackage).then((_) {
+ return _adbDevice.killAll().then((_) => true);
+ });
+ }
+ return new Future.value(true);
+ }
+
+ String toString() => "DartiumOnAndroid";
+}
kustermann 2013/10/25 19:23:03 We have now three of these classes with similar fu
zra 2013/10/25 21:33:34 I'm not comfortable modifying AndroidChrome since
+
+
class Firefox extends Browser {
static const String enablePopUp =
'user_pref("dom.disable_open_during_load", false);';
@@ -770,6 +808,8 @@
'chromeOnAndroid' : (AdbDevice device) => new AndroidChrome(device),
'ContentShellOnAndroid' : (AdbDevice device) =>
new ContentShellOnAndroid(device),
+ 'DartiumOnAndroid' : (AdbDevice device) =>
+ new DartiumOnAndroid(device),
};
if (androidBrowserCreationMapping.containsKey(browserName)) {
AdbHelper.listDevices().then((deviceIds) {
@@ -894,6 +934,8 @@
browser = new AndroidChrome(adbDeviceMapping[id]);
} else if (browserName == 'ContentShellOnAndroid') {
browser = new ContentShellOnAndroid(adbDeviceMapping[id]);
+ } else if (browserName == 'DartiumOnAndroid') {
+ browser = new DartiumOnAndroid(adbDeviceMapping[id]);
} else {
browserStatus.remove(id);
browser = getInstance();
« no previous file with comments | « no previous file | tools/testing/dart/test_options.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698