Skip media source tests since the feature is not enabled on Windows.
[WebKit-https.git] / LayoutTests / fast / forms / interactive-validation-remove-node-in-handler.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../resources/js-test-pre.js"></script>
5 </head>
6 <body>
7 <p id="description"></p>
8 <div id="console"></div>
9 <form id=f action="interactive-validation-remove-node-in-handler.html">
10 <input type=hidden name=submitted value="true">
11 <input name=i0 required id="i0">
12 <input type=submit id="s">
13 </form>
14 <script>
15 description('Should not crash or have an assertion failure if a node was removed during an "invalid" event dispatching for the node.');
16
17 function handler(event) {
18     var node = event.target;
19     node.parentNode.removeChild(node);
20     gc();
21 }
22
23 function startOrVerify() {
24     document.getElementById('i0').addEventListener('invalid', handler, false);
25     var query = window.location.search;
26     if (query.indexOf('submitted=true') != -1) {
27         testPassed('The form was submitted.');
28         debug('TEST COMPLETE');
29         if (window.testRunner)
30             testRunner.notifyDone();
31     } else {
32         // HTMLFormElement::submit() skips validation. Use the submit button.
33         document.getElementById('s').click();
34         // Should have no assertion failures.
35         testFailed('The form should be submitted.');
36     }
37 }
38
39 if (window.testRunner)
40     testRunner.waitUntilDone();
41 window.onload = startOrVerify;
42 </script>
43 </body>
44 </html>