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

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

Issue 660723003: Oilpan: fix build after r183788. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 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 | « no previous file | no next file » | 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 { 119 {
120 scriptElement->setAttribute(HTMLNames::integrityAttr, integrity); 120 scriptElement->setAttribute(HTMLNames::integrityAttr, integrity);
121 EXPECT_FALSE(SubresourceIntegrity::CheckSubresourceIntegrity(*scriptElem ent, script, url)); 121 EXPECT_FALSE(SubresourceIntegrity::CheckSubresourceIntegrity(*scriptElem ent, script, url));
122 } 122 }
123 123
124 KURL secureURL; 124 KURL secureURL;
125 KURL insecureURL; 125 KURL insecureURL;
126 RefPtr<SecurityOrigin> secureOrigin; 126 RefPtr<SecurityOrigin> secureOrigin;
127 RefPtr<SecurityOrigin> insecureOrigin; 127 RefPtr<SecurityOrigin> insecureOrigin;
128 128
129 RefPtrWillBeRawPtr<Document> document; 129 RefPtrWillBePersistent<Document> document;
130 RefPtrWillBeRawPtr<HTMLScriptElement> scriptElement; 130 RefPtrWillBePersistent<HTMLScriptElement> scriptElement;
131 }; 131 };
132 132
133 TEST_F(SubresourceIntegrityTest, ParseAlgorithm) 133 TEST_F(SubresourceIntegrityTest, ParseAlgorithm)
134 { 134 {
135 expectAlgorithm("sha256;", HashAlgorithmSha256); 135 expectAlgorithm("sha256;", HashAlgorithmSha256);
136 expectAlgorithm("sha384;", HashAlgorithmSha384); 136 expectAlgorithm("sha384;", HashAlgorithmSha384);
137 expectAlgorithm("sha512;", HashAlgorithmSha512); 137 expectAlgorithm("sha512;", HashAlgorithmSha512);
138 138
139 expectAlgorithmFailure("sha1;"); 139 expectAlgorithmFailure("sha1;");
140 expectAlgorithmFailure("sha-1;"); 140 expectAlgorithmFailure("sha-1;");
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 document->updateSecurityOrigin(insecureOrigin->isolatedCopy()); 214 document->updateSecurityOrigin(insecureOrigin->isolatedCopy());
215 215
216 expectIntegrityFailure(kSha256Integrity, kBasicScript, secureURL); 216 expectIntegrityFailure(kSha256Integrity, kBasicScript, secureURL);
217 expectIntegrityFailure(kSha384Integrity, kBasicScript, secureURL); 217 expectIntegrityFailure(kSha384Integrity, kBasicScript, secureURL);
218 expectIntegrityFailure(kSha512Integrity, kBasicScript, secureURL); 218 expectIntegrityFailure(kSha512Integrity, kBasicScript, secureURL);
219 expectIntegrityFailure(kSha384IntegrityLabeledAs256, kBasicScript, secureURL ); 219 expectIntegrityFailure(kSha384IntegrityLabeledAs256, kBasicScript, secureURL );
220 expectIntegrityFailure(kUnsupportedHashFunctionIntegrity, kBasicScript, secu reURL); 220 expectIntegrityFailure(kUnsupportedHashFunctionIntegrity, kBasicScript, secu reURL);
221 } 221 }
222 222
223 } // namespace blink 223 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698