<!DOCTYPE html>
<html>
<script type="text/javascript">
if (window.testRunner) {
    testRunner.dumpAsText();
    // So that we can catch crash failure.
    testRunner.waitUntilDone();
}

function runTest() {
    var p = document.getElementById('plg');
    var iframe = document.getElementById('script-container-frame-id');
    frameScriptFunction = iframe.contentWindow['new-script-object-in-frame'];
    iframe.parentNode.removeChild(iframe);
    p.testScriptObjectInvoke('frameScriptFunction', 'createObject');
    document.getElementById('result').innerHTML = 'SUCCESS';
    if (window.testRunner)
        testRunner.notifyDone();
}

</script>
<body>
<embed id="plg" type="application/x-webkit-test-netscape"></embed><P>
<iframe id="script-container-frame-id" src="resources/script-container.html" onload='runTest()'></iframe>
<div>This tests that invoking a plugin object from a (iframe) document that is no longer visible in a frame doesn't crash the renderer. If this test is successful, the word SUCCESS should be seen below.</div>
<div id="result">FAILED</div>
</body>
</html>

