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

Side by Side Diff: Source/core/frame/SubresourceIntegrityTest.cpp

Issue 803773002: SRI: Remove the restriction to HTTPS documents and resources. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase. Created 5 years, 10 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
« no previous file with comments | « Source/core/frame/SubresourceIntegrity.cpp ('k') | Source/core/frame/UseCounter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "core/frame/SubresourceIntegrity.h" 6 #include "core/frame/SubresourceIntegrity.h"
7 7
8 #include "core/HTMLNames.h" 8 #include "core/HTMLNames.h"
9 #include "core/dom/Document.h" 9 #include "core/dom/Document.h"
10 #include "core/html/HTMLScriptElement.h" 10 #include "core/html/HTMLScriptElement.h"
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 279
280 // The hash label must match the hash value. 280 // The hash label must match the hash value.
281 expectIntegrityFailure(kSha384IntegrityLabeledAs256, kBasicScript, secureURL ); 281 expectIntegrityFailure(kSha384IntegrityLabeledAs256, kBasicScript, secureURL );
282 282
283 // Unsupported hash functions should fail. 283 // Unsupported hash functions should fail.
284 expectIntegrityFailure(kUnsupportedHashFunctionIntegrity, kBasicScript, secu reURL); 284 expectIntegrityFailure(kUnsupportedHashFunctionIntegrity, kBasicScript, secu reURL);
285 } 285 }
286 286
287 TEST_F(SubresourceIntegrityTest, CheckSubresourceIntegrityInInsecureOrigin) 287 TEST_F(SubresourceIntegrityTest, CheckSubresourceIntegrityInInsecureOrigin)
288 { 288 {
289 // The same checks as CheckSubresourceIntegrityInSecureOrigin should fail he re. 289 // The same checks as CheckSubresourceIntegrityInSecureOrigin should pass he re.
290 document->updateSecurityOrigin(insecureOrigin->isolatedCopy()); 290 document->updateSecurityOrigin(insecureOrigin->isolatedCopy());
291 291
292 expectIntegrityFailure(kSha256Integrity, kBasicScript, secureURL); 292 expectIntegrity(kSha256Integrity, kBasicScript, secureURL);
293 expectIntegrityFailure(kSha384Integrity, kBasicScript, secureURL); 293 expectIntegrity(kSha384Integrity, kBasicScript, secureURL);
294 expectIntegrityFailure(kSha512Integrity, kBasicScript, secureURL); 294 expectIntegrity(kSha512Integrity, kBasicScript, secureURL);
295 expectIntegrityFailure(kSha384IntegrityLabeledAs256, kBasicScript, secureURL ); 295 expectIntegrityFailure(kSha384IntegrityLabeledAs256, kBasicScript, secureURL );
296 expectIntegrityFailure(kUnsupportedHashFunctionIntegrity, kBasicScript, secu reURL); 296 expectIntegrityFailure(kUnsupportedHashFunctionIntegrity, kBasicScript, secu reURL);
297 } 297 }
298 298
299 } // namespace blink 299 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/frame/SubresourceIntegrity.cpp ('k') | Source/core/frame/UseCounter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698