OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |