Bug 1672237 - Add a subtestDone to the fission helper. r=botond
authorKartikaya Gupta <kgupta@mozilla.com>
Thu, 22 Oct 2020 00:47:45 +0000
changeset 553967 1633d4ce1773d563c2dadd204a9f62e0fbb24a22
parent 553966 8d711bceb7429db151dbd48cafe044dc2c2824ab
child 553968 718f9800877a6c198a789888ede2e9d689e49fa2
push id37885
push userapavel@mozilla.com
push dateThu, 22 Oct 2020 14:54:09 +0000
treeherdermozilla-central@5684c9b12b5e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbotond
bugs1672237
milestone84.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 1672237 - Add a subtestDone to the fission helper. r=botond Differential Revision: https://phabricator.services.mozilla.com/D94168
gfx/layers/apz/test/mochitest/FissionTestHelperChild.jsm
--- a/gfx/layers/apz/test/mochitest/FissionTestHelperChild.jsm
+++ b/gfx/layers/apz/test/mochitest/FissionTestHelperChild.jsm
@@ -46,16 +46,20 @@ class FissionTestHelperChild extends JSW
         this._startTestPromiseResolver = resolve;
       }, cw)
     );
 
     Cu.exportFunction(this.subtestDone.bind(this), FissionTestHelper, {
       defineAs: "subtestDone",
     });
 
+    Cu.exportFunction(this.subtestFailed.bind(this), FissionTestHelper, {
+      defineAs: "subtestFailed",
+    });
+
     Cu.exportFunction(this.sendToOopif.bind(this), FissionTestHelper, {
       defineAs: "sendToOopif",
     });
     Cu.exportFunction(this.fireEventInEmbedder.bind(this), FissionTestHelper, {
       defineAs: "fireEventInEmbedder",
     });
   }
 
@@ -64,16 +68,23 @@ class FissionTestHelperChild extends JSW
   subtestDone() {
     let cw = this.cw();
     if (cw.ApzCleanup) {
       cw.ApzCleanup.execute();
     }
     this.sendAsyncMessage("Test:Complete", {});
   }
 
+  // Called by the subtest to indicate subtest failure. Only one of subtestDone
+  // or subtestFailed should be called.
+  subtestFailed(msg) {
+    this.sendAsyncMessage("ok", { cond: false, msg });
+    this.subtestDone();
+  }
+
   // Called by the subtest to eval some code in the OOP iframe. This returns
   // a promise that resolves to the return value from the eval.
   sendToOopif(iframeElement, stringToEval) {
     let browsingContextId = iframeElement.browsingContext.id;
     let msgId = ++this._msgCounter;
     let cw = this.cw();
     let responsePromise = new cw.Promise(
       Cu.exportFunction(resolve => {