зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1523706 - Extend devtools test. r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D37912 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
14f3a24095
Коммит
4e4dbeff23
|
@ -6,6 +6,7 @@
|
|||
// Tests that importScripts loads inside a worker with a non-JavaScript
|
||||
// MIME types produce an error and fail.
|
||||
// See Bug 1514680.
|
||||
// Also tests that `new Worker` with a non-JS MIME type fails. (Bug 1523706)
|
||||
|
||||
"use strict";
|
||||
|
||||
|
@ -13,13 +14,21 @@ const TEST_URI =
|
|||
"http://example.com/browser/devtools/client/webconsole/" +
|
||||
"test/mochitest/" +
|
||||
"test-non-javascript-mime-worker.html";
|
||||
const MIME_ERROR_MSG =
|
||||
"Loading script from “http://example.com/browser/devtools/client/webconsole/test/mochitest/test-non-javascript-mime.js” with importScripts() was blocked because of a disallowed MIME type (“text/plain”).";
|
||||
|
||||
const JS_URI =
|
||||
"http://example.com/browser/devtools/client/webconsole/test/mochitest/test-non-javascript-mime.js";
|
||||
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(
|
||||
() => findMessage(hud, MIME_ERROR_MSG, ".message.error"),
|
||||
() => findMessage(hud, MIME_ERROR_MSG1, ".message.error"),
|
||||
"",
|
||||
100
|
||||
);
|
||||
await waitFor(
|
||||
() => findMessage(hud, MIME_ERROR_MSG2, ".message.error"),
|
||||
"",
|
||||
100
|
||||
);
|
||||
|
|
|
@ -7,6 +7,11 @@
|
|||
http://creativecommons.org/publicdomain/zero/1.0/ -->
|
||||
<script>
|
||||
"use strict";
|
||||
|
||||
// Test new Worker
|
||||
new Worker("http://example.com/browser/devtools/client/webconsole/test/mochitest/test-non-javascript-mime.js");
|
||||
|
||||
// Test importScripts
|
||||
const source = `importScripts("http://example.com/browser/devtools/client/webconsole/" +
|
||||
"test/mochitest/" +
|
||||
"test-non-javascript-mime.js");`;
|
||||
|
@ -15,6 +20,6 @@
|
|||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<p>Web Console test for importScripts() inside Worker with non-JavaScript MIME type.</p>
|
||||
<p>Web Console test for Worker and importScripts() inside Worker with non-JavaScript MIME type.</p>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Загрузка…
Ссылка в новой задаче