Skip to content

Commit

Permalink
Merge pull request #30 from devoncarew/devoncarew_update
Browse files Browse the repository at this point in the history
update repo; fix analysis issues
  • Loading branch information
DrMarcII committed Jan 27, 2015
2 parents c9b13af + 329357c commit 83182b6
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 16 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
packages
pubspec.lock
.project
.pub/
.buildlog

.settings/
2 changes: 0 additions & 2 deletions lib/pageloader.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ library pageloader;
import 'dart:async';
import 'dart:mirrors';

import 'package:meta/meta.dart';

import 'webdriver.dart';

part 'src/pageloader/annotations.dart';
Expand Down
5 changes: 1 addition & 4 deletions lib/src/command_processor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ class CommandProcessor {
}

void _failRequest(Completer completer, error, [stackTrace]) {
if (stackTrace == null) {
stackTrace = getAttachedStackTrace(error);
}
completer
.completeError(new WebDriverError(-1, error.toString()), stackTrace);
}
Expand Down Expand Up @@ -110,7 +107,7 @@ class CommandProcessor {
completer.complete(value);
}
});
}).catchError((error) => _failRequest(completer, error));
}).catchError((error, s) => _failRequest(completer, error, s));
} catch (e, s) {
_failRequest(completer, e, s);
}
Expand Down
3 changes: 3 additions & 0 deletions lib/src/keyboard.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,7 @@ class Keyboard extends _WebDriverBase implements Future {

Future whenComplete(action()) =>
_future.whenComplete(action);

Future timeout(Duration timeLimit, {onTimeout()}) =>
_future.timeout(timeLimit, onTimeout: onTimeout);
}
3 changes: 3 additions & 0 deletions lib/src/mouse.dart
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,7 @@ class Mouse extends _WebDriverBase implements Future {

Future whenComplete(action()) =>
_future.whenComplete(action);

Future timeout(Duration timeLimit, {onTimeout()}) =>
_future.timeout(timeLimit, onTimeout: onTimeout);
}
4 changes: 3 additions & 1 deletion lib/src/pageloader/core.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ class PageLoader {
InstanceMirror _reflectedInstance(ClassMirror aClass) {
InstanceMirror page;

for (MethodMirror constructor in aClass.constructors.values) {
Iterable<MethodMirror> ctors = aClass.instanceMembers.values.where(
(member) => member.isConstructor);
for (MethodMirror constructor in ctors) {
if (constructor.parameters.isEmpty) {
page = aClass.newInstance(constructor.constructorName, []);
break;
Expand Down
3 changes: 3 additions & 0 deletions lib/src/touch.dart
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,7 @@ class Touch extends _WebDriverBase implements Future {

Future whenComplete(action()) =>
_future.whenComplete(action);

Future timeout(Duration timeLimit, {onTimeout()}) =>
_future.timeout(timeLimit, onTimeout: onTimeout);
}
2 changes: 1 addition & 1 deletion lib/webdriver.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ library webdriver;
import 'dart:async';
import 'dart:convert';
import 'dart:io' hide JSON;

import 'package:crypto/crypto.dart';
import 'package:meta/meta.dart';

part 'src/alert.dart';
part 'src/capabilities.dart';
Expand Down
8 changes: 5 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
name: webdriver
version: 0.8.7
author: Dart Team <[email protected]>
description: Provides WebDriver bindings for Dart. These use the WebDriver JSON interface, and as such, require the use of the WebDriver remote server.
homepage: https://github.com/dart-lang/webdriver
description: >
Provides WebDriver bindings for Dart. These use the WebDriver JSON interface,
and as such, require the use of the WebDriver remote server.
homepage: https://github.com/google/webdriver.dart
environment:
sdk: '>=0.8.7'
sdk: '>=1.0.0 <2.0.0'
dependencies:
crypto: '>=0.8.7'
dev_dependencies:
Expand Down
7 changes: 3 additions & 4 deletions test/src/web_driver_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,9 @@ void main() {
});

test('findElement -- success', () {
driver.findElement(new By.tagName('tr'))
.then(expectAsync1((element) {
expect(element, isWebElement);
}));
return driver.findElement(new By.tagName('tr')) .then((element) {
expect(element, isWebElement);
});
});

test('findElement -- failure', () {
Expand Down

0 comments on commit 83182b6

Please sign in to comment.