| Index: test/runner/browser/safari_test.dart
|
| diff --git a/test/runner/browser/chrome_test.dart b/test/runner/browser/safari_test.dart
|
| similarity index 83%
|
| copy from test/runner/browser/chrome_test.dart
|
| copy to test/runner/browser/safari_test.dart
|
| index 25b86b32e9282b0fb4e0b743e4bdbda22935751b..f0422413a53fcbf56ee8b94b4c3fc7b51f63ba32 100644
|
| --- a/test/runner/browser/chrome_test.dart
|
| +++ b/test/runner/browser/safari_test.dart
|
| @@ -2,13 +2,13 @@
|
| // 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")
|
| +@TestOn("vm && mac-os")
|
|
|
| import 'dart:async';
|
| import 'dart:io';
|
|
|
| import 'package:test/test.dart';
|
| -import 'package:test/src/runner/browser/chrome.dart';
|
| +import 'package:test/src/runner/browser/safari.dart';
|
| import 'package:test/src/util/io.dart';
|
| import 'package:shelf/shelf.dart' as shelf;
|
| import 'package:shelf/shelf_io.dart' as shelf_io;
|
| @@ -67,19 +67,19 @@ void main() {
|
| webSockets = null;
|
| });
|
|
|
| - test("starts Chrome with the given URL", () {
|
| + test("starts Safari with the given URL", () {
|
| javaScript = '''
|
| var webSocket = new WebSocket(window.location.href.replace("http://", "ws://"));
|
| webSocket.addEventListener("open", function() {
|
| webSocket.send("loaded!");
|
| });
|
| ''';
|
| - var chrome = new Chrome(baseUrlForAddress(server.address, server.port));
|
| + var safari = new Safari(baseUrlForAddress(server.address, server.port));
|
|
|
| return webSockets.first.then((webSocket) {
|
| return webSocket.first.then(
|
| (message) => expect(message, equals("loaded!")));
|
| - }).whenComplete(chrome.close);
|
| + }).whenComplete(safari.close);
|
| });
|
|
|
| test("doesn't preserve state across runs", () {
|
| @@ -91,16 +91,16 @@ webSocket.addEventListener("open", function() {
|
| webSocket.send("done");
|
| });
|
| ''';
|
| - var chrome = new Chrome(baseUrlForAddress(server.address, server.port));
|
| + 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 chrome and start a new one until we're sure that that has
|
| + // old safari and start a new one until we're sure that that has
|
| // finished.
|
| webSocket.first.then((_) {
|
| - chrome.close();
|
| + safari.close();
|
|
|
| javaScript = '''
|
| var webSocket = new WebSocket(window.location.href.replace("http://", "ws://"));
|
| @@ -108,7 +108,7 @@ webSocket.addEventListener("open", function() {
|
| webSocket.send(localStorage.getItem("data"));
|
| });
|
| ''';
|
| - chrome = new Chrome(baseUrlForAddress(server.address, server.port));
|
| + safari = new Safari(baseUrlForAddress(server.address, server.port));
|
| first = false;
|
| });
|
| } else {
|
| @@ -117,7 +117,7 @@ webSocket.addEventListener("open", function() {
|
| expect(
|
| webSocket.first
|
| .then((message) => expect(message, equals('null')))
|
| - .whenComplete(chrome.close),
|
| + .whenComplete(safari.close),
|
| completes);
|
| }
|
| }, count: 2));
|
| @@ -127,14 +127,14 @@ webSocket.addEventListener("open", function() {
|
| test("a process can be killed synchronously after it's started", () {
|
| return shelf_io.serve(expectAsync((_) {}, count: 0), 'localhost', 0)
|
| .then((server) {
|
| - var chrome = new Chrome(baseUrlForAddress(server.address, server.port));
|
| - return chrome.close().whenComplete(server.close);
|
| + var safari = new Safari(baseUrlForAddress(server.address, server.port));
|
| + return safari.close().whenComplete(server.close);
|
| });
|
| });
|
|
|
| test("reports an error in onExit", () {
|
| - var chrome = new Chrome("http://dart-lang.org",
|
| + var safari = new Safari("http://dart-lang.org",
|
| executable: "_does_not_exist");
|
| - expect(chrome.onExit, throwsA(new isInstanceOf<ProcessException>()));
|
| + expect(safari.onExit, throwsA(new isInstanceOf<ProcessException>()));
|
| });
|
| }
|
|
|