Chromium Code Reviews| Index: tests/html/websocket_test.dart |
| diff --git a/tests/html/websocket_test.dart b/tests/html/websocket_test.dart |
| index 982afa42bb1cd434c1f6eeed047e468656723d18..333290a5e8e9f3b0f8f853aa42d713cf9d5b4eac 100644 |
| --- a/tests/html/websocket_test.dart |
| +++ b/tests/html/websocket_test.dart |
| @@ -1,17 +1,30 @@ |
| library WebSocketTest; |
| import '../../pkg/unittest/lib/unittest.dart'; |
| -import '../../pkg/unittest/lib/html_config.dart'; |
| +import '../../pkg/unittest/lib/html_individual_config.dart'; |
| import 'dart:html'; |
| main() { |
| - useHtmlConfiguration(); |
| + useHtmlIndividualConfiguration(); |
| - var isWebSocket = predicate((x) => x is WebSocket, 'is a WebSocket'); |
| + group('supported', () { |
| + test('supported', () { |
| + expect(WebSocket.supported, true); |
| + }); |
| + }); |
| + |
| + group('websocket', () { |
| + var isWebSocket = predicate((x) => x is WebSocket, 'is a WebSocket'); |
| + var expectation = WebSocket.supported ? returnsNormally : throws; |
| - test('constructorTest', () { |
| - var socket = new WebSocket('ws://localhost'); |
| - expect(socket, isNotNull); |
| - expect(socket, isWebSocket); |
| + test('constructorTest', () { |
| + expect(() { |
| + var socket = new WebSocket('ws://localhost'); |
| + expect(socket, isNotNull); |
| + expect(socket, isWebSocket); |
| + }, expectation); |
| + }); |
| }); |
| + |
|
Emily Fortuna
2013/01/09 20:36:20
probably can get rid of these two extra whitespace
blois
2013/01/09 21:07:26
Done.
|
| + |
| } |