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

Unified Diff: chrome/browser/extensions/user_script_master_unittest.cc

Issue 226663003: Allow content script insertion on about:-URLs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use matches_about_blank key instead of about:* permission. Created 6 years, 8 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
Index: chrome/browser/extensions/user_script_master_unittest.cc
diff --git a/chrome/browser/extensions/user_script_master_unittest.cc b/chrome/browser/extensions/user_script_master_unittest.cc
index 8347cbe5e48c14d8eea63ccb98d228144bb5c816..bb9421a587b1a7179238f46a0aca68a5928f3d30 100644
--- a/chrome/browser/extensions/user_script_master_unittest.cc
+++ b/chrome/browser/extensions/user_script_master_unittest.cc
@@ -229,6 +229,20 @@ TEST_F(UserScriptMasterTest, Parse8) {
script.exclude_url_patterns().begin()->GetAsString());
}
+TEST_F(UserScriptMasterTest, Parse9) {
+ const std::string text(
+ "// ==UserScript==\n"
+ "// @include about:blank\n"
not at google - send to devlin 2014/04/21 19:56:22 ah. do we really need to make this work for about:
robwu 2014/04/21 22:15:41 No, my use case does not require about:blank for u
+ "// @match http://example.com/*\n"
+ "// ==/UserScript==\n");
+
+ UserScript script;
+ EXPECT_TRUE(
+ UserScriptMaster::ScriptReloader::ParseMetadataHeader(text, &script));
+ ASSERT_EQ(0U, script.globs().size());
+ EXPECT_TRUE(script.match_about_blank());
+}
+
TEST_F(UserScriptMasterTest, SkipBOMAtTheBeginning) {
base::FilePath path = temp_dir_.path().AppendASCII("script.user.js");
const std::string content("\xEF\xBB\xBF alert('hello');");

Powered by Google App Engine
This is Rietveld 408576698