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

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

Issue 14997015: trim() does not remove the trailing null characters. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixes for webdriver.dart Created 7 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
« no previous file with comments | « no previous file | no next file » | 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 724332d959d10ee7496c866a891ea2db91301d4f..7cfabe607e27abde81d073a880e1739ee45cb064 100644
--- a/pkg/webdriver/lib/webdriver.dart
+++ b/pkg/webdriver/lib/webdriver.dart
@@ -285,11 +285,12 @@ class WebDriverBase {
var value = null;
// For some reason we get a bunch of NULs on the end
// of the text and the json.parse blows up on these, so
- // strip them with trim().
+ // strip them.
// These NULs can be seen in the TCP packet, so it is not
// an issue with character encoding; it seems to be a bug
// in WebDriver stack.
- results = new String.fromCharCodes(body).trim();
+ results = new String.fromCharCodes(body)
+ .replaceAll(new RegExp('\u{0}*\$'), '');
if (!successCodes.contains(rsp.statusCode)) {
_failRequest(completer,
'Unexpected response ${rsp.statusCode}; $results');
@@ -882,9 +883,9 @@ class WebDriverSession extends WebDriverBase {
* Potential Errors: NoSuchWindow, XPathLookupError.
*/
Future<String>
- findElementFromId(String id, String strategy, String searchValue) {
- _post('element/$id/element', { 'using': strategy, 'value' : searchValue });
- }
+ findElementFromId(String id, String strategy, String searchValue) =>
+ _post('element/$id/element',
+ { 'using': strategy, 'value' : searchValue });
/**
* Search for multiple elements on the page, starting from the element with
@@ -897,7 +898,7 @@ class WebDriverSession extends WebDriverBase {
Future<List<String>>
findElementsFromId(String id, String strategy, String searchValue) =>
_post('element/$id/elements',
- params: { 'using': strategy, 'value' : searchValue });
+ { 'using': strategy, 'value' : searchValue });
/**
* Click on an element specified by [id].
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698