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

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

Issue 1947733002: EDK: Rename DispatcherTransport to HandleTransport. (Closed) Base URL: https://github.com/domokit/mojo.git@work790_edk_handle_11-x-work788_edk_handle_10
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/core_test_base.cc ('k') | mojo/edk/system/dispatcher.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 // This file contains tests that are shared between different implementations of 5 // This file contains tests that are shared between different implementations of
6 // |DataPipeImpl|. 6 // |DataPipeImpl|.
7 7
8 #include "mojo/edk/system/data_pipe_impl.h" 8 #include "mojo/edk/system/data_pipe_impl.h"
9 9
10 #include <stdint.h> 10 #include <stdint.h>
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 274
275 // Write the dispatcher to MP |source_i| (port 0). Wait and receive on MP 275 // Write the dispatcher to MP |source_i| (port 0). Wait and receive on MP
276 // |dest_i| (port 0). (Add the waiter first, to avoid any handling the case 276 // |dest_i| (port 0). (Add the waiter first, to avoid any handling the case
277 // where it's already readable.) 277 // where it's already readable.)
278 Waiter waiter; 278 Waiter waiter;
279 waiter.Init(); 279 waiter.Init();
280 ASSERT_EQ(MOJO_RESULT_OK, 280 ASSERT_EQ(MOJO_RESULT_OK,
281 message_pipe(dest_i)->AddAwakable( 281 message_pipe(dest_i)->AddAwakable(
282 0, &waiter, MOJO_HANDLE_SIGNAL_READABLE, 987, nullptr)); 282 0, &waiter, MOJO_HANDLE_SIGNAL_READABLE, 987, nullptr));
283 { 283 {
284 DispatcherTransport transport(test::HandleTryStartTransport(to_send)); 284 HandleTransport transport(test::HandleTryStartTransport(to_send));
285 ASSERT_TRUE(transport.is_valid()); 285 ASSERT_TRUE(transport.is_valid());
286 286
287 std::vector<DispatcherTransport> transports; 287 std::vector<HandleTransport> transports;
288 transports.push_back(transport); 288 transports.push_back(transport);
289 ASSERT_EQ(MOJO_RESULT_OK, message_pipe(source_i)->WriteMessage( 289 ASSERT_EQ(MOJO_RESULT_OK, message_pipe(source_i)->WriteMessage(
290 0, NullUserPointer(), 0, &transports, 290 0, NullUserPointer(), 0, &transports,
291 MOJO_WRITE_MESSAGE_FLAG_NONE)); 291 MOJO_WRITE_MESSAGE_FLAG_NONE));
292 transport.End(); 292 transport.End();
293 } 293 }
294 uint32_t context = 0; 294 uint32_t context = 0;
295 ASSERT_EQ(MOJO_RESULT_OK, waiter.Wait(test::ActionTimeout(), &context)); 295 ASSERT_EQ(MOJO_RESULT_OK, waiter.Wait(test::ActionTimeout(), &context));
296 EXPECT_EQ(987u, context); 296 EXPECT_EQ(987u, context);
297 HandleSignalsState hss = HandleSignalsState(); 297 HandleSignalsState hss = HandleSignalsState();
(...skipping 2643 matching lines...) Expand 10 before | Expand all | Expand 10 after
2941 &waiter, MOJO_HANDLE_SIGNAL_READ_THRESHOLD, 0, &hss)); 2941 &waiter, MOJO_HANDLE_SIGNAL_READ_THRESHOLD, 0, &hss));
2942 EXPECT_EQ(MOJO_HANDLE_SIGNAL_PEER_CLOSED, hss.satisfied_signals); 2942 EXPECT_EQ(MOJO_HANDLE_SIGNAL_PEER_CLOSED, hss.satisfied_signals);
2943 EXPECT_EQ(MOJO_HANDLE_SIGNAL_PEER_CLOSED, hss.satisfiable_signals); 2943 EXPECT_EQ(MOJO_HANDLE_SIGNAL_PEER_CLOSED, hss.satisfiable_signals);
2944 2944
2945 this->ConsumerClose(); 2945 this->ConsumerClose();
2946 } 2946 }
2947 2947
2948 } // namespace 2948 } // namespace
2949 } // namespace system 2949 } // namespace system
2950 } // namespace mojo 2950 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/system/core_test_base.cc ('k') | mojo/edk/system/dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698