1
0
Fork 0
firefox/xpcom/ioutils/tests/pathutils_worker.js
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

37 lines
1 KiB
JavaScript

/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* eslint-env worker */
"use strict";
/* import-globals-from /testing/mochitest/tests/SimpleTest/WorkerSimpleTest.js */
importScripts("chrome://mochikit/content/tests/SimpleTest/WorkerSimpleTest.js");
self.onmessage = async function (message) {
let expected = message.data;
info("ON message");
info(JSON.stringify(expected));
const profileDir = await PathUtils.getProfileDir();
is(
profileDir,
expected.profileDir,
"PathUtils.profileDir() in a worker should match PathUtils.profileDir on main thread"
);
const localProfileDir = await PathUtils.getLocalProfileDir();
is(
localProfileDir,
expected.localProfileDir,
"PathUtils.getLocalProfileDir() in a worker should match PathUtils.localProfileDir on main thread"
);
const tempDir = await PathUtils.getTempDir();
is(
tempDir,
expected.tempDir,
"PathUtils.getTempDir() in a worker should match PathUtils.tempDir on main thread"
);
finish();
};