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

Unified Diff: LayoutTests/fast/encoding/api/encoding-names.html

Issue 15901002: Implement Encoding API (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebaseline webexposed global constructor tests 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
Index: LayoutTests/fast/encoding/api/encoding-names.html
diff --git a/LayoutTests/fast/encoding/api/encoding-names.html b/LayoutTests/fast/encoding/api/encoding-names.html
new file mode 100644
index 0000000000000000000000000000000000000000..e02c2491c7af7a64814267f5360858b46bf3a46d
--- /dev/null
+++ b/LayoutTests/fast/encoding/api/encoding-names.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<script src="../../js/resources/js-test-pre.js"></script>
+<script>
+
+description("Test the Encoding API's use of encoding names");
+
+debug("Encoding names are case insensitive");
+var encodings = [
+ { label: 'utf-8', encoding: 'utf-8' },
+ { label: 'utf-16', encoding: 'utf-16' },
+ { label: 'utf-16le', encoding: 'utf-16' },
+ { label: 'utf-16be', encoding: 'utf-16be' },
+ { label: 'ascii', encoding: 'windows-1252' },
+ { label: 'iso-8859-1', encoding: 'windows-1252' }
+];
+
+// FIXME: Include full table from spec
+
+encodings.forEach(function(test) {
+ shouldBeEqualToString("new TextDecoder('" + test.label.toLowerCase() + "').encoding", test.encoding);
+ shouldBeEqualToString("new TextDecoder('" + test.label.toUpperCase() + "').encoding", test.encoding);
+});
+
+
+shouldBeEqualToString("new TextDecoder('utf-8').encoding", "utf-8"); // canonical case
+shouldBeEqualToString("new TextDecoder('UTF-16').encoding", "utf-16"); // canonical case and name
+shouldBeEqualToString("new TextDecoder('UTF-16BE').encoding", "utf-16be"); // canonical case and name
+shouldBeEqualToString("new TextDecoder('iso8859-1').encoding", "windows-1252"); // canonical case and name
+shouldBeEqualToString("new TextDecoder('iso-8859-1').encoding", "windows-1252"); // canonical case and name
+
+</script>
+<script src="../../js/resources/js-test-post.js"></script>
« no previous file with comments | « LayoutTests/fast/encoding/api/byte-order-marks-expected.txt ('k') | LayoutTests/fast/encoding/api/encoding-names-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698