summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/encoding.window.js
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/encoding.window.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/encoding.window.js b/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/encoding.window.js
new file mode 100644
index 0000000000..f0d133a532
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/encoding.window.js
@@ -0,0 +1,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");