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

Unified Diff: mojo/edk/system/shared_buffer_dispatcher_unittest.cc

Issue 728133002: Update mojo sdk to rev e01f9a49449381a5eb430c1fd88bf2cae73ec35a (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: android + ios gyp fixes Created 6 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 | « mojo/edk/system/shared_buffer_dispatcher.cc ('k') | mojo/edk/system/simple_dispatcher_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/shared_buffer_dispatcher_unittest.cc
diff --git a/mojo/edk/system/shared_buffer_dispatcher_unittest.cc b/mojo/edk/system/shared_buffer_dispatcher_unittest.cc
index a80f71d05da5d89aeeb9fc233d6c30f309bcae87..5866089295677e7ca267664071ac5849954af61e 100644
--- a/mojo/edk/system/shared_buffer_dispatcher_unittest.cc
+++ b/mojo/edk/system/shared_buffer_dispatcher_unittest.cc
@@ -58,9 +58,8 @@ TEST_F(SharedBufferDispatcherTest, ValidateCreateOptionsValid) {
// Default options.
{
MojoCreateSharedBufferOptions validated_options = {};
- EXPECT_EQ(MOJO_RESULT_OK,
- SharedBufferDispatcher::ValidateCreateOptions(
- NullUserPointer(), &validated_options));
+ EXPECT_EQ(MOJO_RESULT_OK, SharedBufferDispatcher::ValidateCreateOptions(
+ NullUserPointer(), &validated_options));
RevalidateCreateOptions(validated_options);
}
@@ -115,20 +114,17 @@ TEST_F(SharedBufferDispatcherTest, ValidateCreateOptionsInvalid) {
TEST_F(SharedBufferDispatcherTest, CreateAndMapBuffer) {
scoped_refptr<SharedBufferDispatcher> dispatcher;
- EXPECT_EQ(MOJO_RESULT_OK,
- SharedBufferDispatcher::Create(
- platform_support(),
- SharedBufferDispatcher::kDefaultCreateOptions,
- 100,
- &dispatcher));
+ EXPECT_EQ(MOJO_RESULT_OK, SharedBufferDispatcher::Create(
+ platform_support(),
+ SharedBufferDispatcher::kDefaultCreateOptions,
+ 100, &dispatcher));
ASSERT_TRUE(dispatcher.get());
EXPECT_EQ(Dispatcher::kTypeSharedBuffer, dispatcher->GetType());
// Make a couple of mappings.
scoped_ptr<embedder::PlatformSharedBufferMapping> mapping1;
- EXPECT_EQ(
- MOJO_RESULT_OK,
- dispatcher->MapBuffer(0, 100, MOJO_MAP_BUFFER_FLAG_NONE, &mapping1));
+ EXPECT_EQ(MOJO_RESULT_OK, dispatcher->MapBuffer(
+ 0, 100, MOJO_MAP_BUFFER_FLAG_NONE, &mapping1));
ASSERT_TRUE(mapping1);
ASSERT_TRUE(mapping1->GetBase());
EXPECT_EQ(100u, mapping1->GetLength());
@@ -136,9 +132,8 @@ TEST_F(SharedBufferDispatcherTest, CreateAndMapBuffer) {
static_cast<char*>(mapping1->GetBase())[50] = 'x';
scoped_ptr<embedder::PlatformSharedBufferMapping> mapping2;
- EXPECT_EQ(
- MOJO_RESULT_OK,
- dispatcher->MapBuffer(50, 50, MOJO_MAP_BUFFER_FLAG_NONE, &mapping2));
+ EXPECT_EQ(MOJO_RESULT_OK, dispatcher->MapBuffer(
+ 50, 50, MOJO_MAP_BUFFER_FLAG_NONE, &mapping2));
ASSERT_TRUE(mapping2);
ASSERT_TRUE(mapping2->GetBase());
EXPECT_EQ(50u, mapping2->GetLength());
@@ -154,35 +149,30 @@ TEST_F(SharedBufferDispatcherTest, CreateAndMapBuffer) {
TEST_F(SharedBufferDispatcherTest, DuplicateBufferHandle) {
scoped_refptr<SharedBufferDispatcher> dispatcher1;
- EXPECT_EQ(MOJO_RESULT_OK,
- SharedBufferDispatcher::Create(
- platform_support(),
- SharedBufferDispatcher::kDefaultCreateOptions,
- 100,
- &dispatcher1));
+ EXPECT_EQ(MOJO_RESULT_OK, SharedBufferDispatcher::Create(
+ platform_support(),
+ SharedBufferDispatcher::kDefaultCreateOptions,
+ 100, &dispatcher1));
// Map and write something.
scoped_ptr<embedder::PlatformSharedBufferMapping> mapping;
- EXPECT_EQ(
- MOJO_RESULT_OK,
- dispatcher1->MapBuffer(0, 100, MOJO_MAP_BUFFER_FLAG_NONE, &mapping));
+ EXPECT_EQ(MOJO_RESULT_OK, dispatcher1->MapBuffer(
+ 0, 100, MOJO_MAP_BUFFER_FLAG_NONE, &mapping));
static_cast<char*>(mapping->GetBase())[0] = 'x';
mapping.reset();
// Duplicate |dispatcher1| and then close it.
scoped_refptr<Dispatcher> dispatcher2;
- EXPECT_EQ(
- MOJO_RESULT_OK,
- dispatcher1->DuplicateBufferHandle(NullUserPointer(), &dispatcher2));
+ EXPECT_EQ(MOJO_RESULT_OK, dispatcher1->DuplicateBufferHandle(
+ NullUserPointer(), &dispatcher2));
ASSERT_TRUE(dispatcher2.get());
EXPECT_EQ(Dispatcher::kTypeSharedBuffer, dispatcher2->GetType());
EXPECT_EQ(MOJO_RESULT_OK, dispatcher1->Close());
// Map |dispatcher2| and read something.
- EXPECT_EQ(
- MOJO_RESULT_OK,
- dispatcher2->MapBuffer(0, 100, MOJO_MAP_BUFFER_FLAG_NONE, &mapping));
+ EXPECT_EQ(MOJO_RESULT_OK, dispatcher2->MapBuffer(
+ 0, 100, MOJO_MAP_BUFFER_FLAG_NONE, &mapping));
EXPECT_EQ('x', static_cast<char*>(mapping->GetBase())[0]);
EXPECT_EQ(MOJO_RESULT_OK, dispatcher2->Close());
@@ -190,12 +180,10 @@ TEST_F(SharedBufferDispatcherTest, DuplicateBufferHandle) {
TEST_F(SharedBufferDispatcherTest, DuplicateBufferHandleOptionsValid) {
scoped_refptr<SharedBufferDispatcher> dispatcher1;
- EXPECT_EQ(MOJO_RESULT_OK,
- SharedBufferDispatcher::Create(
- platform_support(),
- SharedBufferDispatcher::kDefaultCreateOptions,
- 100,
- &dispatcher1));
+ EXPECT_EQ(MOJO_RESULT_OK, SharedBufferDispatcher::Create(
+ platform_support(),
+ SharedBufferDispatcher::kDefaultCreateOptions,
+ 100, &dispatcher1));
MojoDuplicateBufferHandleOptions options[] = {
{sizeof(MojoDuplicateBufferHandleOptions),
@@ -203,9 +191,8 @@ TEST_F(SharedBufferDispatcherTest, DuplicateBufferHandleOptionsValid) {
{sizeof(MojoDuplicateBufferHandleOptionsFlags), ~0u}};
for (size_t i = 0; i < arraysize(options); i++) {
scoped_refptr<Dispatcher> dispatcher2;
- EXPECT_EQ(MOJO_RESULT_OK,
- dispatcher1->DuplicateBufferHandle(MakeUserPointer(&options[i]),
- &dispatcher2));
+ EXPECT_EQ(MOJO_RESULT_OK, dispatcher1->DuplicateBufferHandle(
+ MakeUserPointer(&options[i]), &dispatcher2));
ASSERT_TRUE(dispatcher2.get());
EXPECT_EQ(Dispatcher::kTypeSharedBuffer, dispatcher2->GetType());
EXPECT_EQ(MOJO_RESULT_OK, dispatcher2->Close());
@@ -216,12 +203,10 @@ TEST_F(SharedBufferDispatcherTest, DuplicateBufferHandleOptionsValid) {
TEST_F(SharedBufferDispatcherTest, DuplicateBufferHandleOptionsInvalid) {
scoped_refptr<SharedBufferDispatcher> dispatcher1;
- EXPECT_EQ(MOJO_RESULT_OK,
- SharedBufferDispatcher::Create(
- platform_support(),
- SharedBufferDispatcher::kDefaultCreateOptions,
- 100,
- &dispatcher1));
+ EXPECT_EQ(MOJO_RESULT_OK, SharedBufferDispatcher::Create(
+ platform_support(),
+ SharedBufferDispatcher::kDefaultCreateOptions,
+ 100, &dispatcher1));
// Invalid |struct_size|.
{
@@ -251,32 +236,27 @@ TEST_F(SharedBufferDispatcherTest, DuplicateBufferHandleOptionsInvalid) {
TEST_F(SharedBufferDispatcherTest, CreateInvalidNumBytes) {
// Size too big.
scoped_refptr<SharedBufferDispatcher> dispatcher;
- EXPECT_EQ(MOJO_RESULT_RESOURCE_EXHAUSTED,
- SharedBufferDispatcher::Create(
- platform_support(),
- SharedBufferDispatcher::kDefaultCreateOptions,
- std::numeric_limits<uint64_t>::max(),
- &dispatcher));
+ EXPECT_EQ(
+ MOJO_RESULT_RESOURCE_EXHAUSTED,
+ SharedBufferDispatcher::Create(
+ platform_support(), SharedBufferDispatcher::kDefaultCreateOptions,
+ std::numeric_limits<uint64_t>::max(), &dispatcher));
EXPECT_FALSE(dispatcher.get());
// Zero size.
EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT,
SharedBufferDispatcher::Create(
platform_support(),
- SharedBufferDispatcher::kDefaultCreateOptions,
- 0,
- &dispatcher));
+ SharedBufferDispatcher::kDefaultCreateOptions, 0, &dispatcher));
EXPECT_FALSE(dispatcher.get());
}
TEST_F(SharedBufferDispatcherTest, MapBufferInvalidArguments) {
scoped_refptr<SharedBufferDispatcher> dispatcher;
- EXPECT_EQ(MOJO_RESULT_OK,
- SharedBufferDispatcher::Create(
- platform_support(),
- SharedBufferDispatcher::kDefaultCreateOptions,
- 100,
- &dispatcher));
+ EXPECT_EQ(MOJO_RESULT_OK, SharedBufferDispatcher::Create(
+ platform_support(),
+ SharedBufferDispatcher::kDefaultCreateOptions,
+ 100, &dispatcher));
scoped_ptr<embedder::PlatformSharedBufferMapping> mapping;
EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT,
« no previous file with comments | « mojo/edk/system/shared_buffer_dispatcher.cc ('k') | mojo/edk/system/simple_dispatcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698