Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(290)

Unified Diff: tests/html/websocket_test.dart

Issue 11783069: Adding support checks for WebSocket. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/html/html.status ('k') | tools/dom/scripts/generator.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/html/websocket_test.dart
diff --git a/tests/html/websocket_test.dart b/tests/html/websocket_test.dart
index 982afa42bb1cd434c1f6eeed047e468656723d18..1738ecec8e1769f5d690c7252fca7d125a1e565d 100644
--- a/tests/html/websocket_test.dart
+++ b/tests/html/websocket_test.dart
@@ -1,17 +1,28 @@
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);
+ });
});
}
« no previous file with comments | « tests/html/html.status ('k') | tools/dom/scripts/generator.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698