This repository has been archived by the owner on Apr 3, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clear integrity failure bit in PendingScript on release
This fixes a bug where a script loaded after a previous script failed due to an integrity failure would also fail to load. This is because the PendingScript object was reused for the new script resource, and we failed to clear out the m_integrityFailure bit. This simply sets that to false when the old script resource is released. BUG=570340 Review URL: https://codereview.chromium.org/1569823004 Cr-Commit-Position: refs/heads/master@{#368379}
- Loading branch information
1 parent
0827d11
commit 2a03de6
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
...ubresourceIntegrity/subresource-integrity-load-regular-script-after-failed-integrity.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<!-- Regression test for https://crbug.com/570340 --> | ||
<title>Script loaded after failed integrity check should still load</title> | ||
</head> | ||
<body> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script> | ||
var should_fail_test = async_test('should fail'); | ||
var should_succeed_test = async_test('should succeed'); | ||
|
||
function should_fail(loaded) { | ||
should_fail_test.step(function() { | ||
if (loaded) | ||
assert_unreached(); | ||
else | ||
this.done(); | ||
}); | ||
} | ||
|
||
function success() { | ||
should_succeed_test.step(function() { | ||
this.done(); | ||
}); | ||
} | ||
</script> | ||
<script onerror="should_fail(false);" onload="should_fail(true);" src="resources/simple-result.js" integrity="sha256-deadbeef"></script> | ||
<script onerror="assert_unreached();" src="call-success.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters