Skip to content
Snippets Groups Projects
Commit c1a22477 authored by Basix's avatar Basix
Browse files

Bug 1795586 - Migrate storage/test/unit/VacuumParticipant.jsm to ESM. r=mconley

parent 17845a42
No related merge requests found
......@@ -4,8 +4,6 @@
// This testing component is used in test_vacuum* tests.
var EXPORTED_SYMBOLS = ["VacuumParticipant"];
/**
* Returns a new nsIFile reference for a profile database.
* @param filename for the database, excluded the .sqlite extension.
......@@ -24,7 +22,7 @@ function getDatabase(aFile) {
return Services.storage.openDatabase(aFile);
}
function VacuumParticipant() {
export function VacuumParticipant() {
this._dbConn = getDatabase(new_db_file("testVacuum"));
Services.obs.addObserver(this, "test-options");
}
......
......@@ -17,9 +17,9 @@ function load_test_vacuum_component() {
const CATEGORY_NAME = "vacuum-participant";
const CONTRACT_ID = "@unit.test.com/test-vacuum-participant;1";
MockRegistrar.registerJSM(
MockRegistrar.registerESM(
CONTRACT_ID,
"resource://test/VacuumParticipant.jsm",
"resource://test/VacuumParticipant.sys.mjs",
"VacuumParticipant"
);
......
......@@ -6,7 +6,7 @@ support-files =
fakeDB.sqlite
goodDB.sqlite
locale_collation.txt
VacuumParticipant.jsm
VacuumParticipant.sys.mjs
[test_retry_on_busy.js]
[test_bug-365166.js]
......
......@@ -95,9 +95,9 @@ var MockRegistrar = Object.freeze({
return cid;
},
registerJSM(contractID, jsm, symbol) {
registerESM(contractID, esmPath, symbol) {
return this.register(contractID, () => {
let exports = ChromeUtils.import(jsm);
let exports = ChromeUtils.importESModule(esmPath);
return new exports[symbol]();
});
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment