Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XHR: overrideMimeType() is not reset by open() #12404

Merged
merged 1 commit into from
Oct 1, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions xhr/overridemimetype-edge-cases.window.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
const testURL = "resources/status.py?type=" + encodeURIComponent("text/plain;charset=windows-1252") + "&content=%C2%F0";

async_test(t => {
const client = new XMLHttpRequest();
client.onload = t.step_func_done(() => {
assert_equals(client.responseText, "\uFFFD\uFFFD");
});
client.overrideMimeType("text/plain;charset=UTF-8");
client.open("GET", testURL);
client.send();
}, "overrideMimeType() is not reset by open(), basic");

async_test(t => {
const client = new XMLHttpRequest();
let secondTime = false;
Expand All @@ -10,14 +20,14 @@ async_test(t => {
client.open("GET", testURL);
client.send();
} else {
assert_equals(client.responseText, "Âð");
assert_equals(client.responseText, "\uFFFD\uFFFD");
t.done();
}
});
client.open("GET", testURL);
client.overrideMimeType("text/plain;charset=UTF-8")
client.send();
}, "overrideMimeType() state needs to be reset across requests");
}, "overrideMimeType() is not reset by open()");

async_test(t => {
const client = new XMLHttpRequest();
Expand Down