Index: LayoutTests/http/tests/fetch/script-tests/headers.js |
diff --git a/LayoutTests/http/tests/fetch/script-tests/headers.js b/LayoutTests/http/tests/fetch/script-tests/headers.js |
index 4dd6037237a186f84604b764124bd4815f2e63bb..58a8b699b735c55a66b34477f4f4a75d0a9f2134 100644 |
--- a/LayoutTests/http/tests/fetch/script-tests/headers.js |
+++ b/LayoutTests/http/tests/fetch/script-tests/headers.js |
@@ -176,6 +176,37 @@ test(function() { |
assert_equals(headers.get('a'), 'b'); |
assert_equals(headers.get('c'), 'd'); |
+ // Tests for new valid Headers values. |
+ headers = new Headers(); |
+ headers.set('a', '\xd0\xa1'); |
+ assert_equals(headers.get('a'), '\xd0\xa1'); |
+ headers.append('b', 't t'); |
+ assert_equals(headers.get('b'), 't t'); |
+ headers.append('c', 't\tt'); |
+ assert_equals(headers.get('c'), 't\tt'); |
+ headers.set('k', ''); |
+ assert_equals(headers.get('k'), ''); |
+ headers.append('l', ' '); |
+ assert_equals(headers.get('l'), ''); |
+ headers.append('m', '\r\n\r\n\r\n'); |
+ assert_equals(headers.get('m'), ''); |
+ |
+ // Tests for normalizing header values. |
+ headers.append('d', ' t'); |
+ assert_equals(headers.get('d'), 't'); |
+ headers.set('e', 't '); |
+ assert_equals(headers.get('d'), 't'); |
+ headers.append('f', ' t '); |
+ assert_equals(headers.get('f'), 't'); |
+ headers.append('g', 'test\r'); |
+ assert_equals(headers.get('g'), 'test'); |
+ headers.set('h', 'test\n'); |
+ assert_equals(headers.get('h'), 'test'); |
+ headers.append('i', 'test\r\n'); |
+ assert_equals(headers.get('i'), 'test'); |
+ headers.append('j', 'test\t'); |
+ assert_equals(headers.get('j'), 'test'); |
+ |
// Throw errors |
INVALID_HEADER_NAMES.forEach(function(name) { |
assert_throws({name: 'TypeError'}, |