| 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 10 matching lines...) Expand all Loading... |
| 21 #include "base/memory/scoped_ptr.h" | 21 #include "base/memory/scoped_ptr.h" |
| 22 #include "base/memory/scoped_vector.h" | 22 #include "base/memory/scoped_vector.h" |
| 23 #include "base/message_loop/message_loop.h" | 23 #include "base/message_loop/message_loop.h" |
| 24 #include "base/posix/eintr_wrapper.h" | 24 #include "base/posix/eintr_wrapper.h" |
| 25 #include "base/rand_util.h" | 25 #include "base/rand_util.h" |
| 26 #include "base/synchronization/lock.h" | 26 #include "base/synchronization/lock.h" |
| 27 #include "base/synchronization/waitable_event.h" | 27 #include "base/synchronization/waitable_event.h" |
| 28 #include "base/threading/platform_thread.h" // For |Sleep()|. | 28 #include "base/threading/platform_thread.h" // For |Sleep()|. |
| 29 #include "base/threading/simple_thread.h" | 29 #include "base/threading/simple_thread.h" |
| 30 #include "base/time/time.h" | 30 #include "base/time/time.h" |
| 31 #include "mojo/system/embedder/platform_channel_pair.h" |
| 32 #include "mojo/system/embedder/platform_handle.h" |
| 33 #include "mojo/system/embedder/scoped_platform_handle.h" |
| 31 #include "mojo/system/message_in_transit.h" | 34 #include "mojo/system/message_in_transit.h" |
| 32 #include "mojo/system/platform_channel_pair.h" | |
| 33 #include "mojo/system/platform_handle.h" | |
| 34 #include "mojo/system/scoped_platform_handle.h" | |
| 35 #include "mojo/system/test_utils.h" | 35 #include "mojo/system/test_utils.h" |
| 36 | 36 |
| 37 namespace mojo { | 37 namespace mojo { |
| 38 namespace system { | 38 namespace system { |
| 39 namespace { | 39 namespace { |
| 40 | 40 |
| 41 MessageInTransit* MakeTestMessage(uint32_t num_bytes) { | 41 MessageInTransit* MakeTestMessage(uint32_t num_bytes) { |
| 42 std::vector<unsigned char> bytes(num_bytes, 0); | 42 std::vector<unsigned char> bytes(num_bytes, 0); |
| 43 for (size_t i = 0; i < num_bytes; i++) | 43 for (size_t i = 0; i < num_bytes; i++) |
| 44 bytes[i] = static_cast<unsigned char>(i + num_bytes); | 44 bytes[i] = static_cast<unsigned char>(i + num_bytes); |
| (...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 521 FROM_HERE, | 521 FROM_HERE, |
| 522 base::Bind(&RawChannel::Shutdown, | 522 base::Bind(&RawChannel::Shutdown, |
| 523 base::Unretained(rc.get()))); | 523 base::Unretained(rc.get()))); |
| 524 | 524 |
| 525 EXPECT_FALSE(rc->WriteMessage(MakeTestMessage(1))); | 525 EXPECT_FALSE(rc->WriteMessage(MakeTestMessage(1))); |
| 526 } | 526 } |
| 527 | 527 |
| 528 } // namespace | 528 } // namespace |
| 529 } // namespace system | 529 } // namespace system |
| 530 } // namespace mojo | 530 } // namespace mojo |
| OLD | NEW |