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

Side by Side Diff: extensions/common/matcher/regex_set_matcher_unittest.cc

Issue 12092096: Move c/c/extensions/matcher/ to top level extension dir (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: TOT Created 7 years, 10 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 (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 <set> 5 #include <set>
6 6
7 #include "base/stl_util.h" 7 #include "base/stl_util.h"
8 #include "chrome/common/extensions/matcher/regex_set_matcher.h" 8 #include "extensions/common/matcher/regex_set_matcher.h"
9 #include "googleurl/src/gurl.h" 9 #include "googleurl/src/gurl.h"
10 10
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 12
13 using extensions::StringPattern; 13 using extensions::StringPattern;
14 using extensions::RegexSetMatcher; 14 using extensions::RegexSetMatcher;
15 15
16 TEST(RegexSetMatcherTest, MatchRegexes) { 16 TEST(RegexSetMatcherTest, MatchRegexes) {
17 StringPattern pattern_1("ab.*c", 42); 17 StringPattern pattern_1("ab.*c", 42);
18 StringPattern pattern_2("f*f", 17); 18 StringPattern pattern_2("f*f", 17);
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 52
53 std::set<StringPattern::ID> result1; 53 std::set<StringPattern::ID> result1;
54 matcher.Match("http://aaa.net/", &result1); 54 matcher.Match("http://aaa.net/", &result1);
55 EXPECT_EQ(0U, result1.size()); 55 EXPECT_EQ(0U, result1.size());
56 56
57 std::set<StringPattern::ID> result2; 57 std::set<StringPattern::ID> result2;
58 matcher.Match("http://aaa.net/quaaACK", &result2); 58 matcher.Match("http://aaa.net/quaaACK", &result2);
59 EXPECT_EQ(1U, result2.size()); 59 EXPECT_EQ(1U, result2.size());
60 EXPECT_TRUE(ContainsKey(result2, 57)); 60 EXPECT_TRUE(ContainsKey(result2, 57));
61 } 61 }
OLDNEW
« no previous file with comments | « extensions/common/matcher/regex_set_matcher.cc ('k') | extensions/common/matcher/string_pattern.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698