Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / before-unload-with-subframes.html
blob5dc58ec95fcf4b83b2e4bdf9efc65650684c6f41
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <p>This test ensures beforeunload event fires in all subframes when a parent frame is navigated. You should see PASS 1/2 and PASS 2/2 below:</p>
5 <pre id="log"></pre>
6 <script>
8 if (window.testRunner) {
9 testRunner.dumpAsText();
10 testRunner.dumpChildFramesAsText();
11 testRunner.waitUntilDone();
14 var log = document.getElementById('log');
15 var numberOfBeforeUnloadInSubframes = 0;
16 var numberOfFrames = 3;
18 function test(iframe) {
19 if (iframe.done) {
20 if (numberOfBeforeUnloadInSubframes == numberOfFrames)
21 testRunner.notifyDone();
22 return;
24 iframe.done = true;
25 iframe.contentWindow.location.href = 'resources/before-unload-in-subframe-destination.html';
28 function logError() {
29 log.innerHTML = 'FAIL: ' + numberOfBeforeUnloadInSubframes + ' beforeunload events are fired but expected ' + numberOfFrames + ' events';
32 logError();
34 function fired(contentWindow) {
35 numberOfBeforeUnloadInSubframes++;
36 if (numberOfBeforeUnloadInSubframes == numberOfFrames)
37 log.innerHTML = 'PASS 1/2\n';
38 else
39 logError();
40 contentWindow.frameElement.fired = true;
43 </script>
44 <iframe onload="test(this)" src="resources/before-unload-with-subframes-parent.html"></iframe>
45 </body>
46 </html>