Merge pull request #66 from DrMarcII/test

Switch to using the new test pub package instead of unittest.
diff --git a/.travis.yml b/.travis.yml
index 4cbf2e1..f71e5f9 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,6 +1,9 @@
 language: dart
+sudo: false
 
-dart: dev
+dart: 
+  - dev
+  - stable
 
 before_install:
   - export CHROMEDRIVER_BINARY=/usr/bin/chromium-browser
@@ -15,6 +18,6 @@
 # version of chromium than is available on travis by default.
   - wget http://chromedriver.storage.googleapis.com/2.12/chromedriver_linux64.zip
   - unzip chromedriver_linux64.zip
-  - sudo mv chromedriver /usr/bin/
+  - export PATH=$PATH:$PWD
 
 script: ./tool/travis.sh
diff --git a/lib/async_helpers.dart b/lib/async_helpers.dart
index 1528c4b..121a824 100644
--- a/lib/async_helpers.dart
+++ b/lib/async_helpers.dart
@@ -16,7 +16,7 @@
 
 import 'dart:async' show Completer, Future;
 
-import 'package:matcher/matcher.dart' show expect, isNotNull;
+import 'package:test/test.dart' show expect, isNotNull;
 
 const defaultInterval = const Duration(milliseconds: 500);
 const defaultTimeout = const Duration(seconds: 5);
diff --git a/pubspec.yaml b/pubspec.yaml
index 8cc85e6..529110b 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,5 +1,5 @@
 name: webdriver
-version: 0.10.0-pre.5
+version: 0.10.0-pre.6
 author: Google, Inc.
 description: >
   Provides WebDriver bindings for Dart. These use the WebDriver JSON interface,
@@ -9,8 +9,6 @@
   sdk: '>=1.9.0 <2.0.0'
 dependencies:
   crypto: '^0.9.0'
-  matcher: '^0.11.4+4'
+  test: '^0.12.0-rc.1'
 dev_dependencies:
-  browser: '^0.10.0+2'
   path: '^1.3.5'
-  unittest: '^0.11.5+4'
diff --git a/test/async_helpers_test.dart b/test/async_helpers_test.dart
index 7347284..21c8239 100644
--- a/test/async_helpers_test.dart
+++ b/test/async_helpers_test.dart
@@ -16,13 +16,10 @@
 
 import 'dart:async' show Future;
 
-import 'package:unittest/compact_vm_config.dart';
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
 import 'package:webdriver/async_helpers.dart';
 
 void main() {
-  useCompactVMConfiguration();
-
   group('Lock', () {
     test('basic acquire/release', () async {
       var lock = new Lock();
diff --git a/test/html_test.dart b/test/html_test.dart
index 4be58d5..fbbaa76 100644
--- a/test/html_test.dart
+++ b/test/html_test.dart
@@ -12,12 +12,12 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+@TestOn('browser')
 library webdriver.html_test;
 
 import 'dart:html' as html;
 
-import 'package:unittest/html_enhanced_config.dart';
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
 import 'package:webdriver/html.dart'
     show WebDriver, Capabilities, createDriver, fromExistingSession;
 
@@ -34,8 +34,6 @@
 import 'test_util.dart' as test_util;
 
 void main() {
-  useHtmlEnhancedConfiguration();
-
   test_util.runningOnTravis = false;
   test_util.createTestDriver = ({Map additionalCapabilities}) {
     Map capabilities = Capabilities.chrome;
@@ -72,14 +70,14 @@
     });
   });
 
-  alert.main();
-  keyboard.main();
-  logs.main();
-  mouse.main();
-  navigation.main();
-  options.main();
-  target_locator.main();
-  web_driver.main();
-  web_element.main();
-  window.main();
+  alert.runTests();
+  keyboard.runTests();
+  logs.runTests();
+  mouse.runTests();
+  navigation.runTests();
+  options.runTests();
+  target_locator.runTests();
+  web_driver.runTests();
+  web_element.runTests();
+  window.runTests();
 }
diff --git a/test/html_test.html b/test/html_test.html
deleted file mode 100644
index e8ebc81..0000000
--- a/test/html_test.html
+++ /dev/null
@@ -1,29 +0,0 @@
-<!DOCTYPE html>
-
-<!--
-Copyright 2015 Google Inc. All rights reserved.
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-     http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
--->
-
-<html>
-<head>
-    <meta charset="utf-8">
-    <meta name="viewport" content="width=device-width, initial-scale=1.0">
-    <title>WebDriver HTML Test</title>
-</head>
-
-<body>
-<script type="application/dart" src="html_test.dart"></script>
-<script src="packages/browser/dart.js"></script>
-</body>
-</html>
diff --git a/test/io_test.dart b/test/io_test.dart
index 25ce500..dd66c75 100644
--- a/test/io_test.dart
+++ b/test/io_test.dart
@@ -11,14 +11,13 @@
 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 // See the License for the specific language governing permissions and
 // limitations under the License.
-
+@TestOn("vm")
 library webdriver.io_test;
 
 import 'dart:io' show FileSystemEntity, Platform;
 
 import 'package:path/path.dart' as path;
-import 'package:unittest/compact_vm_config.dart';
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
 import 'package:webdriver/io.dart'
     show WebDriver, Capabilities, createDriver, fromExistingSession;
 
@@ -36,8 +35,6 @@
 import 'test_util.dart' as test_util;
 
 void main() {
-  useCompactVMConfiguration();
-
   test_util.runningOnTravis = Platform.environment['TRAVIS'] == 'true';
   test_util.createTestDriver = ({Map additionalCapabilities}) {
     Map capabilities = Capabilities.chrome;
@@ -94,14 +91,14 @@
     });
   });
 
-  alert.main();
-  keyboard.main();
-  logs.main();
-  mouse.main();
-  navigation.main();
-  options.main();
-  target_locator.main();
-  web_driver.main();
-  web_element.main();
-  window.main();
+  alert.runTests();
+  keyboard.runTests();
+  logs.runTests();
+  mouse.runTests();
+  navigation.runTests();
+  options.runTests();
+  target_locator.runTests();
+  web_driver.runTests();
+  web_element.runTests();
+  window.runTests();
 }
diff --git a/test/src/alert_test.dart b/test/src/alert_test.dart
index d4a5297..f75d819 100644
--- a/test/src/alert_test.dart
+++ b/test/src/alert_test.dart
@@ -14,12 +14,12 @@
 
 library webdriver.alert_test;
 
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
 import 'package:webdriver/core.dart';
 
 import '../test_util.dart';
 
-void main() {
+void runTests() {
   group('Alert', () {
     WebDriver driver;
     WebElement button;
diff --git a/test/src/keyboard_test.dart b/test/src/keyboard_test.dart
index 364cb83..3b303fb 100644
--- a/test/src/keyboard_test.dart
+++ b/test/src/keyboard_test.dart
@@ -14,12 +14,12 @@
 
 library webdriver.keyboard_test;
 
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
 import 'package:webdriver/core.dart';
 
 import '../test_util.dart';
 
-void main() {
+void runTests() {
   group('Keyboard', () {
     WebDriver driver;
     WebElement textInput;
diff --git a/test/src/logs_test.dart b/test/src/logs_test.dart
index ecbf1b5..7aba51f 100644
--- a/test/src/logs_test.dart
+++ b/test/src/logs_test.dart
@@ -14,12 +14,12 @@
 
 library webdriver.logs_test;
 
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
 import 'package:webdriver/core.dart';
 
 import '../test_util.dart';
 
-void main() {
+void runTests() {
   group('Logs', () {
     WebDriver driver;
 
diff --git a/test/src/mouse_test.dart b/test/src/mouse_test.dart
index 7cb3660..000929a 100644
--- a/test/src/mouse_test.dart
+++ b/test/src/mouse_test.dart
@@ -14,12 +14,12 @@
 
 library webdriver.mouse_test;
 
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
 import 'package:webdriver/core.dart';
 
 import '../test_util.dart';
 
-void main() {
+void runTests() {
   group('Mouse', () {
     WebDriver driver;
     WebElement button;
diff --git a/test/src/navigation_test.dart b/test/src/navigation_test.dart
index 9cc0093..3ab0ff7 100644
--- a/test/src/navigation_test.dart
+++ b/test/src/navigation_test.dart
@@ -14,13 +14,13 @@
 
 library webdriver.navigation_test;
 
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
 import 'package:webdriver/async_helpers.dart';
 import 'package:webdriver/core.dart';
 
 import '../test_util.dart';
 
-void main() {
+void runTests() {
   group('Navigation', () {
     WebDriver driver;
 
diff --git a/test/src/options_test.dart b/test/src/options_test.dart
index 057bec9..2837cd2 100644
--- a/test/src/options_test.dart
+++ b/test/src/options_test.dart
@@ -14,12 +14,12 @@
 
 library webdriver.options_test;
 
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
 import 'package:webdriver/core.dart';
 
 import '../test_util.dart';
 
-void main() {
+void runTests() {
   group('Cookies', () {
     WebDriver driver;
 
diff --git a/test/src/target_locator_test.dart b/test/src/target_locator_test.dart
index 4beb95e..0e52f9c 100644
--- a/test/src/target_locator_test.dart
+++ b/test/src/target_locator_test.dart
@@ -14,7 +14,7 @@
 
 library webdriver.target_locator_test;
 
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
 import 'package:webdriver/core.dart';
 
 import '../test_util.dart';
@@ -23,7 +23,7 @@
  * Tests for switchTo.frame(). switchTo.window() and switchTo.alert are tested
  * in other classes.
  */
-void main() {
+void runTests() {
   group('TargetLocator', () {
     WebDriver driver;
     WebElement frame;
diff --git a/test/src/web_driver_test.dart b/test/src/web_driver_test.dart
index ae28d9a..1c2f0d5 100644
--- a/test/src/web_driver_test.dart
+++ b/test/src/web_driver_test.dart
@@ -14,12 +14,12 @@
 
 library webdriver.web_driver_test;
 
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
 import 'package:webdriver/core.dart';
 
 import '../test_util.dart';
 
-void main() {
+void runTests() {
   group('WebDriver', () {
     group('create', () {
       test('default', () async {
@@ -39,16 +39,13 @@
       });
 
       test('firefox', () async {
-        // Avoid this test on the bot; currently we just test against chromedriver.
-        if (runningOnTravis) return;
-
         WebDriver driver = await createTestDriver(
             additionalCapabilities: Capabilities.firefox);
         await driver.get('http://www.google.com');
         var element = await driver.findElement(const By.name('q'));
         expect(await element.name, 'input');
         await driver.quit();
-      });
+      }, skip: runningOnTravis);
     });
 
     group('methods', () {
diff --git a/test/src/web_element_test.dart b/test/src/web_element_test.dart
index 534809c..1adceeb 100644
--- a/test/src/web_element_test.dart
+++ b/test/src/web_element_test.dart
@@ -14,12 +14,12 @@
 
 library webdriver.web_element_test;
 
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
 import 'package:webdriver/core.dart';
 
 import '../test_util.dart';
 
-void main() {
+void runTests() {
   group('WebElement', () {
     WebDriver driver;
     WebElement table;
diff --git a/test/src/window_test.dart b/test/src/window_test.dart
index 398bb16..5b0c94a 100644
--- a/test/src/window_test.dart
+++ b/test/src/window_test.dart
@@ -16,13 +16,13 @@
 
 import 'dart:math' show Point, Rectangle;
 
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
 import 'package:webdriver/async_helpers.dart';
 import 'package:webdriver/core.dart';
 
 import '../test_util.dart';
 
-void main() {
+void runTests() {
   group('Window', () {
     WebDriver driver;
 
@@ -37,17 +37,17 @@
       var size = const Rectangle<int>(0, 0, 600, 400);
       await window.setSize(size);
       expect(await window.size, size);
-    });
+    }, skip: true);
 
-    skip_test('location', () async {
+    test('location', () async {
       var window = await driver.window;
       var position = const Point<int>(100, 200);
       await window.setLocation(position);
       expect(await window.location, position);
-    });
+    }, skip: true);
 
     // May not work on some OS/browser combinations (notably Mac OS X).
-    skip_test('maximize', () async {
+    test('maximize', () async {
       var window = await driver.window;
       await window.setSize(const Rectangle<int>(0, 0, 300, 200));
       await window.setLocation(const Point<int>(100, 200));
@@ -64,6 +64,6 @@
       expect(location.y, lessThan(200));
       expect(size.height, greaterThan(200));
       expect(size.width, greaterThan(300));
-    });
+    }, skip: true);
   });
 }
diff --git a/tool/travis.sh b/tool/travis.sh
index 45803ce..b6a51fd 100755
--- a/tool/travis.sh
+++ b/tool/travis.sh
@@ -28,12 +28,14 @@
   test/io_test.dart
 
 # run test/async_helpers_test.dart
-dart test/async_helpers_test.dart
+pub run test test/async_helpers_test.dart -p vm -r expanded 
 
 # Start chromedriver.
 chromedriver --port=4444 --url-base=wd/hub &
 
 # Run test/io_test.dart.
-dart test/io_test.dart
+pub run test test/io_test.dart -p vm -r expanded
 
-# TODO(DrMarcII): run html tests.
+# Run test/html_test.dart.
+# does not work with chromedriver
+# pub run test test/html_test.dart -p chrome -r expanded