Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / forms / file / get-file-upload.html
blob31e716e7df5ebc113b9f69a7b624ed151048a92e
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <form method="GET" action="get-file-upload.html" enctype="application/x-www-form-urlencoded">
5 <input type="file" name="file" id="file">
6 <input type="file" name="nofile">
7 <input type="hidden" name="submitted" value="true">
8 </form>
9 <pre id='console'></pre>
11 <script>
12 function log(message)
14 document.getElementById('console').appendChild(document.createTextNode(message + "\n"));
17 function startOrVerify()
19 var query = window.location.search;
20 if (query.indexOf('submitted=true') != -1) {
21 // Verify the result
22 if (query.indexOf('file=get-file-upload.html&') == -1)
23 log('FAIL: No file=get-file-upload.html; ' + query);
24 else if (query.indexOf('nofile=&') == -1)
25 log('FAIL: No nofile=; ' + query);
26 else
27 log('PASS: ' + query);
28 testRunner.notifyDone();
29 } else {
30 // Start the test
31 eventSender.beginDragWithFiles(['get-file-upload.html']);
32 eventSender.mouseMoveTo(10, 10);
33 eventSender.mouseUp();
34 document.forms[0].submit();
38 if (window.eventSender) {
39 testRunner.dumpAsText();
40 testRunner.waitUntilDone();
41 window.onload = startOrVerify;
43 </script>
44 </body>
45 </html>