OLD | NEW |
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/system/raw_channel.h" | 5 #include "mojo/system/raw_channel.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/location.h" | 13 #include "base/location.h" |
14 #include "base/logging.h" | 14 #include "base/logging.h" |
15 #include "base/macros.h" | 15 #include "base/macros.h" |
16 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
17 #include "base/memory/scoped_vector.h" | 17 #include "base/memory/scoped_vector.h" |
18 #include "base/rand_util.h" | 18 #include "base/rand_util.h" |
19 #include "base/synchronization/lock.h" | 19 #include "base/synchronization/lock.h" |
20 #include "base/synchronization/waitable_event.h" | 20 #include "base/synchronization/waitable_event.h" |
21 #include "base/threading/platform_thread.h" // For |Sleep()|. | 21 #include "base/threading/platform_thread.h" // For |Sleep()|. |
22 #include "base/threading/simple_thread.h" | 22 #include "base/threading/simple_thread.h" |
23 #include "base/time/time.h" | 23 #include "base/time/time.h" |
24 #include "build/build_config.h" | 24 #include "build/build_config.h" |
25 #include "mojo/common/test/test_utils.h" | 25 #include "mojo/common/test/test_utils.h" |
26 #include "mojo/system/embedder/platform_channel_pair.h" | 26 #include "mojo/embedder/platform_channel_pair.h" |
27 #include "mojo/system/embedder/platform_handle.h" | 27 #include "mojo/embedder/platform_handle.h" |
28 #include "mojo/system/embedder/scoped_platform_handle.h" | 28 #include "mojo/embedder/scoped_platform_handle.h" |
29 #include "mojo/system/message_in_transit.h" | 29 #include "mojo/system/message_in_transit.h" |
30 #include "mojo/system/test_utils.h" | 30 #include "mojo/system/test_utils.h" |
31 #include "testing/gtest/include/gtest/gtest.h" | 31 #include "testing/gtest/include/gtest/gtest.h" |
32 | 32 |
33 namespace mojo { | 33 namespace mojo { |
34 namespace system { | 34 namespace system { |
35 namespace { | 35 namespace { |
36 | 36 |
37 scoped_ptr<MessageInTransit> MakeTestMessage(uint32_t num_bytes) { | 37 scoped_ptr<MessageInTransit> MakeTestMessage(uint32_t num_bytes) { |
38 std::vector<unsigned char> bytes(num_bytes, 0); | 38 std::vector<unsigned char> bytes(num_bytes, 0); |
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
562 io_thread()->PostTaskAndWait(FROM_HERE, | 562 io_thread()->PostTaskAndWait(FROM_HERE, |
563 base::Bind(&RawChannel::Shutdown, | 563 base::Bind(&RawChannel::Shutdown, |
564 base::Unretained(rc.get()))); | 564 base::Unretained(rc.get()))); |
565 | 565 |
566 EXPECT_FALSE(rc->WriteMessage(MakeTestMessage(1))); | 566 EXPECT_FALSE(rc->WriteMessage(MakeTestMessage(1))); |
567 } | 567 } |
568 | 568 |
569 } // namespace | 569 } // namespace |
570 } // namespace system | 570 } // namespace system |
571 } // namespace mojo | 571 } // namespace mojo |
OLD | NEW |