Bug 1236991 - part 3: allow use of todo() from ContentTask, r=mconley
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Mon, 11 Apr 2016 17:11:35 +0100
changeset 331265 b6e38e7b5ae712aef6d31ac882b4dc20ea176c18
parent 331264 d42f9b1e05a383217e0effb4dcfa066d2a81a762
child 331266 a91d2ac5476f3fe723fbcb96f7bfaf65c91ca237
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconley
bugs1236991
milestone48.0a1
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
Bug 1236991 - part 3: allow use of todo() from ContentTask, r=mconley MozReview-Commit-ID: EfucLgxcf8Y
testing/mochitest/BrowserTestUtils/ContentTask.jsm
testing/mochitest/BrowserTestUtils/content/content-task.js
--- a/testing/mochitest/BrowserTestUtils/ContentTask.jsm
+++ b/testing/mochitest/BrowserTestUtils/ContentTask.jsm
@@ -112,15 +112,17 @@ var ContentMessageListener = {
       } else {
         deferred.resolve(aMessage.data.result);
       }
     } else if (aMessage.name == "content-task:test-result") {
       let data = aMessage.data;
       ContentTask._testScope.ok(data.condition, data.name, null, data.stack);
     } else if (aMessage.name == "content-task:test-info") {
       ContentTask._testScope.info(aMessage.data.name);
+    } else if (aMessage.name == "content-task:test-todo") {
+      ContentTask._testScope.todo(aMessage.data.expr, aMessage.data.name);
     }
   },
 };
 
 Services.mm.addMessageListener("content-task:complete", ContentMessageListener);
 Services.mm.addMessageListener("content-task:test-result", ContentMessageListener);
 Services.mm.addMessageListener("content-task:test-info", ContentMessageListener);
--- a/testing/mochitest/BrowserTestUtils/content/content-task.js
+++ b/testing/mochitest/BrowserTestUtils/content/content-task.js
@@ -30,16 +30,20 @@ addMessageListener("content-task:spawn",
       stack: getStack(err ? err.stack : stack)
     });
   });
 
   var ok = Assert.ok.bind(Assert);
   var is = Assert.equal.bind(Assert);
   var isnot = Assert.notEqual.bind(Assert);
 
+  function todo(expr, name) {
+    sendAsyncMessage("content-task:test-todo", {id, expr, name});
+  }
+
   function info(name) {
     sendAsyncMessage("content-task:test-info", {id, name});
   }
 
   try {
     let runnablestr = `
       (() => {
         return (${source});