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

Side by Side Diff: mojo/edk/system/platform_handle_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 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 ASSERT_TRUE(fp); 67 ASSERT_TRUE(fp);
68 68
69 ScopedPlatformHandle h(PlatformHandleFromFILE(std::move(fp))); 69 ScopedPlatformHandle h(PlatformHandleFromFILE(std::move(fp)));
70 EXPECT_FALSE(fp); 70 EXPECT_FALSE(fp);
71 ASSERT_TRUE(h.is_valid()); 71 ASSERT_TRUE(h.is_valid());
72 72
73 auto d = PlatformHandleDispatcher::Create(h.Pass()); 73 auto d = PlatformHandleDispatcher::Create(h.Pass());
74 ASSERT_TRUE(d); 74 ASSERT_TRUE(d);
75 EXPECT_FALSE(h.is_valid()); 75 EXPECT_FALSE(h.is_valid());
76 76
77 EXPECT_FALSE( 77 EXPECT_FALSE(d->SupportsEntrypointClass(EntrypointClass::MESSAGE_PIPE));
78 d->SupportsEntrypointClass(Dispatcher::EntrypointClass::MESSAGE_PIPE)); 78 EXPECT_FALSE(d->SupportsEntrypointClass(EntrypointClass::DATA_PIPE_PRODUCER));
79 EXPECT_FALSE(d->SupportsEntrypointClass( 79 EXPECT_FALSE(d->SupportsEntrypointClass(EntrypointClass::DATA_PIPE_CONSUMER));
80 Dispatcher::EntrypointClass::DATA_PIPE_PRODUCER)); 80 EXPECT_FALSE(d->SupportsEntrypointClass(EntrypointClass::BUFFER));
81 EXPECT_FALSE(d->SupportsEntrypointClass(
82 Dispatcher::EntrypointClass::DATA_PIPE_CONSUMER));
83 EXPECT_FALSE(d->SupportsEntrypointClass(Dispatcher::EntrypointClass::BUFFER));
84 81
85 // TODO(vtl): Check that it actually returns |MOJO_RESULT_INVALID_ARGUMENT| 82 // TODO(vtl): Check that it actually returns |MOJO_RESULT_INVALID_ARGUMENT|
86 // for methods in unsupported entrypoint classes. 83 // for methods in unsupported entrypoint classes.
87 84
88 EXPECT_EQ(MOJO_RESULT_OK, d->Close()); 85 EXPECT_EQ(MOJO_RESULT_OK, d->Close());
89 } 86 }
90 87
91 TEST(PlatformHandleDispatcherTest, CreateEquivalentDispatcherAndClose) { 88 TEST(PlatformHandleDispatcherTest, CreateEquivalentDispatcherAndClose) {
92 test::ScopedTestDir test_dir; 89 test::ScopedTestDir test_dir;
93 90
(...skipping 30 matching lines...) Expand all
124 EXPECT_EQ(sizeof(kFooBar), 121 EXPECT_EQ(sizeof(kFooBar),
125 fread(read_buffer, 1, sizeof(read_buffer), fp.get())); 122 fread(read_buffer, 1, sizeof(read_buffer), fp.get()));
126 EXPECT_STREQ(kFooBar, read_buffer); 123 EXPECT_STREQ(kFooBar, read_buffer);
127 124
128 EXPECT_EQ(MOJO_RESULT_OK, dispatcher->Close()); 125 EXPECT_EQ(MOJO_RESULT_OK, dispatcher->Close());
129 } 126 }
130 127
131 } // namespace 128 } // namespace
132 } // namespace system 129 } // namespace system
133 } // namespace mojo 130 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/system/message_pipe_dispatcher_unittest.cc ('k') | mojo/edk/system/shared_buffer_dispatcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698