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

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

Issue 13145003: Rewrite std::string("") to std::string(), Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ugh Created 7 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 | Annotate | Revision Log
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 "extensions/common/matcher/substring_set_matcher.h" 5 #include "extensions/common/matcher/substring_set_matcher.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 110
111 // Test non-match 111 // Test non-match
112 // String abcde 112 // String abcde
113 // Pattern 1 fg 113 // Pattern 1 fg
114 TestOnePattern("abcde", "fg", false); 114 TestOnePattern("abcde", "fg", false);
115 115
116 // Test empty pattern and too long pattern 116 // Test empty pattern and too long pattern
117 // String abcde 117 // String abcde
118 // Pattern 1 118 // Pattern 1
119 // Pattern 2 abcdef 119 // Pattern 2 abcdef
120 TestTwoPatterns("abcde", "", "abcdef", true, false); 120 TestTwoPatterns("abcde", std::string(), "abcdef", true, false);
121 } 121 }
122 122
123 TEST(SubstringSetMatcherTest, RegisterAndRemove) { 123 TEST(SubstringSetMatcherTest, RegisterAndRemove) {
124 SubstringSetMatcher matcher; 124 SubstringSetMatcher matcher;
125 125
126 StringPattern pattern_1("a", 1); 126 StringPattern pattern_1("a", 1);
127 StringPattern pattern_2("b", 2); 127 StringPattern pattern_2("b", 2);
128 StringPattern pattern_3("c", 3); 128 StringPattern pattern_3("c", 3);
129 129
130 std::vector<const StringPattern*> patterns; 130 std::vector<const StringPattern*> patterns;
(...skipping 27 matching lines...) Expand all
158 matcher.UnregisterPatterns(patterns); 158 matcher.UnregisterPatterns(patterns);
159 EXPECT_TRUE(matcher.IsEmpty()); 159 EXPECT_TRUE(matcher.IsEmpty());
160 } 160 }
161 161
162 TEST(SubstringSetMatcherTest, TestEmptyMatcher) { 162 TEST(SubstringSetMatcherTest, TestEmptyMatcher) {
163 SubstringSetMatcher matcher; 163 SubstringSetMatcher matcher;
164 std::set<int> matches; 164 std::set<int> matches;
165 matcher.Match("abd", &matches); 165 matcher.Match("abd", &matches);
166 EXPECT_TRUE(matches.empty()); 166 EXPECT_TRUE(matches.empty());
167 } 167 }
OLDNEW
« no previous file with comments | « extensions/common/extension_resource_unittest.cc ('k') | extensions/common/matcher/url_matcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698