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

Unified Diff: chrome/common/extensions/extension_extent_unittest.cc

Issue 3039005: Fix some issues with extensions: (Closed)
Patch Set: fix host perms Created 10 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/extensions/extension.cc ('k') | chrome/common/extensions/url_pattern.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/extension_extent_unittest.cc
diff --git a/chrome/common/extensions/extension_extent_unittest.cc b/chrome/common/extensions/extension_extent_unittest.cc
index 2284f8e987fc0629bad30e2ad9ab4d7531e3bdd6..8297eca48007a8d0d6299667685700c40ab5cd6d 100644
--- a/chrome/common/extensions/extension_extent_unittest.cc
+++ b/chrome/common/extensions/extension_extent_unittest.cc
@@ -7,7 +7,12 @@
#include "googleurl/src/gurl.h"
#include "testing/gtest/include/gtest/gtest.h"
-static const int kSchemes = URLPattern::SCHEMES_ALL;
+static const int kAllSchemes =
+ URLPattern::SCHEME_HTTP |
+ URLPattern::SCHEME_HTTPS |
+ URLPattern::SCHEME_FILE |
+ URLPattern::SCHEME_FTP |
+ URLPattern::SCHEME_CHROMEUI;
TEST(ExtensionExtentTest, Empty) {
ExtensionExtent extent;
@@ -18,7 +23,7 @@ TEST(ExtensionExtentTest, Empty) {
TEST(ExtensionExtentTest, One) {
ExtensionExtent extent;
- extent.AddPattern(URLPattern(kSchemes, "http://www.google.com/*"));
+ extent.AddPattern(URLPattern(kAllSchemes, "http://www.google.com/*"));
EXPECT_TRUE(extent.ContainsURL(GURL("http://www.google.com/")));
EXPECT_TRUE(extent.ContainsURL(GURL("http://www.google.com/monkey")));
@@ -28,8 +33,8 @@ TEST(ExtensionExtentTest, One) {
TEST(ExtensionExtentTest, Two) {
ExtensionExtent extent;
- extent.AddPattern(URLPattern(kSchemes, "http://www.google.com/*"));
- extent.AddPattern(URLPattern(kSchemes, "http://www.yahoo.com/*"));
+ extent.AddPattern(URLPattern(kAllSchemes, "http://www.google.com/*"));
+ extent.AddPattern(URLPattern(kAllSchemes, "http://www.yahoo.com/*"));
EXPECT_TRUE(extent.ContainsURL(GURL("http://www.google.com/monkey")));
EXPECT_TRUE(extent.ContainsURL(GURL("http://www.yahoo.com/monkey")));
@@ -38,16 +43,16 @@ TEST(ExtensionExtentTest, Two) {
TEST(ExtensionExtentTest, OverlapsWith) {
ExtensionExtent extent1;
- extent1.AddPattern(URLPattern(kSchemes, "http://www.google.com/f*"));
- extent1.AddPattern(URLPattern(kSchemes, "http://www.yahoo.com/b*"));
+ extent1.AddPattern(URLPattern(kAllSchemes, "http://www.google.com/f*"));
+ extent1.AddPattern(URLPattern(kAllSchemes, "http://www.yahoo.com/b*"));
ExtensionExtent extent2;
- extent2.AddPattern(URLPattern(kSchemes, "http://www.reddit.com/f*"));
- extent2.AddPattern(URLPattern(kSchemes, "http://www.yahoo.com/z*"));
+ extent2.AddPattern(URLPattern(kAllSchemes, "http://www.reddit.com/f*"));
+ extent2.AddPattern(URLPattern(kAllSchemes, "http://www.yahoo.com/z*"));
ExtensionExtent extent3;
- extent3.AddPattern(URLPattern(kSchemes, "http://www.google.com/q/*"));
- extent3.AddPattern(URLPattern(kSchemes, "http://www.yahoo.com/b/*"));
+ extent3.AddPattern(URLPattern(kAllSchemes, "http://www.google.com/q/*"));
+ extent3.AddPattern(URLPattern(kAllSchemes, "http://www.yahoo.com/b/*"));
EXPECT_FALSE(extent1.OverlapsWith(extent2));
EXPECT_FALSE(extent2.OverlapsWith(extent1));
« no previous file with comments | « chrome/common/extensions/extension.cc ('k') | chrome/common/extensions/url_pattern.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698