| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 @TestOn("vm") | 5 @TestOn("vm") |
| 6 | 6 |
| 7 import 'package:scheduled_test/descriptor.dart' as d; | 7 import 'package:scheduled_test/descriptor.dart' as d; |
| 8 import 'package:scheduled_test/scheduled_stream.dart'; | 8 import 'package:scheduled_test/scheduled_stream.dart'; |
| 9 import 'package:scheduled_test/scheduled_test.dart'; | 9 import 'package:scheduled_test/scheduled_test.dart'; |
| 10 import 'package:test/src/runner/browser/chrome.dart'; | 10 import 'package:test/src/runner/browser/chrome.dart'; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 server.handleJavaScript(''' | 27 server.handleJavaScript(''' |
| 28 var webSocket = new WebSocket(window.location.href.replace("http://", "ws://")); | 28 var webSocket = new WebSocket(window.location.href.replace("http://", "ws://")); |
| 29 webSocket.addEventListener("open", function() { | 29 webSocket.addEventListener("open", function() { |
| 30 webSocket.send("loaded!"); | 30 webSocket.send("loaded!"); |
| 31 }); | 31 }); |
| 32 '''); | 32 '''); |
| 33 | 33 |
| 34 var webSocket = server.handleWebSocket(); | 34 var webSocket = server.handleWebSocket(); |
| 35 | 35 |
| 36 schedule(() async { | 36 schedule(() async { |
| 37 expect(await (await webSocket).first, equals("loaded!")); | 37 expect(await (await webSocket).stream.first, equals("loaded!")); |
| 38 }); | 38 }); |
| 39 }, | 39 }, |
| 40 // It's not clear why, but this test in particular seems to time out | 40 // It's not clear why, but this test in particular seems to time out |
| 41 // when run in parallel with many other tests. | 41 // when run in parallel with many other tests. |
| 42 timeout: new Timeout.factor(2)); | 42 timeout: new Timeout.factor(2)); |
| 43 | 43 |
| 44 test("a process can be killed synchronously after it's started", () async { | 44 test("a process can be killed synchronously after it's started", () async { |
| 45 var server = new CodeServer(); | 45 var server = new CodeServer(); |
| 46 | 46 |
| 47 schedule(() async { | 47 schedule(() async { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 78 void main() { | 78 void main() { |
| 79 test("failure", () => throw new TestFailure("oh no")); | 79 test("failure", () => throw new TestFailure("oh no")); |
| 80 } | 80 } |
| 81 """).create(); | 81 """).create(); |
| 82 | 82 |
| 83 var test = runTest(["-p", "chrome", "test.dart"]); | 83 var test = runTest(["-p", "chrome", "test.dart"]); |
| 84 test.stdout.expect(consumeThrough(contains("-1: Some tests failed."))); | 84 test.stdout.expect(consumeThrough(contains("-1: Some tests failed."))); |
| 85 test.shouldExit(1); | 85 test.shouldExit(1); |
| 86 }); | 86 }); |
| 87 } | 87 } |
| OLD | NEW |