OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "extensions/common/url_pattern.h" |
| 6 |
5 #include <stddef.h> | 7 #include <stddef.h> |
6 | 8 |
| 9 #include <memory> |
| 10 |
7 #include "base/macros.h" | 11 #include "base/macros.h" |
8 #include "base/memory/scoped_ptr.h" | |
9 #include "extensions/common/url_pattern.h" | |
10 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
11 #include "url/gurl.h" | 13 #include "url/gurl.h" |
12 | 14 |
13 namespace { | 15 namespace { |
14 | 16 |
15 // See url_pattern.h for examples of valid and invalid patterns. | 17 // See url_pattern.h for examples of valid and invalid patterns. |
16 | 18 |
17 static const int kAllSchemes = | 19 static const int kAllSchemes = |
18 URLPattern::SCHEME_HTTP | | 20 URLPattern::SCHEME_HTTP | |
19 URLPattern::SCHEME_HTTPS | | 21 URLPattern::SCHEME_HTTPS | |
(...skipping 821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
841 EXPECT_TRUE(URLPattern(URLPattern::SCHEME_HTTPS, "https://www.google.com/") | 843 EXPECT_TRUE(URLPattern(URLPattern::SCHEME_HTTPS, "https://www.google.com/") |
842 .MatchesSingleOrigin()); | 844 .MatchesSingleOrigin()); |
843 EXPECT_FALSE(URLPattern(URLPattern::SCHEME_HTTP, | 845 EXPECT_FALSE(URLPattern(URLPattern::SCHEME_HTTP, |
844 "http://*.google.com/foo/bar").MatchesSingleOrigin()); | 846 "http://*.google.com/foo/bar").MatchesSingleOrigin()); |
845 EXPECT_TRUE( | 847 EXPECT_TRUE( |
846 URLPattern(URLPattern::SCHEME_HTTP, "http://www.google.com/foo/bar") | 848 URLPattern(URLPattern::SCHEME_HTTP, "http://www.google.com/foo/bar") |
847 .MatchesSingleOrigin()); | 849 .MatchesSingleOrigin()); |
848 } | 850 } |
849 | 851 |
850 } // namespace | 852 } // namespace |
OLD | NEW |