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/matcher/url_matcher.h" | 5 #include "extensions/common/matcher/url_matcher.h" |
6 | 6 |
7 #include "base/strings/string_util.h" | 7 #include "base/strings/string_util.h" |
8 #include "googleurl/src/gurl.h" | |
9 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 #include "url/gurl.h" |
10 | 10 |
11 namespace extensions { | 11 namespace extensions { |
12 | 12 |
13 // | 13 // |
14 // URLMatcherCondition | 14 // URLMatcherCondition |
15 // | 15 // |
16 | 16 |
17 TEST(URLMatcherConditionTest, Constructors) { | 17 TEST(URLMatcherConditionTest, Constructors) { |
18 StringPattern pattern("example.com", 1); | 18 StringPattern pattern("example.com", 1); |
19 URLMatcherCondition m1(URLMatcherCondition::HOST_SUFFIX, &pattern); | 19 URLMatcherCondition m1(URLMatcherCondition::HOST_SUFFIX, &pattern); |
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
673 conditions.insert(factory->CreateOriginAndPathMatchesCondition("val")); | 673 conditions.insert(factory->CreateOriginAndPathMatchesCondition("val")); |
674 const int kConditionSetId = 1; | 674 const int kConditionSetId = 1; |
675 URLMatcherConditionSet::Vector insert; | 675 URLMatcherConditionSet::Vector insert; |
676 insert.push_back(make_scoped_refptr( | 676 insert.push_back(make_scoped_refptr( |
677 new URLMatcherConditionSet(kConditionSetId, conditions))); | 677 new URLMatcherConditionSet(kConditionSetId, conditions))); |
678 matcher.AddConditionSets(insert); | 678 matcher.AddConditionSets(insert); |
679 EXPECT_EQ(0u, matcher.MatchURL(url).size()); | 679 EXPECT_EQ(0u, matcher.MatchURL(url).size()); |
680 } | 680 } |
681 | 681 |
682 } // namespace extensions | 682 } // namespace extensions |
OLD | NEW |