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

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

Issue 240283013: Convert Encoding API tests to W3C testharness.js (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Move UTF-16 surrogate tests to separate file Created 6 years, 8 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
index 6a8a3efbaa934d6b08045846b147f9d1b5125cf9..cbc3ff4c34be426e9a13dd520504981e006ba234 100644
--- a/LayoutTests/fast/encoding/api/encoding-names.html
+++ b/LayoutTests/fast/encoding/api/encoding-names.html
@@ -1,25 +1,29 @@
<!DOCTYPE html>
-<script src="../../../resources/js-test.js"></script>
+<title>Encoding API: Encoding names</title>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<script src="resources/shared.js"></script>
<script>
-description("Test the Encoding API's use of encoding names");
+test(function() {
-debug("Encoding names are case insensitive");
-var encodings = [
- { label: 'utf-8', encoding: 'utf-8' },
- { label: 'utf-16', encoding: 'utf-16le' },
- { label: 'utf-16le', encoding: 'utf-16le' },
- { label: 'utf-16be', encoding: 'utf-16be' },
- { label: 'ascii', encoding: 'windows-1252' },
- { label: 'iso-8859-1', encoding: 'windows-1252' }
-];
+ var encodings = [
+ { label: 'utf-8', encoding: 'utf-8' },
+ { label: 'utf-16', encoding: 'utf-16le' },
+ { label: 'utf-16le', encoding: 'utf-16le' },
+ { label: 'utf-16be', encoding: 'utf-16be' },
+ { label: 'ascii', encoding: 'windows-1252' },
+ { label: 'iso-8859-1', encoding: 'windows-1252' }
+ ];
-// encoding-labels.html tests the full set of names/labels; this test just
-// exercises some common cases and case-insensitivity.
+ // encoding-labels.html tests the full set of names/labels; this test just
+ // exercises some common cases and case-insensitivity.
-encodings.forEach(function(test) {
- shouldBeEqualToString("new TextDecoder('" + test.label.toLowerCase() + "').encoding", test.encoding);
- shouldBeEqualToString("new TextDecoder('" + test.label.toUpperCase() + "').encoding", test.encoding);
-});
+ encodings.forEach(function(t) {
+ assert_equals(new TextDecoder(t.label.toLowerCase()).encoding, t.encoding);
+ assert_equals(new TextDecoder(t.label.toUpperCase()).encoding, t.encoding);
+ });
+
+}, 'Encoding labels are case-insensitive');
</script>
« no previous file with comments | « LayoutTests/fast/encoding/api/encoding-labels-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