mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 14:52:16 +00:00
Bug 1540913 - Part 9: update fs tests to use dynamic import; r=janv
Differential Revision: https://phabricator.services.mozilla.com/D172276
This commit is contained in:
parent
4818902186
commit
2701b2e0d0
@ -69,6 +69,7 @@ add_setup(async function() {
|
||||
const optionalPrefsToSet = [
|
||||
["dom.fs.enabled", true],
|
||||
["dom.fs.writable_file_stream.enabled", true],
|
||||
["dom.workers.modules.enabled", true],
|
||||
];
|
||||
|
||||
await setStoragePrefs(optionalPrefsToSet);
|
||||
|
@ -12,7 +12,7 @@ module.exports = {
|
||||
|
||||
overrides: [
|
||||
{
|
||||
files: ["Assert.js", "ModuleLoader.js", "Utils.js", "UtilsChild.js"],
|
||||
files: ["Assert.js", "ModuleLoader.js", "Utils.js"],
|
||||
parserOptions: {
|
||||
sourceType: "script",
|
||||
},
|
||||
|
@ -10,25 +10,11 @@ async function ensureUtilsChild() {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const { UtilsChild: importedUtilsChild } = await import(
|
||||
"/tests/dom/quota/test/modules/worker/UtilsChild.js"
|
||||
);
|
||||
const { UtilsChild: importedUtilsChild } = await import(
|
||||
"/tests/dom/quota/test/modules/worker/UtilsChild.mjs"
|
||||
);
|
||||
|
||||
UtilsChild = importedUtilsChild;
|
||||
|
||||
throw Error("Please switch to dynamic module import");
|
||||
} catch (e) {
|
||||
if (e.message == "Please switch to dynamic module import") {
|
||||
throw e;
|
||||
}
|
||||
|
||||
importScripts("/tests/dom/quota/test/modules/worker/UtilsChild.js");
|
||||
|
||||
const { UtilsChild: importedUtilsChild } = globalThis.importUtilsChild();
|
||||
|
||||
UtilsChild = importedUtilsChild;
|
||||
}
|
||||
UtilsChild = importedUtilsChild;
|
||||
}
|
||||
|
||||
const Utils = {
|
||||
|
@ -3,7 +3,7 @@
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/
|
||||
*/
|
||||
|
||||
const _UtilsChild = {
|
||||
export const UtilsChild = {
|
||||
async getCachedOriginUsage() {
|
||||
postMessage({
|
||||
moduleName: "UtilsParent",
|
||||
@ -20,7 +20,3 @@ const _UtilsChild = {
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
function importUtilsChild() {
|
||||
return { UtilsChild: _UtilsChild };
|
||||
}
|
@ -51,7 +51,7 @@ TEST_HARNESS_FILES.testing.mochitest.tests.dom.quota.test.modules.worker += [
|
||||
"modules/content/worker/head.js",
|
||||
"modules/content/worker/ModuleLoader.js",
|
||||
"modules/content/worker/Utils.js",
|
||||
"modules/content/worker/UtilsChild.js",
|
||||
"modules/content/worker/UtilsChild.mjs",
|
||||
]
|
||||
|
||||
TEST_HARNESS_FILES.xpcshell.dom.quota.test.common += [
|
||||
|
Loading…
Reference in New Issue
Block a user