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

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

Issue 2001673003: EDK: Add Core::DuplicateHandleWithReducedRights(). (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 7 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/dispatcher.cc ('k') | mojo/edk/system/mock_simple_dispatcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/dispatcher_unittest.cc
diff --git a/mojo/edk/system/dispatcher_unittest.cc b/mojo/edk/system/dispatcher_unittest.cc
index dcbc999256f0e3787961b843761fd5cc723e435b..033c1601947f8c6929114b79411636c4d8fc37b8 100644
--- a/mojo/edk/system/dispatcher_unittest.cc
+++ b/mojo/edk/system/dispatcher_unittest.cc
@@ -141,6 +141,7 @@ TEST(DispatcherTest, Basic) {
enum class DispatcherOp {
CLOSE = 0,
+ DUPLICATE_DISPATCHER,
WRITE_MESSAGE,
READ_MESSAGE,
SET_DATA_PIPE_PRODUCER_OPTIONS,
@@ -178,6 +179,18 @@ void ThreadSafetyStressHelper(ManualResetWaitableEvent* event,
<< "Result: " << r;
break;
}
+ case DispatcherOp::DUPLICATE_DISPATCHER: {
+ RefPtr<Dispatcher> new_dispatcher;
+ MojoResult r = dispatcher->DuplicateDispatcher(&new_dispatcher);
+ if (r == MOJO_RESULT_OK) {
+ EXPECT_TRUE(new_dispatcher);
+ EXPECT_EQ(MOJO_RESULT_OK, new_dispatcher->Close());
+ } else {
+ EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT, r);
+ EXPECT_FALSE(new_dispatcher);
+ }
+ break;
+ }
case DispatcherOp::WRITE_MESSAGE:
EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT,
dispatcher->WriteMessage(NullUserPointer(), 0, nullptr,
« no previous file with comments | « mojo/edk/system/dispatcher.cc ('k') | mojo/edk/system/mock_simple_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698