fune/dom/system/tests/pathutils_worker.js
Bob Owen c06ee8016f Bug 1772089 p3: Remove content temp dir from PathUtils. r=barret
This changes tempDir to be the OS temp to prevent churn, because it has many
more uses than osTempDir.

Differential Revision: https://phabricator.services.mozilla.com/D168594
2023-02-24 08:44:41 +00:00

37 lines
1.1 KiB
JavaScript

/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* eslint-env mozilla/chrome-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();
};