image-click-form-data.html (1142B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>Check form-data for image submit button with non-empty 'value' attribute</title> 4 <link rel="author" title="Shanmuga Pandi" href="mailto:shanmuga.m@samsung.com"> 5 <link rel="help" href="https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#constructing-form-data-set"> 6 <script src="/resources/testharness.js"></script> 7 <script src="/resources/testharnessreport.js"></script> 8 9 <body> 10 <script> 11 "use strict"; 12 13 // promise_test instead of async_test because this test use window.success, and so can't run at the same time. 14 15 promise_test(t => { 16 return new Promise(resolve => { 17 window.success = t.step_func(locationLoaded => { 18 const expected = (new URL("resources/image-submit-click.html?name.x=0&name.y=0", location.href)).href; 19 assert_equals(locationLoaded, expected); 20 resolve(); 21 }); 22 23 const iframe = document.createElement("iframe"); 24 iframe.src = "resources/image-submit-click.html"; 25 document.body.appendChild(iframe); 26 }); 27 }, "Image submit button should not add extra form data if 'value' attribute is present with non-empty value"); 28 </script>