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

Unified Diff: chrome/common/extensions/user_script_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/url_pattern_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/user_script_unittest.cc
diff --git a/chrome/common/extensions/user_script_unittest.cc b/chrome/common/extensions/user_script_unittest.cc
index d1770898e4001692954520d9cdb3e3cb994e8062..beeea95598e1c66182615e6822aed815ab050180 100644
--- a/chrome/common/extensions/user_script_unittest.cc
+++ b/chrome/common/extensions/user_script_unittest.cc
@@ -8,6 +8,13 @@
#include "googleurl/src/gurl.h"
#include "testing/gtest/include/gtest/gtest.h"
+static const int kAllSchemes =
+ URLPattern::SCHEME_HTTP |
+ URLPattern::SCHEME_HTTPS |
+ URLPattern::SCHEME_FILE |
+ URLPattern::SCHEME_FTP |
+ URLPattern::SCHEME_CHROMEUI;
+
TEST(UserScriptTest, Match1) {
UserScript script;
script.add_glob("*mail.google.com*");
@@ -63,7 +70,7 @@ TEST(UserScriptTest, Match5) {
}
TEST(UserScriptTest, Match6) {
- URLPattern pattern(URLPattern::SCHEMES_ALL);
+ URLPattern pattern(kAllSchemes);
ASSERT_TRUE(pattern.Parse("http://*/foo*"));
UserScript script;
@@ -78,7 +85,7 @@ TEST(UserScriptTest, UrlPatternGlobInteraction) {
// If there are both, match intersection(union(globs), union(urlpatterns)).
UserScript script;
- URLPattern pattern(URLPattern::SCHEMES_ALL);
+ URLPattern pattern(kAllSchemes);
ASSERT_TRUE(pattern.Parse("http://www.google.com/*"));
script.add_url_pattern(pattern);
@@ -105,8 +112,8 @@ TEST(UserScriptTest, UrlPatternGlobInteraction) {
}
TEST(UserScriptTest, Pickle) {
- URLPattern pattern1(URLPattern::SCHEMES_ALL);
- URLPattern pattern2(URLPattern::SCHEMES_ALL);
+ URLPattern pattern1(kAllSchemes);
+ URLPattern pattern2(kAllSchemes);
ASSERT_TRUE(pattern1.Parse("http://*/foo*"));
ASSERT_TRUE(pattern2.Parse("http://bar/baz*"));
« no previous file with comments | « chrome/common/extensions/url_pattern_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698