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

Side by Side Diff: mojo/edk/system/platform_handle_dispatcher_unittest.cc

Issue 2047823002: Remove no-longer-needed IsBusy...() stuff. (Closed) Base URL: https://github.com/domokit/mojo.git@work791_dp_not_busy-x-work790_dp_cancel_two_phase
Patch Set: Created 4 years, 6 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/handle_transport.h ('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/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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 EXPECT_EQ(sizeof(kFooBar), fwrite(kFooBar, 1, sizeof(kFooBar), fp.get())); 97 EXPECT_EQ(sizeof(kFooBar), fwrite(kFooBar, 1, sizeof(kFooBar), fp.get()));
98 98
99 auto dispatcher = 99 auto dispatcher =
100 PlatformHandleDispatcher::Create(PlatformHandleFromFILE(std::move(fp))); 100 PlatformHandleDispatcher::Create(PlatformHandleFromFILE(std::move(fp)));
101 Handle handle(std::move(dispatcher), 101 Handle handle(std::move(dispatcher),
102 PlatformHandleDispatcher::kDefaultHandleRights); 102 PlatformHandleDispatcher::kDefaultHandleRights);
103 103
104 HandleTransport transport(test::HandleTryStartTransport(handle)); 104 HandleTransport transport(test::HandleTryStartTransport(handle));
105 EXPECT_TRUE(transport.is_valid()); 105 EXPECT_TRUE(transport.is_valid());
106 EXPECT_EQ(Dispatcher::Type::PLATFORM_HANDLE, transport.GetType()); 106 EXPECT_EQ(Dispatcher::Type::PLATFORM_HANDLE, transport.GetType());
107 EXPECT_FALSE(transport.IsBusy());
108 107
109 Handle equivalent_handle = 108 Handle equivalent_handle =
110 transport.CreateEquivalentHandleAndClose(nullptr, 0u); 109 transport.CreateEquivalentHandleAndClose(nullptr, 0u);
111 ASSERT_TRUE(equivalent_handle.dispatcher); 110 ASSERT_TRUE(equivalent_handle.dispatcher);
112 EXPECT_EQ(PlatformHandleDispatcher::kDefaultHandleRights, 111 EXPECT_EQ(PlatformHandleDispatcher::kDefaultHandleRights,
113 equivalent_handle.rights); 112 equivalent_handle.rights);
114 113
115 transport.End(); 114 transport.End();
116 EXPECT_TRUE(handle.dispatcher->HasOneRef()); 115 EXPECT_TRUE(handle.dispatcher->HasOneRef());
117 handle.reset(); 116 handle.reset();
(...skipping 12 matching lines...) Expand all
130 EXPECT_EQ(sizeof(kFooBar), 129 EXPECT_EQ(sizeof(kFooBar),
131 fread(read_buffer, 1, sizeof(read_buffer), fp.get())); 130 fread(read_buffer, 1, sizeof(read_buffer), fp.get()));
132 EXPECT_STREQ(kFooBar, read_buffer); 131 EXPECT_STREQ(kFooBar, read_buffer);
133 132
134 EXPECT_EQ(MOJO_RESULT_OK, dispatcher->Close()); 133 EXPECT_EQ(MOJO_RESULT_OK, dispatcher->Close());
135 } 134 }
136 135
137 } // namespace 136 } // namespace
138 } // namespace system 137 } // namespace system
139 } // namespace mojo 138 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/system/handle_transport.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698