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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/security/subresourceIntegrity/resources/subresource-integrity-fetch-worker.js

Issue 2614813004: Fix a crash of SRI when used with web workers (Closed)
Patch Set: fix Created 3 years, 11 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 unified diff | Download patch
OLDNEW
(Empty)
1 importScripts('/resources/testharness.js');
2 console.log('hehehe');
3 const url = '../call-success.js';
4 const integrity = 'sha256-B0/62fJSJFrdjEFR9ba04m/D+LHQ+zG6PGcaR0Trpxg=';
5
6 promise_test(() => {
7 return fetch(url).then(res => res.text()).then(text => {
8 assert_equals(text, 'success();\n');
9 });
10 }, 'No integrity');
11
12 promise_test(() => {
13 return fetch(url, {integrity: integrity}).then(res => {
14 return res.text();
15 }).then(text => {
16 assert_equals(text, 'success();\n');
17 });
18 }, 'Good integrity');
19
20 promise_test(() => {
21 return fetch(url, {integrity: 'sha256-deadbeaf'}).then(res => {
22 assert_unreached('the integrity check should fail');
23 }, () => {
24 // The integrity check should fail.
25 });
26 }, 'Bad integrity');
27
28 done();
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/security/subresourceIntegrity/subresource-integrity-fetch-worker.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698