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

Unified Diff: tests/html/websocket_test.dart

Issue 1513363003: fix safari test (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years 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 | « no previous file | tools/testing/dart/http_server.dart » ('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 9241d214c0bf0da18d225988de93c524a0d41793..1715c884def1573c7c4dd8ab0c29342256f71d2c 100644
--- a/tests/html/websocket_test.dart
+++ b/tests/html/websocket_test.dart
@@ -39,28 +39,11 @@ main() {
});
});
- test('regression for 19137', () {
- // The server supports ws, but not wss, this will yield an error that we
- // expect to catch below.
- var socket = new WebSocket('wss://${window.location.host}/ws');
- socket.onOpen.first.then((_) => socket.send('hello!'));
+ test('error handling', () {
+ var socket = new WebSocket('ws://${window.location.host}/ws');
+ socket.onOpen.first.then((_) => socket.send('close-with-error'));
return socket.onError.first.then((e) {
- // This test is modeled after a comment in issue #19137. We haven't
- // verified that this is the casue, but the theory is that on Safari
- // we will reach this point correctly, we then try to get an
- // interceptor for `e` to call `.toString` on it, but our
- // get-interceptor logic crashes. This is because the process of
- // finding the interceptor may ask to extract the constructor name,
- // and that code assumes that the name matches a specific regular
- // expression. Apparently that regular expression doesn't match on
- // Safari 7 and the line below would ends up throwing and error of the
- // form:
- //
- // TypeError: null is not an object (evaluating
- // 'String(a.constructor).match(/^\s*function\s*([\w$]*)\s*\(/)')
- // at ...
- //
- print('$e was caught');
+ print('$e was caught, yay!');
socket.close();
});
});
« no previous file with comments | « no previous file | tools/testing/dart/http_server.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698