Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / xmlhttprequest / reopen-encoding.html
blobe12b25a1ea532d6d5a9ce78e880a0ccd7c4b6aa7
1 <html>
2 <head>
3 <title>hello</title>
4 <meta charset="UTF-8">
5 </head>
6 <body>
7 <script src="/js-test-resources/js-test.js"></script>
8 <script>
9 description('This test verifies that XMLHttpRequest properly handles Content-Type when it is reused.');
10 if (window.testRunner)
11 testRunner.dumpAsText();
13 var req = new XMLHttpRequest;
14 try {
15 req.open("GET", "resources/get-utf-8.cgi", false);
16 req.send();
17 shouldBeEqualToString("req.getResponseHeader('Content-Type')", "text/plain; charset=utf-8");
18 shouldBeEqualToString("req.responseText", "Проверка");
19 req.open("GET", "resources/get-windows-1251.cgi", false);
20 req.send();
21 shouldBeEqualToString("req.getResponseHeader('Content-Type')", "text/plain; charset=windows-1251");
22 shouldBeEqualToString("req.responseText", "Проверка");
23 finishJSTest();
24 } catch (ex) {
25 fail("an exception is thrown: " + ex);
27 </script>
28 </body>
29 </html>