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

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

Issue 728043002: Revert of Update mojo sdk to rev afb4440fd5a10cba980878c326180b7ad7960480 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/message_pipe_unittest.cc ('k') | mojo/edk/system/options_validation.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/multiprocess_message_pipe_unittest.cc
diff --git a/mojo/edk/system/multiprocess_message_pipe_unittest.cc b/mojo/edk/system/multiprocess_message_pipe_unittest.cc
index ab2e75ce6dec7a9e45351f327d8e91887b34e95b..2f22d6737e7c13b393c0f5d10568f3c863447aff 100644
--- a/mojo/edk/system/multiprocess_message_pipe_unittest.cc
+++ b/mojo/edk/system/multiprocess_message_pipe_unittest.cc
@@ -72,9 +72,12 @@
std::string read_buffer(1000, '\0');
uint32_t read_buffer_size = static_cast<uint32_t>(read_buffer.size());
- CHECK_EQ(mp->ReadMessage(0, UserPointer<void>(&read_buffer[0]),
- MakeUserPointer(&read_buffer_size), nullptr,
- nullptr, MOJO_READ_MESSAGE_FLAG_NONE),
+ CHECK_EQ(mp->ReadMessage(0,
+ UserPointer<void>(&read_buffer[0]),
+ MakeUserPointer(&read_buffer_size),
+ nullptr,
+ nullptr,
+ MOJO_READ_MESSAGE_FLAG_NONE),
MOJO_RESULT_OK);
read_buffer.resize(read_buffer_size);
VLOG(2) << "Child got: " << read_buffer;
@@ -85,9 +88,11 @@
}
std::string write_buffer = read_buffer + read_buffer;
- CHECK_EQ(mp->WriteMessage(0, UserPointer<const void>(write_buffer.data()),
+ CHECK_EQ(mp->WriteMessage(0,
+ UserPointer<const void>(write_buffer.data()),
static_cast<uint32_t>(write_buffer.size()),
- nullptr, MOJO_WRITE_MESSAGE_FLAG_NONE),
+ nullptr,
+ MOJO_WRITE_MESSAGE_FLAG_NONE),
MOJO_RESULT_OK);
}
@@ -105,8 +110,10 @@
std::string hello("hello");
EXPECT_EQ(MOJO_RESULT_OK,
- mp->WriteMessage(0, UserPointer<const void>(hello.data()),
- static_cast<uint32_t>(hello.size()), nullptr,
+ mp->WriteMessage(0,
+ UserPointer<const void>(hello.data()),
+ static_cast<uint32_t>(hello.size()),
+ nullptr,
MOJO_WRITE_MESSAGE_FLAG_NONE));
HandleSignalsState hss;
@@ -120,8 +127,11 @@
std::string read_buffer(1000, '\0');
uint32_t read_buffer_size = static_cast<uint32_t>(read_buffer.size());
- CHECK_EQ(mp->ReadMessage(0, UserPointer<void>(&read_buffer[0]),
- MakeUserPointer(&read_buffer_size), nullptr, nullptr,
+ CHECK_EQ(mp->ReadMessage(0,
+ UserPointer<void>(&read_buffer[0]),
+ MakeUserPointer(&read_buffer_size),
+ nullptr,
+ nullptr,
MOJO_READ_MESSAGE_FLAG_NONE),
MOJO_RESULT_OK);
read_buffer.resize(read_buffer_size);
@@ -147,16 +157,20 @@
for (size_t i = 0; i < kNumMessages; i++) {
std::string write_buffer(i, 'A' + (i % 26));
EXPECT_EQ(MOJO_RESULT_OK,
- mp->WriteMessage(0, UserPointer<const void>(write_buffer.data()),
+ mp->WriteMessage(0,
+ UserPointer<const void>(write_buffer.data()),
static_cast<uint32_t>(write_buffer.size()),
- nullptr, MOJO_WRITE_MESSAGE_FLAG_NONE));
+ nullptr,
+ MOJO_WRITE_MESSAGE_FLAG_NONE));
}
const std::string quitquitquit("quitquitquit");
EXPECT_EQ(MOJO_RESULT_OK,
- mp->WriteMessage(0, UserPointer<const void>(quitquitquit.data()),
+ mp->WriteMessage(0,
+ UserPointer<const void>(quitquitquit.data()),
static_cast<uint32_t>(quitquitquit.size()),
- nullptr, MOJO_WRITE_MESSAGE_FLAG_NONE));
+ nullptr,
+ MOJO_WRITE_MESSAGE_FLAG_NONE));
for (size_t i = 0; i < kNumMessages; i++) {
HandleSignalsState hss;
@@ -170,9 +184,12 @@
std::string read_buffer(kNumMessages * 2, '\0');
uint32_t read_buffer_size = static_cast<uint32_t>(read_buffer.size());
- CHECK_EQ(mp->ReadMessage(0, UserPointer<void>(&read_buffer[0]),
- MakeUserPointer(&read_buffer_size), nullptr,
- nullptr, MOJO_READ_MESSAGE_FLAG_NONE),
+ CHECK_EQ(mp->ReadMessage(0,
+ UserPointer<void>(&read_buffer[0]),
+ MakeUserPointer(&read_buffer_size),
+ nullptr,
+ nullptr,
+ MOJO_READ_MESSAGE_FLAG_NONE),
MOJO_RESULT_OK);
read_buffer.resize(read_buffer_size);
@@ -219,9 +236,12 @@
uint32_t num_bytes = static_cast<uint32_t>(read_buffer.size());
DispatcherVector dispatchers;
uint32_t num_dispatchers = 10; // Maximum number to receive.
- CHECK_EQ(mp->ReadMessage(0, UserPointer<void>(&read_buffer[0]),
- MakeUserPointer(&num_bytes), &dispatchers,
- &num_dispatchers, MOJO_READ_MESSAGE_FLAG_NONE),
+ CHECK_EQ(mp->ReadMessage(0,
+ UserPointer<void>(&read_buffer[0]),
+ MakeUserPointer(&num_bytes),
+ &dispatchers,
+ &num_dispatchers,
+ MOJO_READ_MESSAGE_FLAG_NONE),
MOJO_RESULT_OK);
read_buffer.resize(num_bytes);
CHECK_EQ(read_buffer, std::string("go 1"));
@@ -249,8 +269,10 @@
// And send a message to signal that we've written stuff.
const std::string go2("go 2");
- CHECK_EQ(mp->WriteMessage(0, UserPointer<const void>(&go2[0]),
- static_cast<uint32_t>(go2.size()), nullptr,
+ CHECK_EQ(mp->WriteMessage(0,
+ UserPointer<const void>(&go2[0]),
+ static_cast<uint32_t>(go2.size()),
+ nullptr,
MOJO_WRITE_MESSAGE_FLAG_NONE),
MOJO_RESULT_OK);
@@ -265,8 +287,11 @@
read_buffer = std::string(100, '\0');
num_bytes = static_cast<uint32_t>(read_buffer.size());
- CHECK_EQ(mp->ReadMessage(0, UserPointer<void>(&read_buffer[0]),
- MakeUserPointer(&num_bytes), nullptr, nullptr,
+ CHECK_EQ(mp->ReadMessage(0,
+ UserPointer<void>(&read_buffer[0]),
+ MakeUserPointer(&num_bytes),
+ nullptr,
+ nullptr,
MOJO_READ_MESSAGE_FLAG_NONE),
MOJO_RESULT_OK);
read_buffer.resize(num_bytes);
@@ -297,10 +322,12 @@
// Make a shared buffer.
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());
// Make a mapping.
@@ -320,8 +347,10 @@
std::vector<DispatcherTransport> transports;
transports.push_back(transport);
EXPECT_EQ(MOJO_RESULT_OK,
- mp->WriteMessage(0, UserPointer<const void>(&go1[0]),
- static_cast<uint32_t>(go1.size()), &transports,
+ mp->WriteMessage(0,
+ UserPointer<const void>(&go1[0]),
+ static_cast<uint32_t>(go1.size()),
+ &transports,
MOJO_WRITE_MESSAGE_FLAG_NONE));
transport.End();
@@ -338,8 +367,11 @@
std::string read_buffer(100, '\0');
uint32_t num_bytes = static_cast<uint32_t>(read_buffer.size());
EXPECT_EQ(MOJO_RESULT_OK,
- mp->ReadMessage(0, UserPointer<void>(&read_buffer[0]),
- MakeUserPointer(&num_bytes), nullptr, nullptr,
+ mp->ReadMessage(0,
+ UserPointer<void>(&read_buffer[0]),
+ MakeUserPointer(&num_bytes),
+ nullptr,
+ nullptr,
MOJO_READ_MESSAGE_FLAG_NONE));
read_buffer.resize(num_bytes);
EXPECT_EQ(std::string("go 2"), read_buffer);
@@ -356,8 +388,10 @@
// And send a message to signal that we've written stuff.
const std::string go3("go 3");
EXPECT_EQ(MOJO_RESULT_OK,
- mp->WriteMessage(0, UserPointer<const void>(&go3[0]),
- static_cast<uint32_t>(go3.size()), nullptr,
+ mp->WriteMessage(0,
+ UserPointer<const void>(&go3[0]),
+ static_cast<uint32_t>(go3.size()),
+ nullptr,
MOJO_WRITE_MESSAGE_FLAG_NONE));
// Wait for |mp| to become readable, which should fail.
@@ -394,9 +428,12 @@
uint32_t num_bytes = static_cast<uint32_t>(read_buffer.size());
DispatcherVector dispatchers;
uint32_t num_dispatchers = 10; // Maximum number to receive.
- CHECK_EQ(mp->ReadMessage(0, UserPointer<void>(&read_buffer[0]),
- MakeUserPointer(&num_bytes), &dispatchers,
- &num_dispatchers, MOJO_READ_MESSAGE_FLAG_NONE),
+ CHECK_EQ(mp->ReadMessage(0,
+ UserPointer<void>(&read_buffer[0]),
+ MakeUserPointer(&num_bytes),
+ &dispatchers,
+ &num_dispatchers,
+ MOJO_READ_MESSAGE_FLAG_NONE),
MOJO_RESULT_OK);
mp->Close(0);
@@ -459,8 +496,10 @@
std::vector<DispatcherTransport> transports;
transports.push_back(transport);
EXPECT_EQ(MOJO_RESULT_OK,
- mp->WriteMessage(0, UserPointer<const void>(&hello[0]),
- static_cast<uint32_t>(hello.size()), &transports,
+ mp->WriteMessage(0,
+ UserPointer<const void>(&hello[0]),
+ static_cast<uint32_t>(hello.size()),
+ &transports,
MOJO_WRITE_MESSAGE_FLAG_NONE));
transport.End();
« no previous file with comments | « mojo/edk/system/message_pipe_unittest.cc ('k') | mojo/edk/system/options_validation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698