Skip to content

Commit

Permalink
Merge pull request #51 from DrMarcII/master
Browse files Browse the repository at this point in the history
Minor fixes.
  • Loading branch information
DrMarcII committed Apr 6, 2015
2 parents e4cdab2 + 18707a3 commit d61c336
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Installing

```Dart
import 'package:webdriver/io.dart';
WebDriver driver = buildDriver(...);
```

Expand Down
9 changes: 5 additions & 4 deletions lib/src/common.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,14 @@ abstract class _WebDriverBase {

_WebDriverBase(this.driver, this._prefix);

Future _post(String command, [param]) => driver.post(resolve(command), param);
Future _post(String command, [param]) =>
driver.post(_resolve(command), param);

Future _get(String command) => driver.get(resolve(command));
Future _get(String command) => driver.get(_resolve(command));

Future _delete(String command) => driver.delete(resolve(command));
Future _delete(String command) => driver.delete(_resolve(command));

String resolve(command) {
String _resolve(command) {
if (_prefix == null || _prefix.isEmpty) {
return command;
}
Expand Down
7 changes: 5 additions & 2 deletions lib/src/web_driver.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,11 @@ class WebDriver implements SearchContext {

/// Quit the browser.
Future quit() async {
await _commandProcessor.delete(uri.resolve('session/$id'));
await _commandProcessor.close();
try {
await _commandProcessor.delete(uri.resolve('session/$id'));
} finally {
await _commandProcessor.close();
}
}

/// Handles for all of the currently displayed tabs/windows.
Expand Down

0 comments on commit d61c336

Please sign in to comment.