OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 }; | 77 }; |
78 | 78 |
79 const char insecureURLA[] = "http://a.test/path/to/file.html"; | 79 const char insecureURLA[] = "http://a.test/path/to/file.html"; |
80 const char insecureURLB[] = "http://b.test/path/to/file.html"; | 80 const char insecureURLB[] = "http://b.test/path/to/file.html"; |
81 const char insecureOriginA[] = "http://a.test/"; | 81 const char insecureOriginA[] = "http://a.test/"; |
82 | 82 |
83 const char secureURLA[] = "https://a.test/path/to/file.html"; | 83 const char secureURLA[] = "https://a.test/path/to/file.html"; |
84 const char secureURLB[] = "https://b.test/path/to/file.html"; | 84 const char secureURLB[] = "https://b.test/path/to/file.html"; |
85 const char secureOriginA[] = "https://a.test/"; | 85 const char secureOriginA[] = "https://a.test/"; |
86 | 86 |
87 const char blobURL[] = "blob:http%3A//a.test/b3aae9c8-7f90-440d-8d7c-43aa20d
72fde"; | 87 const char blobURL[] = |
88 const char filesystemURL[] = "filesystem:http%3A//a.test/path/t/file.html"; | 88 "blob:http://a.test/b3aae9c8-7f90-440d-8d7c-43aa20d72fde"; |
| 89 const char filesystemURL[] = "filesystem:http://a.test/path/t/file.html"; |
89 | 90 |
90 TestCase inputs[] = { | 91 TestCase inputs[] = { |
91 // HTTP -> HTTP: Same Origin | 92 // HTTP -> HTTP: Same Origin |
92 { ReferrerPolicyAlways, insecureURLA, insecureURLA, insecureURLA }, | 93 { ReferrerPolicyAlways, insecureURLA, insecureURLA, insecureURLA }, |
93 { ReferrerPolicyDefault, insecureURLA, insecureURLA, insecureURLA }, | 94 { ReferrerPolicyDefault, insecureURLA, insecureURLA, insecureURLA }, |
94 { ReferrerPolicyNoReferrerWhenDowngrade, insecureURLA, insecureURLA, ins
ecureURLA }, | 95 { ReferrerPolicyNoReferrerWhenDowngrade, insecureURLA, insecureURLA, ins
ecureURLA }, |
95 { ReferrerPolicyNever, insecureURLA, insecureURLA, 0 }, | 96 { ReferrerPolicyNever, insecureURLA, insecureURLA, 0 }, |
96 { ReferrerPolicyOrigin, insecureURLA, insecureURLA, insecureOriginA }, | 97 { ReferrerPolicyOrigin, insecureURLA, insecureURLA, insecureOriginA }, |
97 { ReferrerPolicyOriginWhenCrossOrigin, insecureURLA, insecureURLA, insec
ureURLA }, | 98 { ReferrerPolicyOriginWhenCrossOrigin, insecureURLA, insecureURLA, insec
ureURLA }, |
98 | 99 |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 | 205 |
205 EXPECT_FALSE(origin1->isPotentiallyTrustworthy()); | 206 EXPECT_FALSE(origin1->isPotentiallyTrustworthy()); |
206 EXPECT_FALSE(origin2->isPotentiallyTrustworthy()); | 207 EXPECT_FALSE(origin2->isPotentiallyTrustworthy()); |
207 SecurityPolicy::addOriginTrustworthyWhiteList(origin1); | 208 SecurityPolicy::addOriginTrustworthyWhiteList(origin1); |
208 EXPECT_TRUE(origin1->isPotentiallyTrustworthy()); | 209 EXPECT_TRUE(origin1->isPotentiallyTrustworthy()); |
209 EXPECT_TRUE(origin2->isPotentiallyTrustworthy()); | 210 EXPECT_TRUE(origin2->isPotentiallyTrustworthy()); |
210 } | 211 } |
211 } | 212 } |
212 | 213 |
213 } // namespace blink | 214 } // namespace blink |
OLD | NEW |