| 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:json' as json; | 7 import 'dart:json' as json; |
| 8 import 'dart:uri'; | 8 import 'dart:uri'; |
| 9 import 'dart:io'; | 9 import 'dart:io'; |
| 10 | 10 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 * }).chain((_) { | 45 * }).chain((_) { |
| 46 * return session.submit(id); | 46 * return session.submit(id); |
| 47 * }).chain((_) { | 47 * }).chain((_) { |
| 48 * return session.close(); | 48 * return session.close(); |
| 49 * }).then((_) { | 49 * }).then((_) { |
| 50 * session = null; | 50 * session = null; |
| 51 * }); | 51 * }); |
| 52 */ | 52 */ |
| 53 | 53 |
| 54 void writeStringToFile(String fileName, String contents) { | 54 void writeStringToFile(String fileName, String contents) { |
| 55 var file = new File(fileName); | 55 new File(fileName).writeAsStringSync(contents); |
| 56 var ostream = file.openOutputStream(FileMode.WRITE); | |
| 57 ostream.writeString(contents); | |
| 58 ostream.close(); | |
| 59 } | 56 } |
| 60 | 57 |
| 61 void writeBytesToFile(String fileName, List<int> contents) { | 58 void writeBytesToFile(String fileName, List<int> contents) { |
| 62 var file = new File(fileName); | 59 new File(fileName).writeAsBytesSync(contents); |
| 63 var ostream = file.openOutputStream(FileMode.WRITE); | |
| 64 ostream.write(contents); | |
| 65 ostream.close(); | |
| 66 } | 60 } |
| 67 | 61 |
| 68 class WebDriverError { | 62 class WebDriverError { |
| 69 static List _errorTypes = null; | 63 static List _errorTypes = null; |
| 70 static List _errorDetails = null; | 64 static List _errorDetails = null; |
| 71 int statusCode; | 65 int statusCode; |
| 72 String type; | 66 String type; |
| 73 String message; | 67 String message; |
| 74 String details; | 68 String details; |
| 75 String results; | 69 String results; |
| (...skipping 1280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1356 * Get the log for a given log type. Log buffer is reset after each request. | 1350 * Get the log for a given log type. Log buffer is reset after each request. |
| 1357 * Each log entry is a [Map] with these fields: | 1351 * Each log entry is a [Map] with these fields: |
| 1358 * | 1352 * |
| 1359 * 'timestamp' (int) - The timestamp of the entry. | 1353 * 'timestamp' (int) - The timestamp of the entry. |
| 1360 * 'level' (String) - The log level of the entry, for example, "INFO". | 1354 * 'level' (String) - The log level of the entry, for example, "INFO". |
| 1361 * 'message' (String) - The log message. | 1355 * 'message' (String) - The log message. |
| 1362 */ | 1356 */ |
| 1363 Future<List<Map>> getLogs(String type) => | 1357 Future<List<Map>> getLogs(String type) => |
| 1364 _post('log', params: { 'type': type }); | 1358 _post('log', params: { 'type': type }); |
| 1365 } | 1359 } |
| OLD | NEW |