Chromium Code Reviews| Index: pkg/webdriver/lib/webdriver.dart |
| diff --git a/pkg/webdriver/lib/webdriver.dart b/pkg/webdriver/lib/webdriver.dart |
| index 83ea292c98932c464752205944df305f09f4d70a..74f2d9cba87d1f63fae7fde6d14ac58dce04bf40 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). |
| @@ -1466,3 +1477,4 @@ class WebDriverSession extends WebDriverBase { |
| */ |
| Future<List<Map>> getLogs(String type) => _post('log', { 'type': type }); |
| } |
| + |
|
gram
2013/07/22 20:13:28
Please remove this empty line.
|