Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / forms / interactive-validation-formnovalidate-2.html
blob34b4e5eea576703d78707340b09a575c1e5bcc78
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <script src="../../resources/js-test.js"></script>
5 <script src="resources/common.js"></script>
6 <form id="f" action="interactive-validation-formnovalidate-2.html">
7 <input type="hidden" name="submitted" value="true">
8 <input name="i0" required id="i0">
9 <input type="submit" id="s" formnovalidate>
10 </form>
11 <script>
12 description('Test if the form is submitted with a submit button with formnovalidate.');
14 function startOrVerify() {
15 var query = window.location.search;
16 if (query.indexOf('submitted=true') != -1) {
17 testPassed('The form should not be submitted.');
18 shouldBeTrue('location.search.indexOf("i0=") != -1');
19 debug('TEST COMPLETE');
20 if (window.testRunner)
21 testRunner.notifyDone();
22 } else {
23 // HTMLFormElement::submit() skips validation. Use the submit button.
24 clickElement(document.getElementById('s'));
25 testFailed('The form was not submitted.');
29 if (window.testRunner)
30 testRunner.waitUntilDone();
31 window.onload = startOrVerify;
32 </script>
33 </body>
34 </html>