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

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

Issue 420001: Ignore UTF-8's BOM when parsing userscript's metadata. (Closed)
Patch Set: Relect the review Created 11 years, 1 month 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/browser/extensions/user_script_master.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 25ef7fc38a252517fb27f347a7f4c453413aefa4..6c0193999d85289ef876af4bee5e93fa0bb3c60e 100644
--- a/chrome/browser/extensions/user_script_master_unittest.cc
+++ b/chrome/browser/extensions/user_script_master_unittest.cc
@@ -218,3 +218,18 @@ TEST_F(UserScriptMasterTest, Parse6) {
EXPECT_TRUE(UserScriptMaster::ScriptReloader::ParseMetadataHeader(
text, &script));
}
+
+TEST_F(UserScriptMasterTest, Parse7) {
+ const std::string text(
+ "\xEF\xBB\xBF// ==UserScript==\n"
+ "// @match http://*.mail.google.com/*\n"
+ "// ==/UserScript==\n");
+
+ // Should Ignore UTF-8's BOM.
+ UserScript script;
+ EXPECT_TRUE(UserScriptMaster::ScriptReloader::ParseMetadataHeader(
+ text, &script));
+ ASSERT_EQ(1U, script.url_patterns().size());
+ EXPECT_EQ("http://*.mail.google.com/*",
+ script.url_patterns()[0].GetAsString());
+}
« no previous file with comments | « chrome/browser/extensions/user_script_master.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698