Backed out changeset d8a89848224b (bug 890928) for B2G mochitest-9 failures.
authorRyan VanderMeulen <ryanvm@gmail.com>
Mon, 15 Jul 2013 13:19:41 -0400
changeset 138483 befbe3aa46fc92761994afdfd54c72c5f7a54b8a
parent 138482 3bc72e3c8e3ae19c9590439439506bead84509ec
child 138484 2777dcc2729b1e1efe512a20613a9cc5d3f8c605
push idunknown
push userunknown
push dateunknown
bugs890928
milestone25.0a1
backs outd8a89848224bcf0ceb00fb13148d9cedf461bcce
Backed out changeset d8a89848224b (bug 890928) for B2G mochitest-9 failures.
dom/workers/URL.cpp
dom/workers/test/test_url.html
dom/workers/test/url_worker.js
--- a/dom/workers/URL.cpp
+++ b/dom/workers/URL.cpp
@@ -139,17 +139,17 @@ public:
       doc = window->GetExtantDoc();
       if (!doc) {
         SetDOMStringToNull(mURL);
         return;
       }
 
       principal = doc->NodePrincipal();
     } else {
-      MOZ_ASSERT_IF(!mWorkerPrivate->GetParent(), mWorkerPrivate->IsChromeWorker());
+      MOZ_ASSERT(mWorkerPrivate->IsChromeWorker());
       principal = mWorkerPrivate->GetPrincipal();
     }
 
     nsCString url;
     nsresult rv = nsHostObjectProtocolHandler::AddDataEntry(
         NS_LITERAL_CSTRING(BLOBURI_SCHEME),
         mBlob, principal, url);
 
@@ -194,17 +194,17 @@ public:
     if (window) {
       doc = window->GetExtantDoc();
       if (!doc) {
         return;
       }
 
       principal = doc->NodePrincipal();
     } else {
-      MOZ_ASSERT_IF(!mWorkerPrivate->GetParent(), mWorkerPrivate->IsChromeWorker());
+      MOZ_ASSERT(mWorkerPrivate->IsChromeWorker());
       principal = mWorkerPrivate->GetPrincipal();
     }
 
     NS_ConvertUTF16toUTF8 url(mURL);
 
     nsIPrincipal* urlPrincipal =
       nsHostObjectProtocolHandler::GetDataEntryPrincipal(url);
 
--- a/dom/workers/test/test_url.html
+++ b/dom/workers/test/test_url.html
@@ -16,17 +16,17 @@
 <script class="testbody" type="text/javascript">
 
   var worker = new Worker("url_worker.js");
 
   worker.onmessage = function(event) {
     is(event.target, worker);
 
     if (event.data.type == 'finish') {
-      runTest();
+      SimpleTest.finish();
     } else if (event.data.type == 'status') {
       ok(event.data.status, event.data.msg);
     } else if (event.data.type == 'url') {
       var xhr = new XMLHttpRequest();
       xhr.open('GET', event.data.url, false);
       xhr.onreadystatechange = function() {
         if (xhr.readyState == 4) {
           ok(true, "Blob readable!");
@@ -37,31 +37,17 @@
   };
 
   worker.onerror = function(event) {
     is(event.target, worker);
     ok(false, "Worker had an error: " + event.data);
     SimpleTest.finish();
   };
 
-  var tests = [
-    function() { worker.postMessage(0); },
-    function() { worker.postMessage(4); }
-  ];
+  worker.postMessage(true);
 
-  function runTest() {
-    if (!tests.length) {
-      SimpleTest.finish();
-      return;
-    }
-
-    var test = tests.shift();
-    test();
-  }
-
-  runTest();
   SimpleTest.waitForExplicitFinish();
 
 </script>
 </pre>
 </body>
 </html>
 
--- a/dom/workers/test/url_worker.js
+++ b/dom/workers/test/url_worker.js
@@ -1,19 +1,9 @@
-onmessage = function(event) {
-  if (event.data != 0) {
-    var worker = new Worker('url_worker.js');
-    worker.onmessage = function(event) {
-      postMessage(event.data);
-    }
-
-    worker.postMessage(event.data - 1);
-    return;
-  }
-
+onmessage = function() {
   status = false;
   try {
     if ((URL instanceof Object)) {
       status = true;
     }
   } catch(e) {
   }