blob: 6269b5656c3511cde1b84cb17c7e5aa344102612 [file] [log] [blame]
This is a testharness.js-based test.
FAIL header with invalid MIME type is not changed assert_equals: expected "text; charset=ascii" but got "text; charset=UTF-8"
PASS header with invalid MIME type (empty string) is not changed
PASS known charset but bogus header - missing MIME type
PASS bogus charset and bogus header - missing MIME type
FAIL If charset= param is UTF-8 (case-insensitive), it should not be changed assert_equals: expected "text/plain;charset=utf-8" but got "text/plain;charset=UTF-8"
PASS If no charset= param is given, implementation should not add one - unknown MIME
PASS If no charset= param is given, implementation should not add one - known MIME
PASS If no charset= param is given, implementation should not add one - known MIME, unknown param, two spaces
FAIL charset given but wrong, fix it (unknown MIME, bogus charset) assert_equals: expected "text/x-thepiano;charset=UTF-8" but got "text/x-thepiano;charset= UTF-8"
FAIL If charset= param is UTF-8 (case-insensitive), it should not be changed (bogus charset) assert_equals: expected "text/plain;charset=utf-8;charset=waddup" but got "text/plain;charset=UTF-8;charset=UTF-8"
PASS charset given but wrong, fix it (known MIME, actual charset)
FAIL Multiple non-UTF-8 charset parameters deduplicate, bogus parameter dropped assert_equals: expected "text/x-pink-unicorn;charset=UTF-8" but got "text/x-pink-unicorn; charset=UTF-8; charset=UTF-8; notrelated; charset=UTF-8"
PASS No content type set, give MIME and charset
FAIL charset with leading space that is UTF-8 does change assert_equals: expected "text/plain;charset=UTF-8" but got "text/plain;charset= UTF-8"
FAIL charset with trailing space that is UTF-8 does not change assert_equals: expected "text/plain;charset=utf-8 ;x=x" but got "text/plain;charset=UTF-8 ;x=x"
FAIL charset in double quotes that is UTF-8 does not change assert_equals: expected "text/plain;charset=\"utf-8\"" but got "text/plain;charset=\"UTF-8\""
FAIL charset in double quotes with space assert_equals: expected "text/plain;charset=UTF-8" but got "text/plain;charset=\" UTF-8\""
FAIL charset in double quotes with backslashes that is UTF-8 does not change assert_equals: expected "text/plain;charset=\"u\\t\f-8\"" but got "text/plain;charset=\"UTF-8\""
FAIL unknown parameters need to be preserved assert_equals: expected "yo/yo;charset=UTF-8;yo=YO;x=y" but got "YO/yo;charset=UTF-8;yo=YO; X=y"
Harness: the test ran to completion.