| 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/platform_handle_dispatcher.h" | 5 #include "mojo/edk/system/platform_handle_dispatcher.h" |
| 6 | 6 |
| 7 #include <stdio.h> | 7 #include <stdio.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 ASSERT_TRUE(fp); | 69 ASSERT_TRUE(fp); |
| 70 | 70 |
| 71 ScopedPlatformHandle h(PlatformHandleFromFILE(std::move(fp))); | 71 ScopedPlatformHandle h(PlatformHandleFromFILE(std::move(fp))); |
| 72 EXPECT_FALSE(fp); | 72 EXPECT_FALSE(fp); |
| 73 ASSERT_TRUE(h.is_valid()); | 73 ASSERT_TRUE(h.is_valid()); |
| 74 | 74 |
| 75 auto d = PlatformHandleDispatcher::Create(h.Pass()); | 75 auto d = PlatformHandleDispatcher::Create(h.Pass()); |
| 76 ASSERT_TRUE(d); | 76 ASSERT_TRUE(d); |
| 77 EXPECT_FALSE(h.is_valid()); | 77 EXPECT_FALSE(h.is_valid()); |
| 78 | 78 |
| 79 EXPECT_TRUE(d->SupportsEntrypointClass(EntrypointClass::NONE)); |
| 79 EXPECT_FALSE(d->SupportsEntrypointClass(EntrypointClass::MESSAGE_PIPE)); | 80 EXPECT_FALSE(d->SupportsEntrypointClass(EntrypointClass::MESSAGE_PIPE)); |
| 80 EXPECT_FALSE(d->SupportsEntrypointClass(EntrypointClass::DATA_PIPE_PRODUCER)); | 81 EXPECT_FALSE(d->SupportsEntrypointClass(EntrypointClass::DATA_PIPE_PRODUCER)); |
| 81 EXPECT_FALSE(d->SupportsEntrypointClass(EntrypointClass::DATA_PIPE_CONSUMER)); | 82 EXPECT_FALSE(d->SupportsEntrypointClass(EntrypointClass::DATA_PIPE_CONSUMER)); |
| 82 EXPECT_FALSE(d->SupportsEntrypointClass(EntrypointClass::BUFFER)); | 83 EXPECT_FALSE(d->SupportsEntrypointClass(EntrypointClass::BUFFER)); |
| 83 | 84 |
| 84 // TODO(vtl): Check that it actually returns |MOJO_RESULT_INVALID_ARGUMENT| | 85 // TODO(vtl): Check that it actually returns |MOJO_RESULT_INVALID_ARGUMENT| |
| 85 // for methods in unsupported entrypoint classes. | 86 // for methods in unsupported entrypoint classes. |
| 86 | 87 |
| 87 EXPECT_EQ(MOJO_RESULT_OK, d->Close()); | 88 EXPECT_EQ(MOJO_RESULT_OK, d->Close()); |
| 88 } | 89 } |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 EXPECT_EQ(sizeof(kFooBar), | 130 EXPECT_EQ(sizeof(kFooBar), |
| 130 fread(read_buffer, 1, sizeof(read_buffer), fp.get())); | 131 fread(read_buffer, 1, sizeof(read_buffer), fp.get())); |
| 131 EXPECT_STREQ(kFooBar, read_buffer); | 132 EXPECT_STREQ(kFooBar, read_buffer); |
| 132 | 133 |
| 133 EXPECT_EQ(MOJO_RESULT_OK, dispatcher->Close()); | 134 EXPECT_EQ(MOJO_RESULT_OK, dispatcher->Close()); |
| 134 } | 135 } |
| 135 | 136 |
| 136 } // namespace | 137 } // namespace |
| 137 } // namespace system | 138 } // namespace system |
| 138 } // namespace mojo | 139 } // namespace mojo |
| OLD | NEW |