| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library webdriver; | 5 library webdriver; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:io'; | 8 import 'dart:io'; |
| 9 import 'dart:json' as json; | 9 import 'dart:json' as json; |
| 10 import 'dart:uri'; | 10 import 'dart:uri'; |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 | 210 |
| 211 WebDriverBase([ | 211 WebDriverBase([ |
| 212 this._host = 'localhost', | 212 this._host = 'localhost', |
| 213 this._port = 4444, | 213 this._port = 4444, |
| 214 this._path = '/wd/hub']) { | 214 this._path = '/wd/hub']) { |
| 215 _url = 'http://$_host:$_port$_path'; | 215 _url = 'http://$_host:$_port$_path'; |
| 216 } | 216 } |
| 217 | 217 |
| 218 void _failRequest(Completer completer, error, [stackTrace]) { | 218 void _failRequest(Completer completer, error, [stackTrace]) { |
| 219 if (completer != null) { | 219 if (completer != null) { |
| 220 var trace = stackTrace != null ? stackTrace, getAttachedStackTrace(error); | 220 var trace = stackTrace != null ? stackTrace : getAttachedStackTrace(error)
; |
| 221 completer.completeError(new WebDriverError(-1, error), trace); | 221 completer.completeError(new WebDriverError(-1, error), trace); |
| 222 } | 222 } |
| 223 } | 223 } |
| 224 | 224 |
| 225 /** | 225 /** |
| 226 * Execute a request to the WebDriver server. [http_method] should be | 226 * Execute a request to the WebDriver server. [http_method] should be |
| 227 * one of 'GET', 'POST', or 'DELETE'. [command] is the text to append | 227 * one of 'GET', 'POST', or 'DELETE'. [command] is the text to append |
| 228 * to the base URL path to get the full URL. [params] are the additional | 228 * to the base URL path to get the full URL. [params] are the additional |
| 229 * parameters. If a [List] or [Map] they will be posted as JSON parameters. | 229 * parameters. If a [List] or [Map] they will be posted as JSON parameters. |
| 230 * If a number or string, "/params" is appended to the URL. | 230 * If a number or string, "/params" is appended to the URL. |
| (...skipping 1211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1442 * | 1442 * |
| 1443 * 'timestamp' (int) - The timestamp of the entry. | 1443 * 'timestamp' (int) - The timestamp of the entry. |
| 1444 * 'level' (String) - The log level of the entry, for example, "INFO". | 1444 * 'level' (String) - The log level of the entry, for example, "INFO". |
| 1445 * 'message' (String) - The log message. | 1445 * 'message' (String) - The log message. |
| 1446 * | 1446 * |
| 1447 * This works with Firefox but Chrome returns a 500 response due to a | 1447 * This works with Firefox but Chrome returns a 500 response due to a |
| 1448 * bad cast. | 1448 * bad cast. |
| 1449 */ | 1449 */ |
| 1450 Future<List<Map>> getLogs(String type) => _post('log', { 'type': type }); | 1450 Future<List<Map>> getLogs(String type) => _post('log', { 'type': type }); |
| 1451 } | 1451 } |
| OLD | NEW |