mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 21:01:08 +00:00
Bug 1795586 - Migrate storage/test/unit/VacuumParticipant.jsm to ESM. r=mconley
Differential Revision: https://phabricator.services.mozilla.com/D159474
This commit is contained in:
parent
17845a428a
commit
c1a22477a0
@ -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]();
|
||||
});
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user