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

Unified Diff: pkg/webdriver/lib/webdriver.dart

Issue 11783009: Big merge from experimental to bleeding edge. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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 | « pkg/unittest/lib/unittest.dart ('k') | runtime/bin/builtin.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/webdriver/lib/webdriver.dart
diff --git a/pkg/webdriver/lib/webdriver.dart b/pkg/webdriver/lib/webdriver.dart
index 8291db842d1a13b821d11e9a24ad0397f607e4c9..0dbbae4dbb4ed8d947196a916837205cf8569e13 100644
--- a/pkg/webdriver/lib/webdriver.dart
+++ b/pkg/webdriver/lib/webdriver.dart
@@ -4,10 +4,9 @@
library webdriver;
-import 'dart:json';
+import 'dart:json' as json;
import 'dart:uri';
import 'dart:io';
-import 'dart:math';
part 'src/base64decoder.dart';
@@ -207,7 +206,7 @@ class WebDriverBase {
_path = matches[2];
var idx = _host.indexOf(':');
if (idx >= 0) {
- _port = parseInt(_host.substring(idx+1));
+ _port = int.parse(_host.substring(idx+1));
_host = _host.substring(0, idx);
} else {
_port = 80;
@@ -241,7 +240,7 @@ class WebDriverBase {
throw new Exception(
'The http method called for ${command} is ${http_method} but it has '
'to be POST if you want to pass the JSON params '
- '${JSON.stringify(params)}');
+ '${json.stringify(params)}');
}
var path = command;
@@ -258,7 +257,7 @@ class WebDriverBase {
HttpHeaders.CONTENT_TYPE, 'application/json;charset=UTF-8');
OutputStream s = r.outputStream;
if (params != null && params is Map) {
- s.writeString(JSON.stringify(params));
+ s.writeString(json.stringify(params));
}
s.close();
};
@@ -282,7 +281,7 @@ class WebDriverBase {
var value = null;
results = sbuf.toString().trim();
// For some reason we get a bunch of NULs on the end
- // of the text and the JSON parser blows up on these, so
+ // of the text and the json.parse blows up on these, so
// strip them. We have to do this the hard way as
// replaceAll('\0', '') does not work.
// These NULs can be seen in the TCP packet, so it is not
@@ -301,7 +300,7 @@ class WebDriverBase {
if (status == 0 && results.length > 0) {
// 4xx responses send plain text; others send JSON.
if (r.statusCode < 400) {
- results = JSON.parse(results);
+ results = json.parse(results);
status = results['status'];
}
if (results is Map && (results as Map).containsKey('value')) {
« no previous file with comments | « pkg/unittest/lib/unittest.dart ('k') | runtime/bin/builtin.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698