4 function print(message, color)
6 var paragraph = document.createElement("div");
7 paragraph.appendChild(document.createTextNode(message));
8 paragraph.style.fontFamily = "monospace";
10 paragraph.style.color = color;
11 document.getElementById("console").appendChild(paragraph);
16 if (!window.testRunner) {
17 print("FAIL: This test can only run from inside DumpRenderTree.", "red");
21 testRunner.dumpAsText();
22 testRunner.waitUntilDone();
24 document.body.style.myCustomProperty = new String("1");
25 new Date(); // allocate another object to create heap entropy
26 // Collecting on a timeout seems to make the crash more reproducible -- not exactly sure why
27 setTimeout('GCController.collectOnAlternateThread(true);', 0);
28 setTimeout('document.body.style.myCustomProperty; print("PASS: you didn\'t crash"); testRunner.notifyDone();', 1);
31 setTimeout('print("FAIL: Test hung -- bailing out"); testRunner.notifyDone();', 2);
37 <body onload="test();">
38 <p>This page tests for a crash when accessing a custom property on a DOM object after the garbage collector
39 has run on an alternate thread.</p>
40 <p>If the test passes, you'll see a 'PASS' message below.</p>
43 <div id='console'></div>