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

Unified Diff: mojo/public/c/system/tests/core_unittest.cc

Issue 1865663002: Let MojoSetDataPipeConsumerOptions() take null options. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 8 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/edk/system/data_pipe_consumer_dispatcher.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/c/system/tests/core_unittest.cc
diff --git a/mojo/public/c/system/tests/core_unittest.cc b/mojo/public/c/system/tests/core_unittest.cc
index f7186337eba4362d55abea03a6547342c537e779..0ad52ad8cfcca67413c11d97925d2e3381559df3 100644
--- a/mojo/public/c/system/tests/core_unittest.cc
+++ b/mojo/public/c/system/tests/core_unittest.cc
@@ -411,6 +411,19 @@ TEST(CoreTest, DataPipeReadThreshold) {
EXPECT_EQ(MOJO_RESULT_OK,
MojoWait(hc, MOJO_HANDLE_SIGNAL_READ_THRESHOLD, 0, nullptr));
+ // Set the read threshold to the default by passing null, and check it.
+ EXPECT_EQ(MOJO_RESULT_OK, MojoSetDataPipeConsumerOptions(hc, nullptr));
+
+ memset(&copts, 255, kCoptsSize);
+ EXPECT_EQ(MOJO_RESULT_OK,
+ MojoGetDataPipeConsumerOptions(hc, &copts, kCoptsSize));
+ EXPECT_EQ(kCoptsSize, copts.struct_size);
+ EXPECT_EQ(0u, copts.read_threshold_num_bytes);
+
+ // Should still have the read threshold signal.
+ EXPECT_EQ(MOJO_RESULT_OK,
+ MojoWait(hc, MOJO_HANDLE_SIGNAL_READ_THRESHOLD, 0, nullptr));
+
EXPECT_EQ(MOJO_RESULT_OK, MojoClose(hp));
EXPECT_EQ(MOJO_RESULT_OK, MojoClose(hc));
}
« no previous file with comments | « mojo/edk/system/data_pipe_consumer_dispatcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698