blob: 21e391d092c5790d78b6656bad9dcdc0119835bd [file] [log] [blame]
<html>
<head>
<script>
function print(message, color)
{
var paragraph = document.createElement("div");
paragraph.appendChild(document.createTextNode(message));
paragraph.style.fontFamily = "monospace";
if (color)
paragraph.style.color = color;
document.getElementById("console").appendChild(paragraph);
}
function test()
{
if (!window.layoutTestController) {
print("FAIL: This test can only run from inside DumpRenderTree.", "red");
return;
}
layoutTestController.dumpAsText();
layoutTestController.waitUntilDone();
document.body.style.myCustomProperty = new String("1");
new Date(); // allocate another object to create heap entropy
// Collecting on a timeout seems to make the crash more reproducible -- not exactly sure why
setTimeout('GCController.collectOnAlternateThread(true);', 0);
setTimeout('document.body.style.myCustomProperty; print("PASS: you didn\'t crash"); layoutTestController.notifyDone();', 1);
// fail-safe
setTimeout('print("FAIL: Test hung -- bailing out"); layoutTestController.notifyDone();', 2);
}
</script>
</head>
<body onload="test();">
<p>This page tests for a crash when accessing a custom property on a DOM object after the garbage collector
has run on an alternate thread.</p>
<p>If the test passes, you'll see a 'PASS' message below.</p>
<hr>
<div id='console'></div>
</body>
</html>