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

Side by Side Diff: third_party/WebKit/Source/core/frame/csp/CSPSourceTest.cpp

Issue 1854543002: Oilpan: Remove WillBe types (part 7) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
OLDNEW
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"
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 12
13 namespace blink { 13 namespace blink {
14 14
15 class CSPSourceTest : public ::testing::Test { 15 class CSPSourceTest : public ::testing::Test {
16 public: 16 public:
17 CSPSourceTest() 17 CSPSourceTest()
18 : csp(ContentSecurityPolicy::create()) 18 : csp(ContentSecurityPolicy::create())
19 { 19 {
20 } 20 }
21 21
22 protected: 22 protected:
23 RefPtrWillBePersistent<ContentSecurityPolicy> csp; 23 Persistent<ContentSecurityPolicy> csp;
24 }; 24 };
25 25
26 TEST_F(CSPSourceTest, BasicMatching) 26 TEST_F(CSPSourceTest, BasicMatching)
27 { 27 {
28 KURL base; 28 KURL base;
29 CSPSource source(csp.get(), "http", "example.com", 8000, "/foo/", CSPSource: :NoWildcard, CSPSource::NoWildcard); 29 CSPSource source(csp.get(), "http", "example.com", 8000, "/foo/", CSPSource: :NoWildcard, CSPSource::NoWildcard);
30 30
31 EXPECT_TRUE(source.matches(KURL(base, "http://example.com:8000/foo/"))); 31 EXPECT_TRUE(source.matches(KURL(base, "http://example.com:8000/foo/")));
32 EXPECT_TRUE(source.matches(KURL(base, "http://example.com:8000/foo/bar"))); 32 EXPECT_TRUE(source.matches(KURL(base, "http://example.com:8000/foo/bar")));
33 EXPECT_TRUE(source.matches(KURL(base, "HTTP://EXAMPLE.com:8000/foo/BAR"))); 33 EXPECT_TRUE(source.matches(KURL(base, "HTTP://EXAMPLE.com:8000/foo/BAR")));
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 blink 94 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698