Index: LayoutTests/http/tests/xmlhttprequest/reopen-encoding.html |
diff --git a/LayoutTests/http/tests/xmlhttprequest/reopen-encoding.html b/LayoutTests/http/tests/xmlhttprequest/reopen-encoding.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..b2f953be947ffacfbdbe549a22fb096cd05502f6 |
--- /dev/null |
+++ b/LayoutTests/http/tests/xmlhttprequest/reopen-encoding.html |
@@ -0,0 +1,30 @@ |
+<html> |
+<head> |
+<title>hello</title> |
+<meta charset="UTF-8"> |
+</head> |
+<body> |
+<script src="/js-test-resources/js-test-pre.js"></script> |
+<script> |
+ description('This test verifies that XMLHttpRequest properly handles Content-Type when it is reused.'); |
+ if (window.testRunner) |
+ testRunner.dumpAsText(); |
+ |
+ var req = new XMLHttpRequest; |
+ try { |
+ req.open("GET", "resources/get-utf-8.cgi", false); |
+ req.send(); |
+ shouldBeEqualToString("req.getResponseHeader('Content-Type')", "text/plain; charset=utf-8"); |
+ shouldBeEqualToString("req.responseText", "Проверка"); |
+ req.open("GET", "resources/get-windows-1251.cgi", false); |
+ req.send(); |
+ shouldBeEqualToString("req.getResponseHeader('Content-Type')", "text/plain; charset=windows-1251"); |
+ shouldBeEqualToString("req.responseText", "Проверка"); |
+ finishJSTest(); |
+ } catch (ex) { |
+ fail("an exception is thrown: " + ex); |
+ } |
+</script> |
+<script src="/js-test-resources/js-test-post.js"></script> |
+</body> |
+</html> |