Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / forms / interactive-validation-required-checkbox.html
blob2f61720d071fca0f247ffc17b1a11c9925ffb0c1
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <p id="description"></p>
8 <div id="console"></div>
9 <form id=f action="interactive-validation-required-checkbox.html">
10 <input type=hidden name=submitted value="true">
11 <input type=checkbox required name=terms id=i0>
12 <input type=submit id="s">
13 </form>
14 <script>
15 description('There was a bug of validation of a required checkbox. This test confirms the bug has been fixed.');
17 function startOrVerify() {
18 var query = window.location.search;
19 if (query.indexOf('submitted=true') != -1) {
20 testPassed('The form should be submitted.');
21 shouldBeTrue('location.search.indexOf("terms=on") != -1');
22 debug('TEST COMPLETE');
23 if (window.testRunner)
24 testRunner.notifyDone();
25 } else {
26 document.getElementById('i0').checked = true;
27 // HTMLFormElement::submit() skips validation. Use the submit button.
28 document.getElementById('s').click();
29 testFailed('The form was not submitted.');
33 if (window.testRunner)
34 testRunner.waitUntilDone();
35 window.onload = startOrVerify;
36 </script>
37 </body>
38 </html>