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

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: Test changes 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..b0ad1f2bcd1c794bfece06dd5cf8a363d92bd6b4 100644
--- a/extensions/common/url_pattern_set_unittest.cc
+++ b/extensions/common/url_pattern_set_unittest.cc
@@ -421,4 +421,18 @@ TEST(URLPatternSetTest, NwayUnion) {
}
}
+TEST(URLPatternSetTest, AddOrigin) {
+ URLPatternSet set;
+ set.AddOrigin(URLPattern::SCHEME_ALL, GURL("https://www.google.com/"));
not at google - send to devlin 2014/08/14 23:04:48 Huh, I would have thought ToOrigin of 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();
+
+ set.AddOrigin(URLPattern::SCHEME_ALL, GURL("http://en.foo.com/"));
not at google - send to devlin 2014/08/14 23:04:48 there's no difference between this and the google.
gpdavis 2014/08/14 23:31:33 Sure, I can do that.
+ EXPECT_TRUE(set.MatchesURL(GURL("http://en.foo.com/bar")));
+ EXPECT_FALSE(set.MatchesURL(GURL("https://www.foo.com/")));
+ EXPECT_FALSE(set.MatchesURL(GURL("http://www.foo.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