Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / xmlhttprequest / xmlhttprequest-forbidden-methods-exception.html
blob95e6b33246175eecf886d7e3c9226041aba17bf9
1 <html><head></head><body>
3 <p>Test bug 15530: XMLHttpRequest should not support certain methods</p>
4 <p>Should see a test for the TRACE, TRACK and CONNECT methods :</p>
5 <div id="ans"></div>
7 <script type="text/javascript">
8 function log(message)
10 document.getElementById("ans").appendChild(document.createTextNode(message));
13 function insertNewLine()
15 document.getElementById("ans").appendChild(document.createElement("br"));
18 function testException(method)
20 try {
21 xhr.open(method, "resources/1251.html", false);
22 log("FAILED");
23 } catch (e) {
24 log("PASS");
28 if (window.testRunner)
29 testRunner.dumpAsText();
31 var xhr;
33 if (window.XMLHttpRequest) {
34 xhr = new XMLHttpRequest();
35 } else {
36 try {
37 xhr = new ActiveXObject("Msxml2.XMLHTTP");
38 } catch (ex) {
39 xhr = new ActiveXObject("Microsoft.XMLHTTP");
43 log("TRACE : ");
44 testException("TRACE");
45 insertNewLine();
47 log("TRACK : ");
48 testException("TRACK");
49 insertNewLine();
51 log("CONNECT : ");
52 testException("CONNECT");
53 insertNewLine();
55 if (window.testRunner)
56 testRunner.notifyDone();
58 </script>
60 </body></html>