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

Unified Diff: ipc/ipc_message_utils_unittest.cc

Issue 11642041: Don't allow '\0' characters in FilePath. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use WriteToPickle and ReadFromPickle in ParamTraits 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 | « ipc/ipc_message_utils.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_message_utils_unittest.cc
diff --git a/ipc/ipc_message_utils_unittest.cc b/ipc/ipc_message_utils_unittest.cc
index 2a49b9a56980d90145cb48fdb9dcef96bb988884..7aa97109a7995aafb5a520dc7f624d5604d9af20 100644
--- a/ipc/ipc_message_utils_unittest.cc
+++ b/ipc/ipc_message_utils_unittest.cc
@@ -55,15 +55,17 @@ TEST(IPCMessageUtilsTest, NestedMessages) {
// Tests that detection of various bad parameters is working correctly.
TEST(IPCMessageUtilsTest, ParameterValidation) {
- IPC::Message message;
FilePath::StringType okString(FILE_PATH_LITERAL("hello"), 5);
FilePath::StringType badString(FILE_PATH_LITERAL("hel\0o"), 5);
- FilePath okPath(okString);
- FilePath badPath(badString);
- ParamTraits<FilePath>::Write(&message, okPath);
- ParamTraits<FilePath>::Write(&message, badPath);
+
+ // Change this if ParamTraits<FilePath>::Write() changes.
+ IPC::Message message;
+ ParamTraits<FilePath::StringType>::Write(&message, okString);
+ ParamTraits<FilePath::StringType>::Write(&message, badString);
PickleIterator iter(message);
+ FilePath okPath;
brettw 2013/01/25 22:06:03 Style nit: no camelCase, use lowercase_with_unders
+ FilePath badPath;
ASSERT_TRUE(ParamTraits<FilePath>::Read(&message, &iter, &okPath));
ASSERT_FALSE(ParamTraits<FilePath>::Read(&message, &iter, &badPath));
}
« no previous file with comments | « ipc/ipc_message_utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698