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

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

Issue 15759013: Update extensions/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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
« no previous file with comments | « no previous file | extensions/common/one_shot_event.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/url_matcher_factory.h" 5 #include "extensions/common/matcher/url_matcher_factory.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/format_macros.h" 8 #include "base/format_macros.h"
9 #include "base/stringprintf.h" 9 #include "base/stringprintf.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 } 237 }
238 238
239 URLMatcher matcher; 239 URLMatcher matcher;
240 std::string error; 240 std::string error;
241 scoped_refptr<URLMatcherConditionSet> result; 241 scoped_refptr<URLMatcherConditionSet> result;
242 242
243 result = URLMatcherFactory::CreateFromURLFilterDictionary( 243 result = URLMatcherFactory::CreateFromURLFilterDictionary(
244 matcher.condition_factory(), &condition, 1, &error); 244 matcher.condition_factory(), &condition, 1, &error);
245 if (expected_result == CREATE_FAILURE) { 245 if (expected_result == CREATE_FAILURE) {
246 EXPECT_FALSE(error.empty()); 246 EXPECT_FALSE(error.empty());
247 EXPECT_FALSE(result); 247 EXPECT_FALSE(result.get());
248 return; 248 return;
249 } 249 }
250 EXPECT_EQ("", error); 250 EXPECT_EQ("", error);
251 ASSERT_TRUE(result.get()); 251 ASSERT_TRUE(result.get());
252 252
253 URLMatcherConditionSet::Vector conditions; 253 URLMatcherConditionSet::Vector conditions;
254 conditions.push_back(result); 254 conditions.push_back(result);
255 matcher.AddConditionSets(conditions); 255 matcher.AddConditionSets(conditions);
256 EXPECT_EQ((expected_result == OK ? 1u : 0u), matcher.MatchURL(url_).size()) 256 EXPECT_EQ((expected_result == OK ? 1u : 0u), matcher.MatchURL(url_).size())
257 << "while matching condition " << condition_key_ << " with value " 257 << "while matching condition " << condition_key_ << " with value "
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 kIsUrlCaseSensitive, kIsUrlLowerCaseEnforced, url), 330 kIsUrlCaseSensitive, kIsUrlLowerCaseEnforced, url),
331 }; 331 };
332 332
333 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(case_tests); ++i) { 333 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(case_tests); ++i) {
334 SCOPED_TRACE(base::StringPrintf("Iteration: %" PRIuS, i)); 334 SCOPED_TRACE(base::StringPrintf("Iteration: %" PRIuS, i));
335 case_tests[i].Test(); 335 case_tests[i].Test();
336 } 336 }
337 } 337 }
338 338
339 } // namespace extensions 339 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | extensions/common/one_shot_event.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698