Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test gets skipped with pattern: asan
- Manifest: devtools/client/webconsole/test/browser/_webconsole.toml
/* Any copyright is dedicated to the Public Domain.
// Tests that importScripts loads inside a worker with a non-JavaScript
// MIME types produce an error and fail.
"use strict";
const TEST_URI =
"test/browser/" +
"test-non-javascript-mime-worker.html";
const JS_URI =
const MIME_ERROR_MSG1 = `Loading Worker from “${JS_URI}” was blocked because of a disallowed MIME type (“text/plain”).`;
const MIME_ERROR_MSG2 = `Loading script from “${JS_URI}” with importScripts() was blocked because of a disallowed MIME type (“text/plain”).`;
add_task(async function () {
const hud = await openNewTabAndConsole(TEST_URI);
await waitFor(() => findErrorMessage(hud, MIME_ERROR_MSG1), "", 100);
await waitFor(() => findErrorMessage(hud, MIME_ERROR_MSG2), "", 100);
ok(true, "MIME type error displayed");
});