summaryrefslogtreecommitdiffstats
path: root/chrome/common/extensions/url_pattern_set_unittest.cc
diff options
context:
space:
mode:
authorjstritar@chromium.org <jstritar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-13 15:03:47 +0000
committerjstritar@chromium.org <jstritar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-13 15:03:47 +0000
commit06e8b8ff0c9313a90243012961601ab63e89de1e (patch)
tree551c4198944f30c223acd905a0ba5874ff6f810f /chrome/common/extensions/url_pattern_set_unittest.cc
parent613ccd6ad9e76e63dd76a579ed3a6b04fb13025b (diff)
downloadchromium_src-06e8b8ff0c9313a90243012961601ab63e89de1e.zip
chromium_src-06e8b8ff0c9313a90243012961601ab63e89de1e.tar.gz
chromium_src-06e8b8ff0c9313a90243012961601ab63e89de1e.tar.bz2
Update URLPatternSet to contain a std::set instead of std::vector.
This updates URLPatternSet to contain a std::set instead of a std::vector, making it easier to implement the set operations in ExtensionPermissionSet. BUG=84507 TEST=unit_tests Review URL: http://codereview.chromium.org/7347011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92364 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/extensions/url_pattern_set_unittest.cc')
-rw-r--r--chrome/common/extensions/url_pattern_set_unittest.cc25
1 files changed, 2 insertions, 23 deletions
diff --git a/chrome/common/extensions/url_pattern_set_unittest.cc b/chrome/common/extensions/url_pattern_set_unittest.cc
index 8c05f2c..f9717ef 100644
--- a/chrome/common/extensions/url_pattern_set_unittest.cc
+++ b/chrome/common/extensions/url_pattern_set_unittest.cc
@@ -7,27 +7,6 @@
#include "googleurl/src/gurl.h"
#include "testing/gtest/include/gtest/gtest.h"
-namespace {
-
-static void AssertEqualExtents(const URLPatternSet& extent1,
- const URLPatternSet& extent2) {
- URLPatternList patterns1 = extent1.patterns();
- URLPatternList patterns2 = extent2.patterns();
- std::set<std::string> strings1;
- EXPECT_EQ(patterns1.size(), patterns2.size());
-
- for (size_t i = 0; i < patterns1.size(); ++i)
- strings1.insert(patterns1.at(i).GetAsString());
-
- std::set<std::string> strings2;
- for (size_t i = 0; i < patterns2.size(); ++i)
- strings2.insert(patterns2.at(i).GetAsString());
-
- EXPECT_EQ(strings1, strings2);
-}
-
-} // namespace
-
static const int kAllSchemes =
URLPattern::SCHEME_HTTP |
URLPattern::SCHEME_HTTPS |
@@ -96,7 +75,7 @@ TEST(URLPatternSetTest, CreateUnion) {
// Union with an empty set.
URLPatternSet result;
URLPatternSet::CreateUnion(extent1, empty_extent, &result);
- AssertEqualExtents(expected, result);
+ EXPECT_EQ(expected, result);
// Union with a real set (including a duplicate).
URLPatternSet extent2;
@@ -111,5 +90,5 @@ TEST(URLPatternSetTest, CreateUnion) {
result.ClearPatterns();
URLPatternSet::CreateUnion(extent1, extent2, &result);
- AssertEqualExtents(expected, result);
+ EXPECT_EQ(expected, result);
}