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

Side by Side Diff: mojo/edk/system/shared_buffer_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/shared_buffer_dispatcher.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_TRUE(d->SupportsEntrypointClass(EntrypointClass::NONE));
194 EXPECT_FALSE(d->SupportsEntrypointClass(EntrypointClass::MESSAGE_PIPE)); 195 EXPECT_FALSE(d->SupportsEntrypointClass(EntrypointClass::MESSAGE_PIPE));
195 EXPECT_FALSE(d->SupportsEntrypointClass(EntrypointClass::DATA_PIPE_PRODUCER)); 196 EXPECT_FALSE(d->SupportsEntrypointClass(EntrypointClass::DATA_PIPE_PRODUCER));
196 EXPECT_FALSE(d->SupportsEntrypointClass(EntrypointClass::DATA_PIPE_CONSUMER)); 197 EXPECT_FALSE(d->SupportsEntrypointClass(EntrypointClass::DATA_PIPE_CONSUMER));
197 EXPECT_TRUE(d->SupportsEntrypointClass(EntrypointClass::BUFFER)); 198 EXPECT_TRUE(d->SupportsEntrypointClass(EntrypointClass::BUFFER));
198 199
199 // TODO(vtl): Check that it actually returns |MOJO_RESULT_INVALID_ARGUMENT| 200 // TODO(vtl): Check that it actually returns |MOJO_RESULT_INVALID_ARGUMENT|
200 // for methods in unsupported entrypoint classes. 201 // for methods in unsupported entrypoint classes.
201 202
202 EXPECT_EQ(MOJO_RESULT_OK, d->Close()); 203 EXPECT_EQ(MOJO_RESULT_OK, d->Close());
203 } 204 }
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT, 339 EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT,
339 dispatcher->MapBuffer(0, 0, MOJO_MAP_BUFFER_FLAG_NONE, &mapping)); 340 dispatcher->MapBuffer(0, 0, MOJO_MAP_BUFFER_FLAG_NONE, &mapping));
340 EXPECT_FALSE(mapping); 341 EXPECT_FALSE(mapping);
341 342
342 EXPECT_EQ(MOJO_RESULT_OK, dispatcher->Close()); 343 EXPECT_EQ(MOJO_RESULT_OK, dispatcher->Close());
343 } 344 }
344 345
345 } // namespace 346 } // namespace
346 } // namespace system 347 } // namespace system
347 } // namespace mojo 348 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/system/shared_buffer_dispatcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698