| OLD | NEW |
| 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/fetch/Resource.h" | 10 #include "core/fetch/Resource.h" |
| (...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 expectIntegrity(kSha256Integrity, kBasicScript, secureURL, insecureURL); | 432 expectIntegrity(kSha256Integrity, kBasicScript, secureURL, insecureURL); |
| 433 expectIntegrity(kSha256IntegrityLenientSyntax, kBasicScript, secureURL, inse
cureURL); | 433 expectIntegrity(kSha256IntegrityLenientSyntax, kBasicScript, secureURL, inse
cureURL); |
| 434 expectIntegrity(kSha384Integrity, kBasicScript, secureURL, insecureURL); | 434 expectIntegrity(kSha384Integrity, kBasicScript, secureURL, insecureURL); |
| 435 expectIntegrity(kSha512Integrity, kBasicScript, secureURL, insecureURL); | 435 expectIntegrity(kSha512Integrity, kBasicScript, secureURL, insecureURL); |
| 436 expectIntegrityFailure(kSha384IntegrityLabeledAs256, kBasicScript, secureURL
, insecureURL); | 436 expectIntegrityFailure(kSha384IntegrityLabeledAs256, kBasicScript, secureURL
, insecureURL); |
| 437 expectIntegrity(kUnsupportedHashFunctionIntegrity, kBasicScript, secureURL,
insecureURL); | 437 expectIntegrity(kUnsupportedHashFunctionIntegrity, kBasicScript, secureURL,
insecureURL); |
| 438 | 438 |
| 439 expectIntegrity(kSha256AndSha384Integrities, kBasicScript, secureURL, insecu
reURL); | 439 expectIntegrity(kSha256AndSha384Integrities, kBasicScript, secureURL, insecu
reURL); |
| 440 expectIntegrity(kBadSha256AndGoodSha384Integrities, kBasicScript, secureURL,
insecureURL); | 440 expectIntegrity(kBadSha256AndGoodSha384Integrities, kBasicScript, secureURL,
insecureURL); |
| 441 | 441 |
| 442 // The cross origin (http -> https case) should return true, but it will |
| 443 // output a console error. |
| 444 expectIntegrity(kSha256Integrity, kBasicScript, secureURL, insecureURL, NoCo
rs); |
| 445 |
| 442 expectIntegrityFailure(kGoodSha256AndBadSha384Integrities, kBasicScript, sec
ureURL, insecureURL); | 446 expectIntegrityFailure(kGoodSha256AndBadSha384Integrities, kBasicScript, sec
ureURL, insecureURL); |
| 443 | |
| 444 // This check should fail because, unlike in the | |
| 445 // CheckSubresourceIntegrityInSecureOrigin case, this is cross origin | |
| 446 // (secure origin requesting a resource on an insecure origin) | |
| 447 expectIntegrityFailure(kSha256Integrity, kBasicScript, secureURL, insecureUR
L, NoCors); | |
| 448 } | 447 } |
| 449 | 448 |
| 450 } // namespace blink | 449 } // namespace blink |
| OLD | NEW |