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

Unified Diff: extensions/common/url_pattern_set_unittest.cc

Issue 396033002: Support "always allow" for runtime script execution (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Final fixes Created 6 years, 4 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 | « extensions/common/url_pattern_set.cc ('k') | extensions/common/url_pattern_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/common/url_pattern_set_unittest.cc
diff --git a/extensions/common/url_pattern_set_unittest.cc b/extensions/common/url_pattern_set_unittest.cc
index 1ad223ec53ac86db9deacef6d258330d7ceac03b..ce2c94e5fe60794f38e107831728a2e153bb38da 100644
--- a/extensions/common/url_pattern_set_unittest.cc
+++ b/extensions/common/url_pattern_set_unittest.cc
@@ -421,4 +421,22 @@ TEST(URLPatternSetTest, NwayUnion) {
}
}
+TEST(URLPatternSetTest, AddOrigin) {
+ URLPatternSet set;
+ EXPECT_TRUE(set.AddOrigin(
+ URLPattern::SCHEME_ALL, GURL("https://www.google.com/")));
+ EXPECT_TRUE(set.MatchesURL(GURL("https://www.google.com/foo/bar")));
+ EXPECT_FALSE(set.MatchesURL(GURL("http://www.google.com/foo/bar")));
+ EXPECT_FALSE(set.MatchesURL(GURL("https://en.google.com/foo/bar")));
+ set.ClearPatterns();
+
+ EXPECT_TRUE(set.AddOrigin(
+ URLPattern::SCHEME_ALL, GURL("https://google.com/")));
+ EXPECT_FALSE(set.MatchesURL(GURL("https://www.google.com/foo/bar")));
+ EXPECT_TRUE(set.MatchesURL(GURL("https://google.com/foo/bar")));
+
+ EXPECT_FALSE(set.AddOrigin(
+ URLPattern::SCHEME_HTTP, GURL("https://google.com/")));
+}
+
} // namespace extensions
« no previous file with comments | « extensions/common/url_pattern_set.cc ('k') | extensions/common/url_pattern_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698