OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <meta charset="utf-8"> | 2 <meta charset="utf-8"> |
3 <title>beforeunload return value cancelation behavior</title> | 3 <title>beforeunload return value cancelation behavior</title> |
4 <link rel="help" href="https://html.spec.whatwg.org/multipage/webappapis.html#th
e-event-handler-processing-algorithm"> | 4 <link rel="help" href="https://html.spec.whatwg.org/multipage/webappapis.html#th
e-event-handler-processing-algorithm"> |
5 <link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me"> | 5 <link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me"> |
6 <script src="/resources/testharness.js"></script> | 6 <script src="/resources/testharness.js"></script> |
7 <script src="/resources/testharnessreport.js"></script> | 7 <script src="/resources/testharnessreport.js"></script> |
8 | 8 |
9 <div id="log"></div> | 9 <div id="log"></div> |
10 | 10 |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 expectedReturnValue: "foo" | 111 expectedReturnValue: "foo" |
112 }, | 112 }, |
113 { | 113 { |
114 valueToReturn: 0, | 114 valueToReturn: 0, |
115 expectCancelation: true, | 115 expectCancelation: true, |
116 setReturnValue: "foo", | 116 setReturnValue: "foo", |
117 expectedReturnValue: "foo" | 117 expectedReturnValue: "foo" |
118 } | 118 } |
119 ]; | 119 ]; |
120 | 120 |
121 for (const testCase of testCases) { | 121 var testCaseIndex = 0; |
| 122 function runNextTest() { |
| 123 const testCase = testCases[testCaseIndex]; |
| 124 |
122 const labelAboutReturnValue = testCase.setReturnValue === undefined ? "" : | 125 const labelAboutReturnValue = testCase.setReturnValue === undefined ? "" : |
123 `; setting returnValue to ${testCase.setReturnValue}`; | 126 `; setting returnValue to ${testCase.setReturnValue}`; |
124 | 127 |
125 async_test(t => { | 128 async_test(t => { |
126 const iframe = document.createElement("iframe"); | 129 const iframe = document.createElement("iframe"); |
127 iframe.onload = t.step_func(() => { | 130 iframe.onload = t.step_func(() => { |
128 iframe.contentWindow.runTest(t, testCase); | 131 iframe.contentWindow.runTest(t, testCase); |
| 132 if (++testCaseIndex < testCases.length) |
| 133 runNextTest(); |
129 }); | 134 }); |
130 | 135 |
131 iframe.src = "beforeunload-canceling-1.html"; | 136 iframe.src = "beforeunload-canceling-1.html"; |
132 document.body.appendChild(iframe); | 137 document.body.appendChild(iframe); |
133 }, `Returning ${testCase.valueToReturn} with a real iframe unloading${labelAbo
utReturnValue}`); | 138 }, `Returning ${testCase.valueToReturn} with a real iframe unloading${labelAbo
utReturnValue}`); |
134 } | 139 } |
| 140 |
| 141 runNextTest(); |
135 </script> | 142 </script> |
OLD | NEW |