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

Unified Diff: tests/standalone/io/web_socket_typed_data_test.dart

Issue 1426043002: Revert "Web Socket compression - take two" (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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/standalone/io/web_socket_compression_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/web_socket_typed_data_test.dart
diff --git a/tests/standalone/io/web_socket_typed_data_test.dart b/tests/standalone/io/web_socket_typed_data_test.dart
index 571b57d70327d2662fc91c4d96ec7344e367b4b8..d65bedc947520c727b9d755ad43db351b6e7b7e0 100644
--- a/tests/standalone/io/web_socket_typed_data_test.dart
+++ b/tests/standalone/io/web_socket_typed_data_test.dart
@@ -15,17 +15,13 @@ import "dart:typed_data";
Future<HttpServer> createServer() => HttpServer.bind("127.0.0.1", 0);
-Future<WebSocket> createClient(int port, bool compression) =>
- compression ? WebSocket.connect('ws://127.0.0.1:$port/')
- : WebSocket.connect('ws://127.0.0.1:$port/',
- compression: CompressionOptions.OFF);
+Future<WebSocket> createClient(int port) =>
+ WebSocket.connect('ws://127.0.0.1:$port/');
-void test(expected, testData, compression) {
+void test(expected, testData) {
createServer().then((server) {
var messageCount = 0;
- var transformer = compression ? new WebSocketTransformer()
- : new WebSocketTransformer(compression: CompressionOptions.OFF);
- server.transform(transformer).listen((webSocket) {
+ server.transform(new WebSocketTransformer()).listen((webSocket) {
webSocket.listen(
(message) {
Expect.listEquals(expected, message);
@@ -35,7 +31,7 @@ void test(expected, testData, compression) {
onDone: () => Expect.equals(testData.length, messageCount));
});
- createClient(server.port, compression).then((webSocket) {
+ createClient(server.port).then((webSocket) {
var messageCount = 0;
webSocket.listen(
(message) {
@@ -49,7 +45,7 @@ void test(expected, testData, compression) {
});
}
-testUintLists({bool compression: false}) {
+testUintLists() {
var fillData = new List.generate(256, (index) => index);
var testData = [
new Uint8List(256),
@@ -59,10 +55,10 @@ testUintLists({bool compression: false}) {
new Uint64List(256),
];
testData.forEach((list) => list.setAll(0, fillData));
- test(fillData, testData, compression);
+ test(fillData, testData);
}
-testIntLists({bool compression: false}) {
+testIntLists() {
var fillData = new List.generate(128, (index) => index);
var testData = [
new Int8List(128),
@@ -71,20 +67,18 @@ testIntLists({bool compression: false}) {
new Int64List(128),
];
testData.forEach((list) => list.setAll(0, fillData));
- test(fillData, testData, compression);
+ test(fillData, testData);
}
-void testOutOfRangeClient({bool compression: false}) {
+void testOutOfRangeClient() {
createServer().then((server) {
var messageCount = 0;
- var transformer = compression ? new WebSocketTransformer()
- : new WebSocketTransformer(compression: CompressionOptions.OFF);
- server.transform(transformer).listen((webSocket) {
+ server.transform(new WebSocketTransformer()).listen((webSocket) {
webSocket.listen((message) => Expect.fail("No message expected"));
});
Future clientError(data) {
- return createClient(server.port, compression).then((webSocket) {
+ return createClient(server.port).then((webSocket) {
var messageCount = 0;
webSocket.listen((message) => Expect.fail("No message expected"));
webSocket.add(data);
@@ -135,7 +129,7 @@ void testOutOfRangeClient({bool compression: false}) {
});
}
-void testOutOfRangeServer({bool compression: false}) {
+void testOutOfRangeServer() {
var futures = [];
var testData = [];
var data;
@@ -181,9 +175,7 @@ void testOutOfRangeServer({bool compression: false}) {
createServer().then((server) {
var messageCount = 0;
- var transformer = compression ? new WebSocketTransformer()
- : new WebSocketTransformer(compression: CompressionOptions.OFF);
- server.transform(transformer).listen((webSocket) {
+ server.transform(new WebSocketTransformer()).listen((webSocket) {
webSocket.listen((message) {
messageCount++;
webSocket.add(testData[message[0]]);
@@ -195,7 +187,7 @@ void testOutOfRangeServer({bool compression: false}) {
Future x(int i) {
var completer = new Completer();
- createClient(server.port, compression).then((webSocket) {
+ createClient(server.port).then((webSocket) {
webSocket.listen((message) => Expect.fail("No message expected"),
onDone: () => completer.complete(true),
onError: (e) => completer.completeError(e));
@@ -212,11 +204,7 @@ void testOutOfRangeServer({bool compression: false}) {
main() {
testUintLists();
- testUintLists(compression: true);
testIntLists();
- testIntLists(compression: true);
testOutOfRangeClient();
- testOutOfRangeClient(compression: true);
// testOutOfRangeServer();
- // testOutOfRangeServer(compression: true);
}
« no previous file with comments | « tests/standalone/io/web_socket_compression_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698