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.
authorSerge Gautherie <sgautherie.bz@free.fr>
Thu, 30 Dec 2010 08:32:33 +0100
changeset 59738 ec3e4786877d4ff708afe27ee9a1e3098e0767c7
parent 59737 c83c130ce23f1b588c0ec9d0dc6a891b1557b5b9
child 59739 fe4489fb36aba79563f01fd05c2751f021399414
push id1
push usershaver@mozilla.com
push dateTue, 04 Jan 2011 17:58:04 +0000
bugs621347, 562681
milestone2.0b9pre
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
--- a/content/base/test/test_ws_basic_tests.html
+++ b/content/base/test/test_ws_basic_tests.html
@@ -127,33 +127,36 @@ function testWebSocket3() {
     if (messageCount == testCount) {
       this.onmessage = null;
     }
   }
 }
 
 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)");
     ws.send(longString);
   }
   ws.onclose = function(e) {
     is(this, ws, "'this' should point to the WebSocket. (2)");
     //ok(e.wasClean, "Connection should have closed cleanly.");
     testWebSocket5();
   }
   ws.onerror = function(e) {
     ok(false, "onerror called!");
     finishWSTest();
   }
   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();
   }
 }
 
 function testWebSocket5() {
   ws = new WebSocket("ws://mochi.test:8888/tests/content/base/test/file_ws_basic_tests", "test");
   ws.onopen = function(e) {