Bug 1529203 - Add tests to check that the module map is cleared when using document.open r=bzbarsky

Differential Revision: https://phabricator.services.mozilla.com/D21719
This commit is contained in:
Jon Coppeard 2020-05-26 14:06:28 +00:00
parent 97875bccdd
commit ab181a2867
5 changed files with 63 additions and 0 deletions

View File

@ -0,0 +1,17 @@
<!DOCTYPE HTML>
<html class="reftest-wait">
<iframe></iframe>
<script>
function doIt() {
var doc = document.querySelector("iframe").contentDocument;
doc.open();
doc.write('<script>import("data:text/javascript,")</' + 'script>');
doc.close();
}
doIt();
setTimeout(() => {
doIt();
document.documentElement.removeAttribute("class");
}, 100);
</script>
</html>

View File

@ -0,0 +1,21 @@
<!DOCTYPE HTML>
<html class="reftest-wait">
<script>
var win = null;
function doIt() {
if (win === null) {
win = window.open();
}
var doc = win.document;
doc.open();
doc.write('<script>import("data:text/javascript,")</' + 'script>');
doc.close();
}
doIt();
setTimeout(() => {
doIt();
win.close();
document.documentElement.removeAttribute("class");
}, 100);
</script>
</html>

View File

@ -0,0 +1,21 @@
<!DOCTYPE HTML>
<html class="reftest-wait">
<script>
var win;
function doIt() {
if (!win) {
win = window.open();
}
var doc = win.document;
doc.open();
doc.write('<script type="module" src="./module-with-syntax-error.js"></' + 'script>');
doc.close();
}
doIt()
setTimeout(() => {
doIt();
win.close();
document.documentElement.removeAttribute("class");
}, 100);
</script>
</html>

View File

@ -239,6 +239,9 @@ load 1505875.html
load 1508845.html
load 1516289.html
load 1516560.html
pref(javascript.options.dynamicImport,true) load 1529203-1.html
skip-if(Android) pref(javascript.options.dynamicImport,true) pref(dom.disable_open_during_load,false) pref(browser.link.open_newwindow,2) load 1529203-2.html
skip-if(Android) pref(dom.disable_open_during_load,false) pref(browser.link.open_newwindow,2) load 1529203-3.html
load 1528675.html
load 1566310.html
skip-if(Android) pref(dom.disable_open_during_load,false) pref(browser.link.open_newwindow,2) load 1588259.html

View File

@ -0,0 +1 @@
,