Index: third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/body-mixin.js |
diff --git a/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/body-mixin.js b/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/body-mixin.js |
index b02f9b307a91d2950d3e2507f9d5570527ead290..bf42d0cddae6b1e4c2748890a49cec8bf17d8361 100644 |
--- a/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/body-mixin.js |
+++ b/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/body-mixin.js |
@@ -164,6 +164,36 @@ promise_test(function(test) { |
}) |
}, 'NonAsciiTextTest'); |
+promise_test(function(test) { |
+ return fetch('/fetch/resources/bom-utf-8.php') |
+ .then(function(response) { return response.text(); }) |
+ .then(function(text) { |
+ assert_equals(text, '\u4e09\u6751\u304b\u306a\u5b50', |
+ 'utf-8 string with BOM is decoded as utf-8 and ' + |
+ 'BOM is not included in the decoded result.'); |
+ }) |
+ }, 'BOMUTF8Test'); |
+ |
+promise_test(function(test) { |
+ return fetch('/fetch/resources/bom-utf-16le.php') |
+ .then(function(response) { return response.text(); }) |
+ .then(function(text) { |
+ assert_equals(text, '\ufffd\ufffd\tNQgK0j0P[', |
+ 'utf-16le string is decoded as if utf-8 ' + |
+ 'even if the data has utf-16le BOM.'); |
+ }) |
+ }, 'BOMUTF16LETest'); |
+ |
+promise_test(function(test) { |
+ return fetch('/fetch/resources/bom-utf-16be.php') |
+ .then(function(response) { return response.text(); }) |
+ .then(function(text) { |
+ assert_equals(text, '\ufffd\ufffdN\tgQ0K0j[P', |
+ 'utf-16be string is decoded as if utf-8 ' + |
+ 'even if the data has utf-16be BOM.'); |
+ }) |
+ }, 'BOMUTF16BETest'); |
+ |
test(t => { |
var req = new Request('/'); |
assert_false(req.bodyUsed); |