Bug 1371844 - Add explicit API to set Debugging.failTestsOnAutoClose in Sqlite.jsm. r=mak
authorAndrew McCreight <continuation@gmail.com>
Thu, 25 May 2017 15:40:55 -0700
changeset 414908 d8fe35fb8366ee5d2fcb70293ca3349b7d6dc3d7
parent 414907 60aa84a6e4be9af3d58fd7fb3a35239c1b8c131f
child 414909 348133f59b33924a5a2093c5f15ed5f293ed4fc4
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs1371844
milestone56.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 1371844 - Add explicit API to set Debugging.failTestsOnAutoClose in Sqlite.jsm. r=mak With JSM global sharing, the Debugging object is no longer a property directly on the global of the Sqllite object. Instead of going through this back door, add a setter method to Sqllite and use that. MozReview-Commit-ID: HVCZ4Zb42q7
toolkit/modules/Sqlite.jsm
toolkit/modules/tests/xpcshell/test_sqlite.js
--- a/toolkit/modules/Sqlite.jsm
+++ b/toolkit/modules/Sqlite.jsm
@@ -1466,10 +1466,13 @@ this.Sqlite = {
   /**
    * Shutdown barrier client. May be used by clients to perform last-minute
    * cleanup prior to the shutdown of this module.
    *
    * See the documentation of AsyncShutdown.Barrier.prototype.client.
    */
   get shutdown() {
     return Barriers.shutdown.client;
-  }
+  },
+  failTestsOnAutoClose(enabled) {
+    Debugging.failTestsOnAutoClose = enabled;
+  },
 };
--- a/toolkit/modules/tests/xpcshell/test_sqlite.js
+++ b/toolkit/modules/tests/xpcshell/test_sqlite.js
@@ -28,17 +28,17 @@ function sleep(ms) {
     }, ms, timer.TYPE_ONE_SHOT);
 
   });
 }
 
 // When testing finalization, use this to tell Sqlite.jsm to not throw
 // an uncatchable `Promise.reject`
 function failTestsOnAutoClose(enabled) {
-  Cu.getGlobalForObject(Sqlite).Debugging.failTestsOnAutoClose = enabled;
+  Sqlite.failTestsOnAutoClose(enabled);
 }
 
 function getConnection(dbName, extraOptions = {}) {
   let path = dbName + ".sqlite";
   let options = {path};
   for (let [k, v] of Object.entries(extraOptions)) {
     options[k] = v;
   }