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

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

Issue 1279163005: Initial Fetch integration for Subresource Integrity (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix test expectations 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 | LayoutTests/http/tests/security/subresourceIntegrity/subresource-integrity-fetch.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/fetch/script-tests/request.js
diff --git a/LayoutTests/http/tests/fetch/script-tests/request.js b/LayoutTests/http/tests/fetch/script-tests/request.js
index 555b6767491a1a8a136a4ae4d7fda011a6e5be81..0612123377fedce191ab7f6c73f21f06974e9c5e 100644
--- a/LayoutTests/http/tests/fetch/script-tests/request.js
+++ b/LayoutTests/http/tests/fetch/script-tests/request.js
@@ -249,6 +249,29 @@ test(function() {
}, 'Request redirect test');
test(function() {
+ var request1 = {};
+ var request2 = {};
+ var init = {};
+ request1 = new Request(URL, init);
+ assert_equals(request1.integrity, '',
+ 'Request.integrity should be empty on init');
+ init['integrity'] = 'sha256-deadbeef';
+ request1 = new Request(URL, init);
+ assert_equals(request1.integrity, 'sha256-deadbeef',
+ 'Request.integrity match the integrity of init');
+ request2 = new Request(request1);
+ assert_equals(request2.integrity, 'sha256-deadbeef',
+ 'Request.integrity should match');
+ init['mode'] = 'no-cors';
+ assert_throws(
+ {name: 'TypeError'},
+ function() {
+ var request = new Request(URL, init);
+ },
+ 'new Request with a non-empty integrity and mode of \'no-cors\' should throw');
+}, 'Request integrity test');
+
+test(function() {
['same-origin', 'cors', 'no-cors'].forEach(function(mode) {
FORBIDDEN_METHODS.forEach(function(method) {
assert_throws(
« no previous file with comments | « no previous file | LayoutTests/http/tests/security/subresourceIntegrity/subresource-integrity-fetch.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698