anchor.diff:            });
       }).then((msg) {
         monitor.worked(6);
  -      String resp = new String.fromCharCodes(msg);
  -      List<String> lines = resp.split('\r\n');
  -      Iterable<String> header = lines.takeWhile((l) => l.isNotEmpty);
  -      String body = lines.skip(header.length + 1).join('<br>\n');
  -
  -      if (header.first.indexOf('200') < 0) {
  -        // Error! Fail with the error line.
  -        return new Future.error(
  -            '${header.first.substring(header.first.indexOf(' ') + 1)}: $body');
  -      } else {
  -        return new Future.value(body);
  -      }
  -    })
  -    .then((String response) {
  +      return _expectHttpOkResponse(msg);
  +    }).then((String response) {
         monitor.worked(8);
         httpRequest = _buildLaunchRequest('localhost');
         return _device.sendHttpRequest(httpRequest, 2424).timeout(
  
positive.code:                 'Push timed out: Total time exceeds 5 minutes');
            });
      }).then((List<int> msg) {
        if (msg.length != 0) {
          return new Future.error("Unexpected response from App Dev Tool");
        }
      }).whenComplete(() {
        if (_device != null) _device.dispose();
      });
  
negative.code:     // Start ADT on the device.
      //return client.startActivity(AdbApplication.CHROME_ADT);
  
  
  
      // TODO: a SocketException, code == -100 here often means that the App Dev
      // Tool is not running on the device.
      // Setup port forwarding to 2424 on the device.
      return client.forwardTcp(2424, 2424).then((_) {
        // Push the app binary to port 2424.
  