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

Unified Diff: dart/editor/tools/plugins/com.google.dart.tools.debug.core/src/com/google/dart/tools/debug/core/mobile/MobileLaunchConfigurationDelegate.java

Issue 337623003: Version 1.5.0-dev.4.11 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/
Patch Set: Created 6 years, 6 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: dart/editor/tools/plugins/com.google.dart.tools.debug.core/src/com/google/dart/tools/debug/core/mobile/MobileLaunchConfigurationDelegate.java
===================================================================
--- dart/editor/tools/plugins/com.google.dart.tools.debug.core/src/com/google/dart/tools/debug/core/mobile/MobileLaunchConfigurationDelegate.java (revision 37301)
+++ dart/editor/tools/plugins/com.google.dart.tools.debug.core/src/com/google/dart/tools/debug/core/mobile/MobileLaunchConfigurationDelegate.java (working copy)
@@ -16,6 +16,7 @@
import com.google.dart.engine.utilities.instrumentation.InstrumentationBuilder;
import com.google.dart.tools.core.mobile.AndroidDebugBridge;
import com.google.dart.tools.core.mobile.AndroidDevice;
+import com.google.dart.tools.core.mobile.MobileUrlConnectionException;
import com.google.dart.tools.debug.core.DartDebugCorePlugin;
import com.google.dart.tools.debug.core.DartLaunchConfigWrapper;
import com.google.dart.tools.debug.core.DartLaunchConfigurationDelegate;
@@ -106,9 +107,12 @@
try {
String launchUrl = result.getResult();
launchOnMobile(launchUrl, true, new NullProgressMonitor());
+ } catch (MobileUrlConnectionException e) {
+ // DartDebugCorePlugin.logError(e);
+ DebugUIHelper.getHelper().showError("Dartium Launch Error", e);
} catch (CoreException e) {
DartDebugCorePlugin.logError(e);
- DebugUIHelper.getHelper().showError("Dartium Launch Error", e.getMessage());
+ DebugUIHelper.getHelper().showError("Dartium Launch Error", e);
}
}
@@ -230,8 +234,14 @@
"Unauthorized device detected.\n\nAuthorize device and try again."));
}
+ if (!devBridge.isHtmlPageAccessible(device, launchUrl).isOK()) {
+ // pub serve is always localhost over USB while old dev server is always over wifi
+ boolean localhostOverUsb = usePubServe;
+ throw new MobileUrlConnectionException(launchUrl, localhostOverUsb);
+ }
+
if (wrapper.getInstallContentShell()) {
- if (!devBridge.installContentShellApk(device.getDeviceId())) {
+ if (!devBridge.installContentShellApk(device)) {
throw new CoreException(new Status(
IStatus.ERROR,
DartDebugCorePlugin.PLUGIN_ID,
@@ -243,7 +253,12 @@
// check if remote connection is alive
if (!isRemoteConnected()) {
devBridge.setupPortForwarding(Integer.toString(REMOTE_DEBUG_PORT));
- // TODO(keertip): check if host needs to be the ip for wifi connections
+ // wait for content shell to open to get the tabs to connect
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException e) {
+
+ }
performRemoteConnection("localhost", REMOTE_DEBUG_PORT, monitor, usePubServe);
}
}

Powered by Google App Engine
This is Rietveld 408576698