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

Unified Diff: chrome/browser/notifications/desktop_notifications_unittest.cc

Issue 2743007: Properly escape user input for notifications, since URL-encoded characters ar... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: feedback addressed & test Created 10 years, 6 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/browser/notifications/desktop_notification_service.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/notifications/desktop_notifications_unittest.cc
===================================================================
--- chrome/browser/notifications/desktop_notifications_unittest.cc (revision 49251)
+++ chrome/browser/notifications/desktop_notifications_unittest.cc (working copy)
@@ -281,7 +281,7 @@
GURL("http://www.google.com"),
GURL("/icon.png"),
ASCIIToUTF16("<script>window.alert('uh oh');</script>"),
- ASCIIToUTF16("<i>this text is in italics</i>"),
+ ASCIIToUTF16("<i>this text is in italics</i>, as is %3ci%3ethis%3c/i%3e"),
0, 0, DesktopNotificationService::PageNotification, 1));
MessageLoopForUI::current()->RunAllPending();
@@ -290,4 +290,7 @@
GURL data_url = balloon->notification().content_url();
EXPECT_EQ(std::string::npos, data_url.spec().find("<script>"));
EXPECT_EQ(std::string::npos, data_url.spec().find("<i>"));
+ // URL-encoded versions of tags should also not be found.
+ EXPECT_EQ(std::string::npos, data_url.spec().find("%3cscript%3e"));
+ EXPECT_EQ(std::string::npos, data_url.spec().find("%3ci%3e"));
}
« no previous file with comments | « chrome/browser/notifications/desktop_notification_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698