Skip to content

Instantly share code, notes, and snippets.

@VinsCool
Created February 6, 2015 01:15
Show Gist options
  • Save VinsCool/3b5c0adf48bbc46c3d76 to your computer and use it in GitHub Desktop.
Save VinsCool/3b5c0adf48bbc46c3d76 to your computer and use it in GitHub Desktop.
<html>
<script src="../../resources/js-test-pre.js"></script>
<body onload="runTest()">
<div id="console"></div>
<form id="form1" style="display:none" method="post" target="test" action="http://anything.com"></form>
<script>
if (window.testRunner)
{
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
function runTest()
{
document.getElementById('form1').submit();
if (window.testRunner)
testRunner.notifyDone();
document.getElementById('console').innerHTML = 'PASS';
}
count = 0;
document.addEventListener("beforeload", function(event) {
event.preventDefault();
count = count + 1;
if (count == 2)
{
document.body.removeChild(document.getElementById('test'));
gc();
document.body.offsetTop;
}
}, true);
</script>
<iframe id="test" src="about:blank"></iframe>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment