From 434e78f5a291d6fd549213a7175511f12b11b8f9 Mon Sep 17 00:00:00 2001 From: Serge Gautherie Date: Thu, 30 Dec 2010 08:32:33 +0100 Subject: [PATCH] Bug 621347 - [SeaMonkey, WINNT 5.2, Debug] mochitests-1: intermittent "test_ws_basic_tests.html | Test timed out"; (Dv1a) testWebSocket4(): stop generating a 450 KiB log line from bug 562681. r=Olli.Pettay a=(test only). --- content/base/test/test_ws_basic_tests.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/content/base/test/test_ws_basic_tests.html b/content/base/test/test_ws_basic_tests.html index 6beaaee1fa4..b8d68a85387 100644 --- a/content/base/test/test_ws_basic_tests.html +++ b/content/base/test/test_ws_basic_tests.html @@ -132,6 +132,7 @@ function testWebSocket3() { function testWebSocket4() { ws = new WebSocket("ws://mochi.test:8888/tests/content/base/test/file_ws_basic_tests", "test"); + // String length = (10,000 - 1) * 23 = 229,977 = almost 225 KiB. var longString = new Array(10000).join("-huge websocket message"); ws.onopen = function(e) { is(this, ws, "'this' should point to the WebSocket. (1)"); @@ -148,7 +149,9 @@ function testWebSocket4() { } ws.onmessage = function(e) { is(this, ws, "'this' should point to the WebSocket. (3)"); - is(e.data, longString, "Didn't get the huge message back!"); + // Do not use |is(e.data, longString, "...");| that results in a _very_ long line. + is(e.data.length, longString.length, "Length of received message"); + ok(e.data == longString, "Content of received message"); document.getElementById('log').textContent += "\nReceived the huge message"; this.close(); }