2018-02-02 21:55:05 +03:00
|
|
|
/* Any copyright is dedicated to the Public Domain.
|
|
|
|
* http://creativecommons.org/licenses/publicdomain/ */
|
|
|
|
|
2019-01-17 21:18:31 +03:00
|
|
|
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
2018-02-02 21:55:05 +03:00
|
|
|
|
|
|
|
function run_test() {
|
|
|
|
let complete = false;
|
|
|
|
|
|
|
|
let runnable = {
|
2018-04-23 06:55:06 +03:00
|
|
|
internalQI: ChromeUtils.generateQI([Ci.nsIRunnable]),
|
2018-05-09 04:36:22 +03:00
|
|
|
// eslint-disable-next-line mozilla/use-chromeutils-generateqi
|
2018-02-02 21:55:05 +03:00
|
|
|
QueryInterface(iid) {
|
|
|
|
// Attempt to schedule another runnable. This simulates a GC/CC
|
|
|
|
// being scheduled while executing the JS QI.
|
|
|
|
Services.tm.dispatchToMainThread(() => false);
|
|
|
|
return this.internalQI(iid);
|
|
|
|
},
|
|
|
|
|
|
|
|
run() {
|
|
|
|
complete = true;
|
2018-10-19 15:55:39 +03:00
|
|
|
},
|
2018-02-02 21:55:05 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
Services.tm.dispatchToMainThread(runnable);
|
|
|
|
Services.tm.spinEventLoopUntil(() => complete);
|
|
|
|
}
|