| OLD | NEW |
| 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 // VMOptions= | 5 // VMOptions= |
| 6 // VMOptions=--short_socket_read | 6 // VMOptions=--short_socket_read |
| 7 // VMOptions=--short_socket_write | 7 // VMOptions=--short_socket_write |
| 8 // VMOptions=--short_socket_read --short_socket_write | 8 // VMOptions=--short_socket_read --short_socket_write |
| 9 | 9 |
| 10 import "dart:async"; | 10 import "dart:async"; |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 }); | 160 }); |
| 161 webSocket.send(originalMessage); | 161 webSocket.send(originalMessage); |
| 162 }); | 162 }); |
| 163 }); | 163 }); |
| 164 } | 164 } |
| 165 | 165 |
| 166 | 166 |
| 167 void testDoubleCloseClient() { | 167 void testDoubleCloseClient() { |
| 168 createServer().then((server) { | 168 createServer().then((server) { |
| 169 server.transform(new WebSocketTransformer()).listen((webSocket) { | 169 server.transform(new WebSocketTransformer()).listen((webSocket) { |
| 170 server.close(); |
| 170 webSocket.listen((event) { | 171 webSocket.listen((event) { |
| 171 if (event is CloseEvent) { | 172 if (event is CloseEvent) { |
| 172 webSocket.close(); | 173 webSocket.close(); |
| 173 } | 174 } |
| 174 }); | 175 }); |
| 175 }); | 176 }); |
| 176 | 177 |
| 177 createClient(server.port).then((webSocket) { | 178 createClient(server.port).then((webSocket) { |
| 178 webSocket.listen((event) { | 179 webSocket.listen((event) { |
| 179 if (event is CloseEvent) { | 180 if (event is CloseEvent) { |
| 180 webSocket.close(); | 181 webSocket.close(); |
| 181 } | 182 } |
| 182 }); | 183 }); |
| 183 webSocket.close(); | 184 webSocket.close(); |
| 184 }); | 185 }); |
| 185 }); | 186 }); |
| 186 } | 187 } |
| 187 | 188 |
| 188 | 189 |
| 189 void testDoubleCloseServer() { | 190 void testDoubleCloseServer() { |
| 190 createServer().then((server) { | 191 createServer().then((server) { |
| 191 server.transform(new WebSocketTransformer()).listen((webSocket) { | 192 server.transform(new WebSocketTransformer()).listen((webSocket) { |
| 193 server.close(); |
| 192 webSocket.listen((event) { | 194 webSocket.listen((event) { |
| 193 if (event is CloseEvent) { | 195 if (event is CloseEvent) { |
| 194 webSocket.close(); | 196 webSocket.close(); |
| 195 } | 197 } |
| 196 }); | 198 }); |
| 197 webSocket.close(); | 199 webSocket.close(); |
| 198 }); | 200 }); |
| 199 | 201 |
| 200 createClient(server.port).then((webSocket) { | 202 createClient(server.port).then((webSocket) { |
| 201 webSocket.listen((event) { | 203 webSocket.listen((event) { |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 SecureSocket.initialize(database: testPkcertDatabase.toNativePath(), | 340 SecureSocket.initialize(database: testPkcertDatabase.toNativePath(), |
| 339 password: "dartdart"); | 341 password: "dartdart"); |
| 340 } | 342 } |
| 341 | 343 |
| 342 | 344 |
| 343 main() { | 345 main() { |
| 344 new SecurityConfiguration(secure: false).runTests(); | 346 new SecurityConfiguration(secure: false).runTests(); |
| 345 initializeSSL(); | 347 initializeSSL(); |
| 346 new SecurityConfiguration(secure: true).runTests(); | 348 new SecurityConfiguration(secure: true).runTests(); |
| 347 } | 349 } |
| OLD | NEW |