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

Unified Diff: mojo/system/shared_buffer_dispatcher_unittest.cc

Issue 414393002: Convert verification of options structs to use the new user pointer handling (see r285350). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: temporarily disable part of OptionsValidationTest.InvalidDeath Created 6 years, 5 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 | « mojo/system/shared_buffer_dispatcher.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/system/shared_buffer_dispatcher_unittest.cc
diff --git a/mojo/system/shared_buffer_dispatcher_unittest.cc b/mojo/system/shared_buffer_dispatcher_unittest.cc
index 8534ae56acecdc0553ef7c209e19e34d66a3b0ea..a5198d713b1bb085c5c54ca094cef640ee559d01 100644
--- a/mojo/system/shared_buffer_dispatcher_unittest.cc
+++ b/mojo/system/shared_buffer_dispatcher_unittest.cc
@@ -34,7 +34,7 @@ void RevalidateCreateOptions(
MojoCreateSharedBufferOptions revalidated_options = {};
EXPECT_EQ(MOJO_RESULT_OK,
SharedBufferDispatcher::ValidateCreateOptions(
- &validated_options, &revalidated_options));
+ MakeUserPointer(&validated_options), &revalidated_options));
EXPECT_EQ(validated_options.struct_size, revalidated_options.struct_size);
EXPECT_EQ(validated_options.flags, revalidated_options.flags);
}
@@ -46,7 +46,7 @@ TEST(SharedBufferDispatcherTest, ValidateCreateOptionsValid) {
MojoCreateSharedBufferOptions validated_options = {};
EXPECT_EQ(MOJO_RESULT_OK,
SharedBufferDispatcher::ValidateCreateOptions(
- NULL, &validated_options));
+ NullUserPointer(), &validated_options));
RevalidateCreateOptions(validated_options);
}
@@ -66,7 +66,7 @@ TEST(SharedBufferDispatcherTest, ValidateCreateOptionsValid) {
MojoCreateSharedBufferOptions validated_options = {};
EXPECT_EQ(MOJO_RESULT_OK,
SharedBufferDispatcher::ValidateCreateOptions(
- &options, &validated_options))
+ MakeUserPointer(&options), &validated_options))
<< capacity;
RevalidateCreateOptions(validated_options);
EXPECT_EQ(options.flags, validated_options.flags);
@@ -83,7 +83,8 @@ TEST(SharedBufferDispatcherTest, ValidateCreateOptionsInvalid) {
};
MojoCreateSharedBufferOptions unused;
EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT,
- SharedBufferDispatcher::ValidateCreateOptions(&options, &unused));
+ SharedBufferDispatcher::ValidateCreateOptions(
+ MakeUserPointer(&options), &unused));
}
// Unknown |flags|.
@@ -94,7 +95,8 @@ TEST(SharedBufferDispatcherTest, ValidateCreateOptionsInvalid) {
};
MojoCreateSharedBufferOptions unused;
EXPECT_EQ(MOJO_RESULT_UNIMPLEMENTED,
- SharedBufferDispatcher::ValidateCreateOptions(&options, &unused));
+ SharedBufferDispatcher::ValidateCreateOptions(
+ MakeUserPointer(&options), &unused));
}
}
@@ -153,7 +155,8 @@ TEST(SharedBufferDispatcher, DuplicateBufferHandle) {
// Duplicate |dispatcher1| and then close it.
scoped_refptr<Dispatcher> dispatcher2;
EXPECT_EQ(MOJO_RESULT_OK,
- dispatcher1->DuplicateBufferHandle(NULL, &dispatcher2));
+ dispatcher1->DuplicateBufferHandle(NullUserPointer(),
+ &dispatcher2));
ASSERT_TRUE(dispatcher2);
EXPECT_EQ(Dispatcher::kTypeSharedBuffer, dispatcher2->GetType());
@@ -183,7 +186,8 @@ TEST(SharedBufferDispatcherTest, DuplicateBufferHandleOptionsValid) {
for (size_t i = 0; i < arraysize(options); i++) {
scoped_refptr<Dispatcher> dispatcher2;
EXPECT_EQ(MOJO_RESULT_OK,
- dispatcher1->DuplicateBufferHandle(&options[i], &dispatcher2));
+ dispatcher1->DuplicateBufferHandle(MakeUserPointer(&options[i]),
+ &dispatcher2));
ASSERT_TRUE(dispatcher2);
EXPECT_EQ(Dispatcher::kTypeSharedBuffer, dispatcher2->GetType());
EXPECT_EQ(MOJO_RESULT_OK, dispatcher2->Close());
@@ -206,7 +210,8 @@ TEST(SharedBufferDispatcherTest, DuplicateBufferHandleOptionsInvalid) {
};
scoped_refptr<Dispatcher> dispatcher2;
EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT,
- dispatcher1->DuplicateBufferHandle(&options, &dispatcher2));
+ dispatcher1->DuplicateBufferHandle(MakeUserPointer(&options),
+ &dispatcher2));
EXPECT_FALSE(dispatcher2);
}
@@ -217,7 +222,8 @@ TEST(SharedBufferDispatcherTest, DuplicateBufferHandleOptionsInvalid) {
};
scoped_refptr<Dispatcher> dispatcher2;
EXPECT_EQ(MOJO_RESULT_UNIMPLEMENTED,
- dispatcher1->DuplicateBufferHandle(&options, &dispatcher2));
+ dispatcher1->DuplicateBufferHandle(MakeUserPointer(&options),
+ &dispatcher2));
EXPECT_FALSE(dispatcher2);
}
« no previous file with comments | « mojo/system/shared_buffer_dispatcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698