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

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

Issue 18529009: Fix moveTo to not include null optional parameters in JSON message. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove extra trailing newline Created 7 years, 5 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 83ea292c98932c464752205944df305f09f4d70a..25d4b72b7527fd313ee1f50594f48638aac8a78e 100644
--- a/pkg/webdriver/lib/webdriver.dart
+++ b/pkg/webdriver/lib/webdriver.dart
@@ -1,4 +1,4 @@
-// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@@ -1168,8 +1168,19 @@ class WebDriverSession extends WebDriverBase {
* of the element. If the element is not visible, it will be scrolled
* into view.
*/
- Future moveTo(String id, int x, int y) =>
- _post('moveto', { 'element': id, 'xoffset': x, 'yoffset' : y});
+ Future moveTo(String id, int x, int y) {
+ Map json = {};
+ if (id != null) {
+ json['element'] = id;
+ }
+ if (x != null) {
+ json['xoffset'] = x;
+ }
+ if (y != null) {
+ json['yoffset'] = y;
+ }
+ return _post('moveto', json);
+ }
/**
* Click a mouse button (at the coordinates set by the last [moveTo] command).
« 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