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

Unified Diff: third_party/WebKit/LayoutTests/external/wpt/fetch/api/headers/headers-casing.html

Issue 2778753002: Import //fetch from Web Platform Tests. (Closed)
Patch Set: Baselines. Created 3 years, 9 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: third_party/WebKit/LayoutTests/external/wpt/fetch/api/headers/headers-casing.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fetch/api/headers/headers-casing.html b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/headers/headers-casing.html
new file mode 100644
index 0000000000000000000000000000000000000000..1e505d81cda8c19f7cbb16436ea08fb3f92c6f48
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/headers/headers-casing.html
@@ -0,0 +1,64 @@
+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Headers case management</title>
+ <meta name="help" href="https://fetch.spec.whatwg.org/#concept-header-list-append">
+ <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <script>
+ var headerDictCase = {"UPPERCASE": "value1",
+ "lowercase": "value2",
+ "mixedCase": "value3",
+ "Content-TYPE": "value4"
+ };
+
+ function checkHeadersCase(originalName, headersToCheck, expectedDict) {
+ var lowCaseName = originalName.toLowerCase();
+ var upCaseName = originalName.toUpperCase();
+ var expectedValue = expectedDict[originalName];
+ assert_equals(headersToCheck.get(originalName), expectedValue,
+ "name: " + originalName + " has value: " + expectedValue);
+ assert_equals(headersToCheck.get(lowCaseName), expectedValue,
+ "name: " + lowCaseName + " has value: " + expectedValue);
+ assert_equals(headersToCheck.get(upCaseName), expectedValue,
+ "name: " + upCaseName + " has value: " + expectedValue);
+ }
+
+ test(function() {
+ var headers = new Headers(headerDictCase);
+ for (name in headerDictCase)
+ checkHeadersCase(name, headers, headerDictCase)
+ }, "Create headers, names use characters with different case");
+
+ test(function() {
+ var headers = new Headers();
+ for (name in headerDictCase) {
+ headers.append(name, headerDictCase[name]);
+ checkHeadersCase(name, headers, headerDictCase);
+ }
+ }, "Check append method, names use characters with different case");
+
+ test(function() {
+ var headers = new Headers();
+ for (name in headerDictCase) {
+ headers.set(name, headerDictCase[name]);
+ checkHeadersCase(name, headers, headerDictCase);
+ }
+ }, "Check set method, names use characters with different case");
+
+ test(function() {
+ var headers = new Headers();
+ for (name in headerDictCase)
+ headers.set(name, headerDictCase[name]);
+ for (name in headerDictCase)
+ headers.delete(name.toLowerCase());
+ for (name in headerDictCase)
+ assert_false(headers.has(name), "header " + name + " should have been deleted");
+ }, "Check delete method, names use characters with different case");
+ </script>
+ </body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698