Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(297)

Unified Diff: LayoutTests/http/tests/xmlhttprequest/reopen-encoding.html

Issue 20625004: XMLHttpRequest should clear the response encoding when it clears responseText. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/http/tests/xmlhttprequest/reopen-encoding-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « no previous file | LayoutTests/http/tests/xmlhttprequest/reopen-encoding-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698