| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 // TODO(vtl): Factor out the remaining POSIX-specific bits of this test (once we | 5 // TODO(vtl): Factor out the remaining POSIX-specific bits of this test (once we |
| 6 // have a non-POSIX implementation). | 6 // have a non-POSIX implementation). |
| 7 | 7 |
| 8 #include "mojo/system/raw_channel.h" | 8 #include "mojo/system/raw_channel.h" |
| 9 | 9 |
| 10 #include <fcntl.h> | 10 #include <fcntl.h> |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 #include "base/rand_util.h" | 26 #include "base/rand_util.h" |
| 27 #include "base/synchronization/lock.h" | 27 #include "base/synchronization/lock.h" |
| 28 #include "base/synchronization/waitable_event.h" | 28 #include "base/synchronization/waitable_event.h" |
| 29 #include "base/threading/platform_thread.h" // For |Sleep()|. | 29 #include "base/threading/platform_thread.h" // For |Sleep()|. |
| 30 #include "base/threading/simple_thread.h" | 30 #include "base/threading/simple_thread.h" |
| 31 #include "base/threading/thread.h" | 31 #include "base/threading/thread.h" |
| 32 #include "base/time/time.h" | 32 #include "base/time/time.h" |
| 33 #include "mojo/system/message_in_transit.h" | 33 #include "mojo/system/message_in_transit.h" |
| 34 #include "mojo/system/platform_channel.h" | 34 #include "mojo/system/platform_channel.h" |
| 35 #include "mojo/system/platform_channel_handle.h" | 35 #include "mojo/system/platform_channel_handle.h" |
| 36 #include "mojo/system/platform_channel_pair.h" |
| 36 #include "mojo/system/test_utils.h" | 37 #include "mojo/system/test_utils.h" |
| 37 #include "testing/gtest/include/gtest/gtest.h" | 38 #include "testing/gtest/include/gtest/gtest.h" |
| 38 | 39 |
| 39 namespace mojo { | 40 namespace mojo { |
| 40 namespace system { | 41 namespace system { |
| 41 namespace { | 42 namespace { |
| 42 | 43 |
| 43 MessageInTransit* MakeTestMessage(uint32_t num_bytes) { | 44 MessageInTransit* MakeTestMessage(uint32_t num_bytes) { |
| 44 std::vector<unsigned char> bytes(num_bytes, 0); | 45 std::vector<unsigned char> bytes(num_bytes, 0); |
| 45 for (size_t i = 0; i < num_bytes; i++) | 46 for (size_t i = 0; i < num_bytes; i++) |
| (...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 FROM_HERE, | 561 FROM_HERE, |
| 561 base::Bind(&RawChannel::Shutdown, | 562 base::Bind(&RawChannel::Shutdown, |
| 562 base::Unretained(rc.get()))); | 563 base::Unretained(rc.get()))); |
| 563 | 564 |
| 564 EXPECT_FALSE(rc->WriteMessage(MakeTestMessage(1))); | 565 EXPECT_FALSE(rc->WriteMessage(MakeTestMessage(1))); |
| 565 } | 566 } |
| 566 | 567 |
| 567 } // namespace | 568 } // namespace |
| 568 } // namespace system | 569 } // namespace system |
| 569 } // namespace mojo | 570 } // namespace mojo |
| OLD | NEW |