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

Unified Diff: LayoutTests/http/tests/fetch/script-tests/response.js

Issue 1258933002: Make the Response constructor throw when status is a null body status and body is non-null (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 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
« no previous file with comments | « no previous file | Source/modules/fetch/Response.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/fetch/script-tests/response.js
diff --git a/LayoutTests/http/tests/fetch/script-tests/response.js b/LayoutTests/http/tests/fetch/script-tests/response.js
index 6c3a6bd462f225d81a8e33f0a7696c7ecbb35e18..e6e9f31269fbbf08697a60b5279e5b6fa74aa977 100644
--- a/LayoutTests/http/tests/fetch/script-tests/response.js
+++ b/LayoutTests/http/tests/fetch/script-tests/response.js
@@ -112,7 +112,7 @@ test(function() {
}, 'Response content type test');
test(function() {
- [0, 1, 100, 199, 600, 700].forEach(function(status) {
+ [0, 1, 100, 101, 199, 600, 700].forEach(function(status) {
assert_throws({name: 'RangeError'},
function() {
new Response(new Blob(), {status: status});
@@ -121,6 +121,15 @@ test(function() {
' should throw');
});
+ [204, 205, 304].forEach(function(status) {
+ assert_throws({name: 'TypeError'},
+ function() {
+ new Response(new Blob(), {status: status});
+ },
+ 'new Response with null body status = ' + status +
+ ' and body is non-null should throw');
+ });
+
[300, 0, 304, 305, 306, 309, 500].forEach(function(status) {
assert_throws({name: 'RangeError'},
function() {
« no previous file with comments | « no previous file | Source/modules/fetch/Response.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698