Backed out changeset e7d649603075 (bug 842081) for mochitest-4 bustage on a CLOSED TREE
authorWes Kocher <wkocher@mozilla.com>
Tue, 15 Oct 2013 19:54:11 -0700
changeset 164677 262daca031632f29bc4143c81d1761bec0906c98
parent 164676 da01cc64591f1576724d8711844db74b61bd810c
child 164678 e3c8bbbfec049f67fc3e8611d96f106247a8d2f8
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs842081
milestone27.0a1
backs oute7d649603075c8142770527b383bd2ede5541491
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset e7d649603075 (bug 842081) for mochitest-4 bustage on a CLOSED TREE
dom/workers/test/test_transferable.html
dom/workers/test/transferable_worker.js
--- a/dom/workers/test/test_transferable.html
+++ b/dom/workers/test/test_transferable.html
@@ -17,35 +17,30 @@ Tests of DOM Worker transferable objects
 <div id="content" style="display: none">
 
 </div>
 <pre id="test">
 <script class="testbody" language="javascript">
 
   function test1(sizes) {
     if (!sizes.length) {
-      runTests();
+      SimpleTest.finish();
       return;
     }
 
     var size = sizes.pop();
 
     var worker = new Worker("transferable_worker.js");
     worker.onmessage = function(event) {
       ok(event.data.status, event.data.event);
       if (!event.data.status) {
-        runTests();
+        SimpleTest.finish();
         return;
       }
 
-      if ("notEmpty" in event.data && "byteLength" in event.data.notEmpty) {
-        ok(event.data.notEmpty.byteLength != 0,
-           "P: NotEmpty object received: " + event.data.notEmpty.byteLength);
-      }
-
       if (!event.data.last)
         return;
 
       test1(sizes);
     }
     worker.onerror = function(event) {
       ok(false, "No errors!");
     }
@@ -60,64 +55,21 @@ Tests of DOM Worker transferable objects
     try {
       ab = new ArrayBuffer(size);
       worker.postMessage(42,[ab, ab]);
       ok(false, "P: PostMessage - Exception for duplicate");
     } catch(e) {
       ok(true, "P: PostMessage - Exception for duplicate");
     }
 
-    var ab = new ArrayBuffer(size);
+    ab = new ArrayBuffer(size);
     ok(ab.byteLength == size, "P: The size is: " + size + " == " + ab.byteLength);
     worker.postMessage({ data: 0, timeout: 0, ab: ab, cb: ab, size: size }, [ab]);
     ok(ab.byteLength == 0, "P: PostMessage - The size is: 0 == " + ab.byteLength)
   }
 
-  function test2() {
-    var worker = new Worker("transferable_worker.js");
-    worker.onmessage = function(event) {
-      ok(event.data.status, event.data.event);
-      if (!event.data.status) {
-        runTests();
-        return;
-      }
-
-      if ("notEmpty" in event.data && "byteLength" in event.data.notEmpty) {
-        ok(event.data.notEmpty.byteLength != 0,
-           "P: NotEmpty object received: " + event.data.notEmpty.byteLength);
-      }
-
-      if (event.data.last) {
-        runTests();
-      }
-    }
-    worker.onerror = function(event) {
-      ok(false, "No errors!");
-    }
-
-    var f = new Float32Array([0,1,2,3]);
-    ok(f.byteLength != 0, "P: The size is: " + f.byteLength + " is not 0");
-    worker.postMessage({ event: "P: postMessage with Float32Array", status: true,
-                         size: 4, notEmpty: f, bc: [ f, f, { dd: f } ] }, [f.buffer]);
-    ok(f.byteLength == 0, "P: The size is: " + f.byteLength + " is 0");
-  }
-
-  var tests = [
-    function() { test1([1024 * 1024 * 32, 128, 4]); },
-    test2
-  ];
-  function runTests() {
-    if (!tests.length) {
-      SimpleTest.finish();
-      return;
-    }
-
-    var test = tests.shift();
-    test();
-  }
-
+  test1([1024 * 1024 * 32, 128, 4]);
   SimpleTest.waitForExplicitFinish();
-  runTests();
 
 </script>
 </pre>
 </body>
 </html>
--- a/dom/workers/test/transferable_worker.js
+++ b/dom/workers/test/transferable_worker.js
@@ -1,23 +1,33 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 onmessage = function(event) {
-  if ("notEmpty" in event.data && "byteLength" in event.data.notEmpty) {
-    postMessage({ event: "W: NotEmpty object received: " + event.data.notEmpty.byteLength,
-                  status: event.data.notEmpty.byteLength != 0, last: false });
-  }
+  if (event.data.data == 0) {
+    ab = new ArrayBuffer(event.data.size);
+    postMessage({ event: "W: The size is: " + event.data.size + " == " + ab.byteLength,
+                  status: ab.byteLength == event.data.size, last: false });
 
-  var ab = new ArrayBuffer(event.data.size);
-  postMessage({ event: "W: The size is: " + event.data.size + " == " + ab.byteLength,
-                status: ab.byteLength == event.data.size, last: false });
+    postMessage({ event: "W: postMessage with arrayBuffer", status: true,
+                  ab: ab, bc: [ ab, ab, { dd: ab } ] }, [ab]);
+
+    postMessage({ event: "W: The size is: 0 == " + ab.byteLength,
+                  status: ab.byteLength == 0, last: false });
+
+    postMessage({ event: "last one!", status: true, last: true });
 
-  postMessage({ event: "W: postMessage with arrayBuffer", status: true,
-                notEmpty: ab, ab: ab, bc: [ ab, ab, { dd: ab } ] }, [ab]);
+  } else {
+    var worker = new Worker('sync_worker.js');
+    worker.onmessage = function(event) {
+      postMessage(event.data);
+    }
+    worker.onsyncmessage = function(event) {
+      var v = postSyncMessage(event.data, null, 500);
+      event.reply(v);
+    }
 
-  postMessage({ event: "W: The size is: 0 == " + ab.byteLength,
-                status: ab.byteLength == 0, last: false });
-
-  postMessage({ event: "W: last one!", status: true, last: true });
+    --event.data.data;
+    worker.postMessage(event.data);
+  }
 }