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

Side by Side Diff: tests/standalone/io/https_bad_certificate_test.dart

Issue 1966373002: Revert "Fix strong mode errors in dart:io." (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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 unified diff | Download patch
« no previous file with comments | « sdk/lib/io/websocket_impl.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 // This test verifies that the bad certificate callback works in HttpClient. 5 // This test verifies that the bad certificate callback works in HttpClient.
6 6
7 import "dart:async"; 7 import "dart:async";
8 import "dart:io"; 8 import "dart:io";
9 9
10 import "package:expect/expect.dart"; 10 import "package:expect/expect.dart";
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 return callbackReturns; 64 return callbackReturns;
65 }; 65 };
66 66
67 try { 67 try {
68 var request = await client.getUrl(Uri.parse('https://$HOST_NAME:$port/')); 68 var request = await client.getUrl(Uri.parse('https://$HOST_NAME:$port/'));
69 Expect.equals('pass', result); 69 Expect.equals('pass', result);
70 await request.close(); 70 await request.close();
71 } catch (error) { 71 } catch (error) {
72 Expect.notEquals(result, 'pass'); 72 Expect.notEquals(result, 'pass');
73 if (result == 'fail') { 73 if (result == 'fail') {
74 Expect.isTrue(error is HandshakeException || 74 Expect.isTrue(error is HandshakeException);
75 (callbackReturns is! bool && error is TypeError));
76 } else if (result == 'throw') { 75 } else if (result == 'throw') {
77 Expect.isTrue(error is CustomException); 76 Expect.isTrue(error is CustomException);
78 } else { 77 } else {
79 Expect.fail('Unknown expectation $result'); 78 Expect.fail('Unknown expectation $result');
80 } 79 }
81 } 80 }
82 } 81 }
OLDNEW
« no previous file with comments | « sdk/lib/io/websocket_impl.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698