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

Side by Side Diff: mojo/edk/system/message_pipe_dispatcher_unittest.cc

Issue 1953293003: EDK: Add handle rights checking to the various entrypoints. (Closed) Base URL: https://github.com/domokit/mojo.git@work788_edk_handle_13.9-x-work787_edk_handle_13.8
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 unified diff | Download patch
« no previous file with comments | « mojo/edk/system/message_pipe_dispatcher.cc ('k') | mojo/edk/system/mock_simple_dispatcher.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // NOTE(vtl): Some of these tests are inherently flaky (e.g., if run on a 5 // NOTE(vtl): Some of these tests are inherently flaky (e.g., if run on a
6 // heavily-loaded system). Sorry. |test::EpsilonTimeout()| may be increased to 6 // heavily-loaded system). Sorry. |test::EpsilonTimeout()| may be increased to
7 // increase tolerance and reduce observed flakiness (though doing so reduces the 7 // increase tolerance and reduce observed flakiness (though doing so reduces the
8 // meaningfulness of the test). 8 // meaningfulness of the test).
9 9
10 #include "mojo/edk/system/message_pipe_dispatcher.h" 10 #include "mojo/edk/system/message_pipe_dispatcher.h"
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 // We need to initialize |d|. 173 // We need to initialize |d|.
174 { 174 {
175 auto d_peer = MessagePipeDispatcher::Create( 175 auto d_peer = MessagePipeDispatcher::Create(
176 MessagePipeDispatcher::kDefaultCreateOptions); 176 MessagePipeDispatcher::kDefaultCreateOptions);
177 auto mp = MessagePipe::CreateLocalLocal(); 177 auto mp = MessagePipe::CreateLocalLocal();
178 d->Init(mp.Clone(), 0); 178 d->Init(mp.Clone(), 0);
179 d_peer->Init(std::move(mp), 1); 179 d_peer->Init(std::move(mp), 1);
180 EXPECT_EQ(MOJO_RESULT_OK, d_peer->Close()); 180 EXPECT_EQ(MOJO_RESULT_OK, d_peer->Close());
181 } 181 }
182 182
183 EXPECT_TRUE(d->SupportsEntrypointClass(EntrypointClass::NONE));
183 EXPECT_TRUE(d->SupportsEntrypointClass(EntrypointClass::MESSAGE_PIPE)); 184 EXPECT_TRUE(d->SupportsEntrypointClass(EntrypointClass::MESSAGE_PIPE));
184 EXPECT_FALSE(d->SupportsEntrypointClass(EntrypointClass::DATA_PIPE_PRODUCER)); 185 EXPECT_FALSE(d->SupportsEntrypointClass(EntrypointClass::DATA_PIPE_PRODUCER));
185 EXPECT_FALSE(d->SupportsEntrypointClass(EntrypointClass::DATA_PIPE_CONSUMER)); 186 EXPECT_FALSE(d->SupportsEntrypointClass(EntrypointClass::DATA_PIPE_CONSUMER));
186 EXPECT_FALSE(d->SupportsEntrypointClass(EntrypointClass::BUFFER)); 187 EXPECT_FALSE(d->SupportsEntrypointClass(EntrypointClass::BUFFER));
187 188
188 // TODO(vtl): Check that it actually returns |MOJO_RESULT_INVALID_ARGUMENT| 189 // TODO(vtl): Check that it actually returns |MOJO_RESULT_INVALID_ARGUMENT|
189 // for methods in unsupported entrypoint classes. 190 // for methods in unsupported entrypoint classes.
190 191
191 EXPECT_EQ(MOJO_RESULT_OK, d->Close()); 192 EXPECT_EQ(MOJO_RESULT_OK, d->Close());
192 } 193 }
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after
721 EXPECT_EQ(total_messages_written, total_messages_read); 722 EXPECT_EQ(total_messages_written, total_messages_read);
722 EXPECT_EQ(total_bytes_written, total_bytes_read); 723 EXPECT_EQ(total_bytes_written, total_bytes_read);
723 724
724 EXPECT_EQ(MOJO_RESULT_OK, d_write->Close()); 725 EXPECT_EQ(MOJO_RESULT_OK, d_write->Close());
725 EXPECT_EQ(MOJO_RESULT_OK, d_read->Close()); 726 EXPECT_EQ(MOJO_RESULT_OK, d_read->Close());
726 } 727 }
727 728
728 } // namespace 729 } // namespace
729 } // namespace system 730 } // namespace system
730 } // namespace mojo 731 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/system/message_pipe_dispatcher.cc ('k') | mojo/edk/system/mock_simple_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698