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

Unified Diff: content/common/common_param_traits_unittest.cc

Issue 11826002: Reject invalid GURLs across IPC. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 11 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/common_param_traits_unittest.cc ('k') | content/content_tests.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/common_param_traits_unittest.cc
===================================================================
--- content/common/common_param_traits_unittest.cc (revision 175576)
+++ content/common/common_param_traits_unittest.cc (working copy)
@@ -23,7 +23,6 @@
const char* serialize_cases[] = {
"http://www.google.com/",
"http://user:pass@host.com:888/foo;bar?baz#nop",
- "#inva://idurl/",
};
for (size_t i = 0; i < arraysize(serialize_cases); i++) {
@@ -49,6 +48,15 @@
EXPECT_EQ(input.ref(), output.ref());
}
+ // Test an invalid GURL.
+ {
+ IPC::Message msg;
+ msg.WriteString("#inva://idurl/");
+ GURL output;
+ PickleIterator iter(msg);
+ EXPECT_FALSE(IPC::ParamTraits<GURL>::Read(&msg, &iter, &output));
+ }
+
// Also test the corrupt case.
IPC::Message msg(1, 2, IPC::Message::PRIORITY_NORMAL);
msg.WriteInt(99);
« no previous file with comments | « chrome/common/common_param_traits_unittest.cc ('k') | content/content_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698