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

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

Issue 1408003013: Reland "EDK: Move //mojo/edk/system/waitable_event* to edk/util." (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 1 month 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/raw_channel.h" 5 #include "mojo/edk/system/raw_channel.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <stdio.h> 8 #include <stdio.h>
9 9
10 #include <memory> 10 #include <memory>
11 #include <utility> 11 #include <utility>
12 #include <vector> 12 #include <vector>
13 13
14 #include "base/bind.h" 14 #include "base/bind.h"
15 #include "base/logging.h" 15 #include "base/logging.h"
16 #include "mojo/edk/embedder/platform_channel_pair.h" 16 #include "mojo/edk/embedder/platform_channel_pair.h"
17 #include "mojo/edk/embedder/platform_handle.h" 17 #include "mojo/edk/embedder/platform_handle.h"
18 #include "mojo/edk/embedder/scoped_platform_handle.h" 18 #include "mojo/edk/embedder/scoped_platform_handle.h"
19 #include "mojo/edk/system/message_in_transit.h" 19 #include "mojo/edk/system/message_in_transit.h"
20 #include "mojo/edk/system/test/random.h" 20 #include "mojo/edk/system/test/random.h"
21 #include "mojo/edk/system/test/scoped_test_dir.h" 21 #include "mojo/edk/system/test/scoped_test_dir.h"
22 #include "mojo/edk/system/test/simple_test_thread.h" 22 #include "mojo/edk/system/test/simple_test_thread.h"
23 #include "mojo/edk/system/test/sleep.h" 23 #include "mojo/edk/system/test/sleep.h"
24 #include "mojo/edk/system/test/test_io_thread.h" 24 #include "mojo/edk/system/test/test_io_thread.h"
25 #include "mojo/edk/system/transport_data.h" 25 #include "mojo/edk/system/transport_data.h"
26 #include "mojo/edk/system/waitable_event.h"
27 #include "mojo/edk/test/test_utils.h" 26 #include "mojo/edk/test/test_utils.h"
28 #include "mojo/edk/util/make_unique.h" 27 #include "mojo/edk/util/make_unique.h"
29 #include "mojo/edk/util/mutex.h" 28 #include "mojo/edk/util/mutex.h"
30 #include "mojo/edk/util/scoped_file.h" 29 #include "mojo/edk/util/scoped_file.h"
30 #include "mojo/edk/util/waitable_event.h"
31 #include "mojo/public/cpp/system/macros.h" 31 #include "mojo/public/cpp/system/macros.h"
32 #include "testing/gtest/include/gtest/gtest.h" 32 #include "testing/gtest/include/gtest/gtest.h"
33 33
34 using mojo::util::AutoResetWaitableEvent;
34 using mojo::util::Mutex; 35 using mojo::util::Mutex;
35 using mojo::util::MutexLocker; 36 using mojo::util::MutexLocker;
36 37
37 namespace mojo { 38 namespace mojo {
38 namespace system { 39 namespace system {
39 namespace { 40 namespace {
40 41
41 std::unique_ptr<MessageInTransit> MakeTestMessage(uint32_t num_bytes) { 42 std::unique_ptr<MessageInTransit> MakeTestMessage(uint32_t num_bytes) {
42 std::vector<unsigned char> bytes(num_bytes, 0); 43 std::vector<unsigned char> bytes(num_bytes, 0);
43 for (size_t i = 0; i < num_bytes; i++) 44 for (size_t i = 0; i < num_bytes; i++)
(...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after
818 819
819 io_thread()->PostTaskAndWait( 820 io_thread()->PostTaskAndWait(
820 base::Bind(&RawChannel::Shutdown, base::Unretained(rc_read.get()))); 821 base::Bind(&RawChannel::Shutdown, base::Unretained(rc_read.get())));
821 io_thread()->PostTaskAndWait( 822 io_thread()->PostTaskAndWait(
822 base::Bind(&RawChannel::Shutdown, base::Unretained(rc_write.get()))); 823 base::Bind(&RawChannel::Shutdown, base::Unretained(rc_write.get())));
823 } 824 }
824 825
825 } // namespace 826 } // namespace
826 } // namespace system 827 } // namespace system
827 } // namespace mojo 828 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/system/master_connection_manager.cc ('k') | mojo/edk/system/slave_connection_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698