Bug 1496864 - Cause exceptions thrown while running an APZ test continuation to fail the test. r=kats
authorBotond Ballo <botond@mozilla.com>
Thu, 08 Nov 2018 22:19:20 +0000
changeset 445329 634753a5e725535dccaa735fe960e78f9c35e303
parent 445328 104d3021fed7f400a71bd0ee5121a74f7c52acc6
child 445330 0ebabb13f557ec03ccf6deee51d1f10124d0b1ce
push id109718
push userrgurzau@mozilla.com
push dateFri, 09 Nov 2018 05:49:16 +0000
treeherdermozilla-inbound@58c02c05d2db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1496864
milestone65.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 1496864 - Cause exceptions thrown while running an APZ test continuation to fail the test. r=kats Otherwise, the exception is just silently swallowed by typical test invocation code like: waitUntilApzStable() .then(runContinuation(test)) .then(subtestDone); Differential Revision: https://phabricator.services.mozilla.com/D11225
gfx/layers/apz/test/mochitest/apz_test_utils.js
--- a/gfx/layers/apz/test/mochitest/apz_test_utils.js
+++ b/gfx/layers/apz/test/mochitest/apz_test_utils.js
@@ -433,17 +433,21 @@ function runContinuation(testFunction) {
           testContinuation = testFunction(driveTest);
         }
         var ret = testContinuation.next();
         if (ret.done) {
           resolve();
         }
       }
 
-      driveTest();
+      try {
+        driveTest();
+      } catch (ex) {
+        SimpleTest.ok(false, "APZ test continuation failed with exception: " + ex);
+      }
     });
   };
 }
 
 // Take a snapshot of the given rect, *including compositor transforms* (i.e.
 // includes async scroll transforms applied by APZ). If you don't need the
 // compositor transforms, you can probably get away with using
 // SpecialPowers.snapshotWindowWithOptions or one of the friendlier wrappers.