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

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

Issue 1956703005: EDK: Check that handle rights are preserved in various tests. (Closed) Base URL: https://github.com/domokit/mojo.git@work787_edk_handle_13.8
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 | « no previous file | mojo/edk/system/multiprocess_message_pipe_unittest.cc » ('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 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 ASSERT_EQ(MOJO_RESULT_OK, 309 ASSERT_EQ(MOJO_RESULT_OK,
310 message_pipe(dest_i)->ReadMessage( 310 message_pipe(dest_i)->ReadMessage(
311 0, UserPointer<void>(read_buffer), 311 0, UserPointer<void>(read_buffer),
312 MakeUserPointer(&read_buffer_size), &read_handles, 312 MakeUserPointer(&read_buffer_size), &read_handles,
313 &read_num_handles, MOJO_READ_MESSAGE_FLAG_NONE)); 313 &read_num_handles, MOJO_READ_MESSAGE_FLAG_NONE));
314 EXPECT_EQ(0u, static_cast<size_t>(read_buffer_size)); 314 EXPECT_EQ(0u, static_cast<size_t>(read_buffer_size));
315 ASSERT_EQ(1u, read_handles.size()); 315 ASSERT_EQ(1u, read_handles.size());
316 ASSERT_EQ(1u, read_num_handles); 316 ASSERT_EQ(1u, read_num_handles);
317 ASSERT_TRUE(read_handles[0]); 317 ASSERT_TRUE(read_handles[0]);
318 EXPECT_TRUE(read_handles[0].dispatcher->HasOneRef()); 318 EXPECT_TRUE(read_handles[0].dispatcher->HasOneRef());
319 // TODO(vtl): Also check the rights here once they're actually preserved? 319 EXPECT_EQ(handle_to_send.rights, read_handles[0].rights);
320 320
321 *handle_to_receive = std::move(read_handles[0]); 321 *handle_to_receive = std::move(read_handles[0]);
322 } 322 }
323 323
324 RefPtr<MessagePipe> message_pipe(size_t i) { return message_pipes_[i]; } 324 RefPtr<MessagePipe> message_pipe(size_t i) { return message_pipes_[i]; }
325 RefPtr<DataPipe> dp() { return dp_; } 325 RefPtr<DataPipe> dp() { return dp_; }
326 326
327 private: 327 private:
328 void EnsureMessagePipeClosed(size_t i) { 328 void EnsureMessagePipeClosed(size_t i) {
329 if (!message_pipes_[i]) 329 if (!message_pipes_[i])
(...skipping 2615 matching lines...) Expand 10 before | Expand all | Expand 10 after
2945 &waiter, MOJO_HANDLE_SIGNAL_READ_THRESHOLD, 0, &hss)); 2945 &waiter, MOJO_HANDLE_SIGNAL_READ_THRESHOLD, 0, &hss));
2946 EXPECT_EQ(MOJO_HANDLE_SIGNAL_PEER_CLOSED, hss.satisfied_signals); 2946 EXPECT_EQ(MOJO_HANDLE_SIGNAL_PEER_CLOSED, hss.satisfied_signals);
2947 EXPECT_EQ(MOJO_HANDLE_SIGNAL_PEER_CLOSED, hss.satisfiable_signals); 2947 EXPECT_EQ(MOJO_HANDLE_SIGNAL_PEER_CLOSED, hss.satisfiable_signals);
2948 2948
2949 this->ConsumerClose(); 2949 this->ConsumerClose();
2950 } 2950 }
2951 2951
2952 } // namespace 2952 } // namespace
2953 } // namespace system 2953 } // namespace system
2954 } // namespace mojo 2954 } // namespace mojo
OLDNEW
« no previous file with comments | « no previous file | mojo/edk/system/multiprocess_message_pipe_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698