OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "core/frame/csp/CSPSource.h" | 5 #include "core/frame/csp/CSPSource.h" |
6 | 6 |
7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
8 #include "core/frame/csp/ContentSecurityPolicy.h" | 8 #include "core/frame/csp/ContentSecurityPolicy.h" |
9 #include "platform/weborigin/KURL.h" | 9 #include "platform/weborigin/KURL.h" |
10 #include "platform/weborigin/SecurityOrigin.h" | 10 #include "platform/weborigin/SecurityOrigin.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 { | 84 { |
85 KURL base; | 85 KURL base; |
86 CSPSource source(csp.get(), "http", "example.com", 0, "/", CSPSource::NoWild
card, CSPSource::HasWildcard); | 86 CSPSource source(csp.get(), "http", "example.com", 0, "/", CSPSource::NoWild
card, CSPSource::HasWildcard); |
87 | 87 |
88 EXPECT_TRUE(source.matches(KURL(base, "http://example.com:8000/"))); | 88 EXPECT_TRUE(source.matches(KURL(base, "http://example.com:8000/"))); |
89 EXPECT_FALSE(source.matches(KURL(base, "http://not-example.com:8000/"))); | 89 EXPECT_FALSE(source.matches(KURL(base, "http://not-example.com:8000/"))); |
90 EXPECT_TRUE(source.matches(KURL(base, "https://example.com:8000/"))); | 90 EXPECT_TRUE(source.matches(KURL(base, "https://example.com:8000/"))); |
91 EXPECT_FALSE(source.matches(KURL(base, "https://not-example.com:8000/"))); | 91 EXPECT_FALSE(source.matches(KURL(base, "https://not-example.com:8000/"))); |
92 } | 92 } |
93 | 93 |
94 } // namespace | 94 } // namespace blink |
OLD | NEW |