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

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

Issue 1941883002: Move the Dispatcher::EntrypointClass enum out of Dispatcher to its own file. (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 unified diff | Download patch
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( 183 EXPECT_TRUE(d->SupportsEntrypointClass(EntrypointClass::MESSAGE_PIPE));
184 d->SupportsEntrypointClass(Dispatcher::EntrypointClass::MESSAGE_PIPE)); 184 EXPECT_FALSE(d->SupportsEntrypointClass(EntrypointClass::DATA_PIPE_PRODUCER));
185 EXPECT_FALSE(d->SupportsEntrypointClass( 185 EXPECT_FALSE(d->SupportsEntrypointClass(EntrypointClass::DATA_PIPE_CONSUMER));
186 Dispatcher::EntrypointClass::DATA_PIPE_PRODUCER)); 186 EXPECT_FALSE(d->SupportsEntrypointClass(EntrypointClass::BUFFER));
187 EXPECT_FALSE(d->SupportsEntrypointClass(
188 Dispatcher::EntrypointClass::DATA_PIPE_CONSUMER));
189 EXPECT_FALSE(d->SupportsEntrypointClass(Dispatcher::EntrypointClass::BUFFER));
190 187
191 // TODO(vtl): Check that it actually returns |MOJO_RESULT_INVALID_ARGUMENT| 188 // TODO(vtl): Check that it actually returns |MOJO_RESULT_INVALID_ARGUMENT|
192 // for methods in unsupported entrypoint classes. 189 // for methods in unsupported entrypoint classes.
193 190
194 EXPECT_EQ(MOJO_RESULT_OK, d->Close()); 191 EXPECT_EQ(MOJO_RESULT_OK, d->Close());
195 } 192 }
196 193
197 TEST(MessagePipeDispatcherTest, InvalidParams) { 194 TEST(MessagePipeDispatcherTest, InvalidParams) {
198 char buffer[1]; 195 char buffer[1];
199 196
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after
724 EXPECT_EQ(total_messages_written, total_messages_read); 721 EXPECT_EQ(total_messages_written, total_messages_read);
725 EXPECT_EQ(total_bytes_written, total_bytes_read); 722 EXPECT_EQ(total_bytes_written, total_bytes_read);
726 723
727 EXPECT_EQ(MOJO_RESULT_OK, d_write->Close()); 724 EXPECT_EQ(MOJO_RESULT_OK, d_write->Close());
728 EXPECT_EQ(MOJO_RESULT_OK, d_read->Close()); 725 EXPECT_EQ(MOJO_RESULT_OK, d_read->Close());
729 } 726 }
730 727
731 } // namespace 728 } // namespace
732 } // namespace system 729 } // namespace system
733 } // namespace mojo 730 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/system/entrypoint_class.h ('k') | mojo/edk/system/platform_handle_dispatcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698