Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / xmlhttprequest / xmlhttprequest-setrequestheader-no-name.html
blob0ce18714c470a30f3f488a7351a31ed0ad76618c
1 <html>
2 <body>
3 <p>Test that setRequestHeader throws a SYNTAX_ERR exception when called with an empty header name.</p>
4 <pre id="result">FAIL: script didn't run or raised an unexpected exception.</pre>
5 <script>
6 if (window.testRunner)
7 testRunner.dumpAsText();
9 var result = "FAIL: no exception was caught";
10 var req = new XMLHttpRequest;
11 req.open("GET", "resources/print-headers.cgi", false);
13 try {
14 req.setRequestHeader("", "DUMMY");
15 } catch (ex) {
16 result = "SUCCESS: got exception " + ex;
18 document.getElementById("result").textContent = result;
19 </script>
20 </body>
21 </html>