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

Side by Side Diff: mojo/edk/system/shared_buffer_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
« no previous file with comments | « mojo/edk/system/platform_handle_dispatcher_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "mojo/edk/system/shared_buffer_dispatcher.h" 5 #include "mojo/edk/system/shared_buffer_dispatcher.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <memory> 8 #include <memory>
9 9
10 #include "mojo/edk/embedder/simple_platform_support.h" 10 #include "mojo/edk/embedder/simple_platform_support.h"
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 } 184 }
185 185
186 TEST_F(SharedBufferDispatcherTest, SupportsEntrypointClass) { 186 TEST_F(SharedBufferDispatcherTest, SupportsEntrypointClass) {
187 MojoResult result = MOJO_RESULT_INTERNAL; 187 MojoResult result = MOJO_RESULT_INTERNAL;
188 auto d = SharedBufferDispatcher::Create( 188 auto d = SharedBufferDispatcher::Create(
189 platform_support(), SharedBufferDispatcher::kDefaultCreateOptions, 100u, 189 platform_support(), SharedBufferDispatcher::kDefaultCreateOptions, 100u,
190 &result); 190 &result);
191 ASSERT_TRUE(d); 191 ASSERT_TRUE(d);
192 EXPECT_EQ(MOJO_RESULT_OK, result); 192 EXPECT_EQ(MOJO_RESULT_OK, result);
193 193
194 EXPECT_FALSE( 194 EXPECT_FALSE(d->SupportsEntrypointClass(EntrypointClass::MESSAGE_PIPE));
195 d->SupportsEntrypointClass(Dispatcher::EntrypointClass::MESSAGE_PIPE)); 195 EXPECT_FALSE(d->SupportsEntrypointClass(EntrypointClass::DATA_PIPE_PRODUCER));
196 EXPECT_FALSE(d->SupportsEntrypointClass( 196 EXPECT_FALSE(d->SupportsEntrypointClass(EntrypointClass::DATA_PIPE_CONSUMER));
197 Dispatcher::EntrypointClass::DATA_PIPE_PRODUCER)); 197 EXPECT_TRUE(d->SupportsEntrypointClass(EntrypointClass::BUFFER));
198 EXPECT_FALSE(d->SupportsEntrypointClass(
199 Dispatcher::EntrypointClass::DATA_PIPE_CONSUMER));
200 EXPECT_TRUE(d->SupportsEntrypointClass(Dispatcher::EntrypointClass::BUFFER));
201 198
202 // TODO(vtl): Check that it actually returns |MOJO_RESULT_INVALID_ARGUMENT| 199 // TODO(vtl): Check that it actually returns |MOJO_RESULT_INVALID_ARGUMENT|
203 // for methods in unsupported entrypoint classes. 200 // for methods in unsupported entrypoint classes.
204 201
205 EXPECT_EQ(MOJO_RESULT_OK, d->Close()); 202 EXPECT_EQ(MOJO_RESULT_OK, d->Close());
206 } 203 }
207 204
208 TEST_F(SharedBufferDispatcherTest, DuplicateBufferHandle) { 205 TEST_F(SharedBufferDispatcherTest, DuplicateBufferHandle) {
209 const uint64_t kSize = 100u; 206 const uint64_t kSize = 100u;
210 207
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT, 338 EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT,
342 dispatcher->MapBuffer(0, 0, MOJO_MAP_BUFFER_FLAG_NONE, &mapping)); 339 dispatcher->MapBuffer(0, 0, MOJO_MAP_BUFFER_FLAG_NONE, &mapping));
343 EXPECT_FALSE(mapping); 340 EXPECT_FALSE(mapping);
344 341
345 EXPECT_EQ(MOJO_RESULT_OK, dispatcher->Close()); 342 EXPECT_EQ(MOJO_RESULT_OK, dispatcher->Close());
346 } 343 }
347 344
348 } // namespace 345 } // namespace
349 } // namespace system 346 } // namespace system
350 } // namespace mojo 347 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/system/platform_handle_dispatcher_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698