summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/encoding.window.js
blob: f0d133a5329017814f21b206934a554955d15f88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
async_test(t => {
  const frame = document.body.appendChild(document.createElement("iframe"));
  frame.src = "resources/encoding-frame.html";
  frame.onload = t.step_func_done(t => {
    // Using toLowerCase() to avoid an Edge bug
    assert_equals(frame.contentDocument.characterSet.toLowerCase(), "shift_jis", "precondition");
    assert_equals(frame.contentDocument.open(), frame.contentDocument);
    assert_equals(frame.contentDocument.characterSet.toLowerCase(), "shift_jis", "actual test");
    frame.contentDocument.close();
    assert_equals(frame.contentDocument.characterSet.toLowerCase(), "shift_jis", "might as well");
  });
}, "doucment.open() and the document's encoding");