Bug 1864255. Move crashtests that leave window(s) open to the very end. r=dholbert,frontend-codestyle-reviewers

Differential Revision: https://phabricator.services.mozilla.com/D193654
This commit is contained in:
Timothy Nikkel 2024-04-21 21:37:49 +00:00
Родитель da6d8caaf6
Коммит 7e8754f524
11 изменённых файлов: 106 добавлений и 80 удалений

Просмотреть файл

@ -20,6 +20,7 @@
# Always ignore crashtests - specially crafted files that originally caused a
# crash.
**/crashtest/
**/crashtests/
# Also ignore reftest - specially crafted to produce expected output.
**/reftest/

Просмотреть файл

@ -14,6 +14,7 @@
# Always ignore crashtests - specially crafted files that originally caused a
# crash.
**/crashtest/
**/crashtests/
# Also ignore reftest - specially crafted to produce expected output.
**/reftest/

Просмотреть файл

@ -1,23 +1 @@
<html>
<head>
<script>
var winsToClose = []
onbeforeunload = function() {
for (let win of winsToClose) {
if (win) {
win.close();
}
}
};
for (let i = 0; i < 38; i++) {
customElements.define("custom-element_0", class extends HTMLElement {
constructor() {
try { o1 = document.createElement("custom-element_0") } catch (e) {}
try { winsToClose.push(window.open("javascript:'<html><body>dummy</body></html>';")); } catch (e) {}
}
})
try { o3 = document.createElement("custom-element_0") } catch (e) {}
}
</script>
</head>
</html>
<!-- file is now located at testing/crashtest/final/dom/base/crashtests/1419902.html -->

Просмотреть файл

@ -220,7 +220,7 @@ load 1406109-1.html
load 1411473.html
load 1413815.html
load 1419799.html
skip-if(geckoview) skip-if(geckoview&&isDebugBuild) skip-if(AddressSanitizer) skip-if(ThreadSanitizer) pref(dom.disable_open_during_load,false) load 1419902.html # skip Bug 1419902. Bug 1563013 for GV+WR. Bug 1524493 GV+debug. Bug 1573281 asan
# load 1419902.html # this test is run at the very end in testing/crashtest/final/crashtests.list
load 1422883.html
load 1428053.html
load 1441029.html

Просмотреть файл

@ -394,7 +394,7 @@ load 571618-1.svg
asserts(0-1) load 571975-1.html # bug 574889
load 571995.xhtml
load 574958.xhtml
asserts(0-6) load 578977.html # bug 757305
asserts(0-8) load 578977.html # bug 757305
load 580504-1.xhtml
load 582793-1.html
load 585598-1.xhtml

Просмотреть файл

@ -1,54 +1 @@
<html class="reftest-wait">
<script>
let pp;
let documentElements = [];
documentElements.push(document.documentElement);
window.onload = () => {
documentElements.push(document.documentElement);
let o = document.getElementById('a')
o.parentNode.appendChild(o)
pp = SpecialPowers.wrap(self).printPreview();
pp?.print()
window.requestIdleCallback(() => {
documentElements.push(document.documentElement);
document.write('');
setTimeout(finish, 100);
});
}
function finish() {
// The printPreview call above actually opens two print preview windows
// because the <embed src='#'> below causes a second one to open. At least
// we close the one window we can access, not sure if there is a way to get
// ahold of the other window to close it. So this test leaves a window open
// after it finishes.
try { pp.close(); } catch (e) {}
if (document.documentElement) {
try { document.documentElement.className = ""; } catch (e) {}
}
// The documentElement that the reftest harness looks at to determine if the
// test is done is not what document.documentElement points to when this code
// is run. So we save all the document.documentElement's we encounter while
// running this test and clear all of their class names.
for (let de of documentElements) {
if (de) {
try {
de.className = "";
} catch (e) {}
}
}
}
</script>
<style>
:first-of-type { padding-block-start: 99% }
</style>
<mark id='a'>
<embed src='#'>
</html>
<!-- file is now located at testing/crashtest/final/dom/base/crashtests/1758199-1.html -->

Просмотреть файл

@ -6,7 +6,7 @@ skip-if(Android) load 1662259.html
skip-if(Android) pref(dom.window.sizeToContent.enabled,true) load 1663722.html
skip-if(Android) load 1671503.html
load 1748277.html # Bug 1751260
skip-if(Android) load 1758199-1.html # printPreview doesn't work on android
# load 1758199-1.html # this test is run at the very end in testing/crashtest/final/crashtests.list
load 1804571.html
load 1804798.html
load 1804794.html

Просмотреть файл

@ -83,3 +83,6 @@ include ../../widget/crashtests/crashtests.list
include ../../widget/gtk/crashtests/crashtests.list
include ../../xpcom/string/crashtests/crashtests.list
# Tests that must be run at the very end of all other crashtests.
include final/crashtests.list

Просмотреть файл

@ -0,0 +1,34 @@
<html>
<head>
<script>
// Note that despite what it looks like this test does leave windows open
// after the test finishes. That's because some of the window.open calls
// trigger an exception but still open a window. Because of the
// exception, winsToClose.push is not executed and we have no reference
// to the window. So far there is no known way to get a reference to it.
// It was also tried to give each opened windowed a named target, save
// that list of targets, and use window.open("", targetname) to get a
// reference to the window. That also doesn't work because either the
// window.open calls never end and this page never loads, or if it does
// load after a finite time then still some windows are left open for
// some reason.
var winsToClose = []
onbeforeunload = function() {
for (let win of winsToClose) {
if (win) {
win.close();
}
}
};
for (let i = 0; i < 38; i++) {
customElements.define("custom-element_0", class extends HTMLElement {
constructor() {
try { o1 = document.createElement("custom-element_0") } catch (e) {}
try { winsToClose.push(window.open("javascript:'<html><body>dummy</body></html>';")); } catch (e) {}
}
})
try { o3 = document.createElement("custom-element_0") } catch (e) {}
}
</script>
</head>
</html>

Просмотреть файл

@ -0,0 +1,54 @@
<html class="reftest-wait">
<script>
let pp;
let documentElements = [];
documentElements.push(document.documentElement);
window.onload = () => {
documentElements.push(document.documentElement);
let o = document.getElementById('a')
o.parentNode.appendChild(o)
pp = SpecialPowers.wrap(self).printPreview();
pp?.print()
window.requestIdleCallback(() => {
documentElements.push(document.documentElement);
document.write('');
setTimeout(finish, 100);
});
}
function finish() {
// The printPreview call above actually opens two print preview windows
// because the <embed src='#'> below causes a second one to open. At least
// we close the one window we can access, not sure if there is a way to get
// ahold of the other window to close it. So this test leaves a window open
// after it finishes.
try { pp.close(); } catch (e) {}
if (document.documentElement) {
try { document.documentElement.className = ""; } catch (e) {}
}
// The documentElement that the reftest harness looks at to determine if the
// test is done is not what document.documentElement points to when this code
// is run. So we save all the document.documentElement's we encounter while
// running this test and clear all of their class names.
for (let de of documentElements) {
if (de) {
try {
de.className = "";
} catch (e) {}
}
}
}
</script>
<style>
:first-of-type { padding-block-start: 99% }
</style>
<mark id='a'>
<embed src='#'>
</html>

Просмотреть файл

@ -0,0 +1,8 @@
# These are tests that open windows and don't close them after the test
# finishes because there doesn't seem to be a way to close the windows. We run
# them here after all other crashtests so that the left open windows don't
# occlude the reftest window, and hence stop the compositor and refresh driver
# ticks from happening.
skip-if(geckoview) skip-if(geckoview&&isDebugBuild) skip-if(AddressSanitizer) skip-if(ThreadSanitizer) pref(dom.disable_open_during_load,false) load 1419902.html # skip Bug 1419902. Bug 1563013 for GV+WR. Bug 1524493 GV+debug. Bug 1573281 asan # this comes from dom/base/crashtests/
skip-if(Android) load 1758199-1.html # printPreview doesn't work on android # this comes from layout/printing/crashtests