Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / xmlhttprequest / encode-request-url.html
blob5570d8ea4ebe04f831a1d7a16505ae6e0b28c70e
1 <head><meta charset="utf-8"></head>
2 <body>
3 <p>Test how URLs are encoded.</p>
4 <ol id=result></ol>
5 <script>
6 function log(message)
8 var item = document.createElement("li");
9 item.appendChild(document.createTextNode(message));
10 document.getElementById("result").appendChild(item);
13 if (window.testRunner)
14 testRunner.dumpAsText();
16 var req = new XMLHttpRequest;
17 req.open("GET", "/xmlhttprequest/resources/print-query.cgi?Проверка", false);
18 req.send();
19 log("abs-path: " + (req.responseText == "%D0%9F%D1%80%D0%BE%D0%B2%D0%B5%D1%80%D0%BA%D0%B0" ? "PASS" : "FAIL (" + req.responseText + ")"));
21 req.open("GET", "resources/print-query.cgi?Проверка", false);
22 req.send();
23 log("rel-path: " + (req.responseText == "%D0%9F%D1%80%D0%BE%D0%B2%D0%B5%D1%80%D0%BA%D0%B0" ? "PASS" : "FAIL (" + req.responseText + ")"));
25 req.open("GET", document.URL.replace(/encode-request-url\.html/, "") + "resources/print-query.cgi?Проверка", false);
26 req.send();
27 log("absolute: " + (req.responseText == "%D0%9F%D1%80%D0%BE%D0%B2%D0%B5%D1%80%D0%BA%D0%B0" ? "PASS" : "FAIL (" + req.responseText + ")"));
28 </script>
29 </body>