| Index: test/runner/browser/internet_explorer_test.dart
|
| diff --git a/test/runner/browser/safari_test.dart b/test/runner/browser/internet_explorer_test.dart
|
| similarity index 56%
|
| copy from test/runner/browser/safari_test.dart
|
| copy to test/runner/browser/internet_explorer_test.dart
|
| index 29c7b80ecefc3c787556c5c88d86f62e94a441aa..47c7d09fa716ea40a662b940c183c338f4137f9a 100644
|
| --- a/test/runner/browser/safari_test.dart
|
| +++ b/test/runner/browser/internet_explorer_test.dart
|
| @@ -2,12 +2,12 @@
|
| // for details. All rights reserved. Use of this source code is governed by a
|
| // BSD-style license that can be found in the LICENSE file.
|
|
|
| -@TestOn("vm && mac-os")
|
| +@TestOn("vm && windows")
|
|
|
| import 'dart:async';
|
|
|
| import 'package:test/test.dart';
|
| -import 'package:test/src/runner/browser/safari.dart';
|
| +import 'package:test/src/runner/browser/internet_explorer.dart';
|
| import 'package:test/src/util/io.dart';
|
| import 'package:shelf/shelf.dart' as shelf;
|
| import 'package:shelf/shelf_io.dart' as shelf_io;
|
| @@ -69,75 +69,36 @@ void main() {
|
| webSockets = null;
|
| });
|
|
|
| - test("starts Safari with the given URL", () {
|
| + test("starts IE with the given URL", () {
|
| javaScript = '''
|
| var webSocket = new WebSocket(window.location.href.replace("http://", "ws://"));
|
| webSocket.addEventListener("open", function() {
|
| webSocket.send("loaded!");
|
| });
|
| ''';
|
| - var safari = new Safari(baseUrlForAddress(server.address, server.port));
|
| + var ie = new InternetExplorer(
|
| + baseUrlForAddress(server.address, server.port));
|
|
|
| return webSockets.first.then((webSocket) {
|
| return webSocket.first.then(
|
| (message) => expect(message, equals("loaded!")));
|
| - }).whenComplete(safari.close);
|
| - });
|
| -
|
| - test("doesn't preserve state across runs", () {
|
| - javaScript = '''
|
| -localStorage.setItem("data", "value");
|
| -
|
| -var webSocket = new WebSocket(window.location.href.replace("http://", "ws://"));
|
| -webSocket.addEventListener("open", function() {
|
| - webSocket.send("done");
|
| -});
|
| -''';
|
| - var safari = new Safari(baseUrlForAddress(server.address, server.port));
|
| -
|
| - var first = true;
|
| - webSockets.listen(expectAsync((webSocket) {
|
| - if (first) {
|
| - // The first request will set local storage data. We can't kill the
|
| - // old safari and start a new one until we're sure that that has
|
| - // finished.
|
| - webSocket.first.then((_) {
|
| - safari.close();
|
| -
|
| - javaScript = '''
|
| -var webSocket = new WebSocket(window.location.href.replace("http://", "ws://"));
|
| -webSocket.addEventListener("open", function() {
|
| - webSocket.send(localStorage.getItem("data"));
|
| -});
|
| -''';
|
| - safari = new Safari(baseUrlForAddress(server.address, server.port));
|
| - first = false;
|
| - });
|
| - } else {
|
| - // The second request will return the local storage data. This should
|
| - // be null, indicating that no data was saved between runs.
|
| - expect(
|
| - webSocket.first
|
| - .then((message) => expect(message, equals('null')))
|
| - .whenComplete(safari.close),
|
| - completes);
|
| - }
|
| - }, count: 2));
|
| + }).whenComplete(ie.close);
|
| });
|
| });
|
|
|
| test("a process can be killed synchronously after it's started", () {
|
| return shelf_io.serve(expectAsync((_) {}, count: 0), 'localhost', 0)
|
| .then((server) {
|
| - var safari = new Safari(baseUrlForAddress(server.address, server.port));
|
| - return safari.close().whenComplete(server.close);
|
| + var ie = new InternetExplorer(
|
| + baseUrlForAddress(server.address, server.port));
|
| + return ie.close().whenComplete(server.close);
|
| });
|
| });
|
|
|
| test("reports an error in onExit", () {
|
| - var safari = new Safari("http://dart-lang.org",
|
| + var ie = new InternetExplorer("http://dart-lang.org",
|
| executable: "_does_not_exist");
|
| - expect(safari.onExit, throwsA(isApplicationException(startsWith(
|
| - "Failed to start Safari: $noSuchFileMessage"))));
|
| + expect(ie.onExit, throwsA(isApplicationException(startsWith(
|
| + "Failed to start Internet Explorer: $noSuchFileMessage"))));
|
| });
|
| }
|
|
|