Bug 1360667 - Change location of coverage collection in xpcshell. r?jmaher draft
authorGreg Mierzwinski <gmierz2@outlook.com>
Fri, 28 Apr 2017 15:20:37 -0400
changeset 570433 4773049014e15142e4bc37edda1cac14bc2d19cf
parent 569472 c0d35b1c5ab5fa9bb2f5661aa0454a1ce31b50e0
child 626492 f4c656bf5d12a3a8cd984363fd0cf3e31b5e4c49
push id56490
push userbmo:gmierz2@outlook.com
push dateFri, 28 Apr 2017 22:12:31 +0000
reviewersjmaher
bugs1360667
milestone55.0a1
Bug 1360667 - Change location of coverage collection in xpcshell. r?jmaher MozReview-Commit-ID: EsA8hTKd15Y
testing/xpcshell/head.js
--- a/testing/xpcshell/head.js
+++ b/testing/xpcshell/head.js
@@ -533,23 +533,23 @@ function _execute_test() {
     // Else, call run_next_test() directly to invoke tests
     // added by add_test() and add_task().
     if (typeof run_test === "function") {
       run_test();
     } else {
       run_next_test();
     }
 
+    do_test_finished("MAIN run_test");
+    _do_main();
+    _PromiseTestUtils.assertNoUncaughtRejections();
+
     if (coverageCollector != null) {
       coverageCollector.recordTestCoverage(_TEST_FILE[0]);
     }
-
-    do_test_finished("MAIN run_test");
-    _do_main();
-    _PromiseTestUtils.assertNoUncaughtRejections();
   } catch (e) {
     _passed = false;
     // do_check failures are already logged and set _quit to true and throw
     // NS_ERROR_ABORT. If both of those are true it is likely this exception
     // has already been logged so there is no need to log it again. It's
     // possible that this will mask an NS_ERROR_ABORT that happens after a
     // do_check failure though.