| <p>This tests beforeunload event in multiple subframes. You should see PASS below:</p> |
| testRunner.waitUntilDone(); |
| var log = document.getElementById('log'); |
| iframe.contentWindow.location.href = 'resources/before-unload-in-subframe-child.html'; |
| var numberOfBeforeUnloadInSubframes = 0; |
| log.innerHTML = 'FAIL: ' + numberOfBeforeUnloadInSubframes + ' beforeunload events are fired but expected ' + numberOfFrames + ' events'; |
| function fired(contentWindow) { |
| numberOfBeforeUnloadInSubframes++; |
| if (numberOfBeforeUnloadInSubframes == numberOfFrames) { |
| contentWindow.frameElement.fired = true; |
| <iframe onload="test(this)" src="resources/before-unload-in-subframe-child.html"></iframe> |
| <iframe onload="test(this)" src="resources/before-unload-in-subframe-child.html"></iframe> |
| <iframe onload="test(this)" src="resources/before-unload-in-subframe-child.html"></iframe> |