OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 // Unit test for SyncChannel. | 5 // Unit test for SyncChannel. |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
13 #include "base/platform_thread.h" | 13 #include "base/platform_thread.h" |
14 #include "base/string_util.h" | 14 #include "base/string_util.h" |
15 #include "base/thread.h" | 15 #include "base/thread.h" |
16 #include "base/waitable_event.h" | 16 #include "base/waitable_event.h" |
17 #include "chrome/common/child_process.h" | 17 #include "chrome/common/child_process.h" |
18 #include "chrome/common/ipc_message.h" | 18 #include "chrome/common/ipc_message.h" |
19 #include "chrome/common/ipc_sync_channel.h" | 19 #include "chrome/common/ipc_sync_channel.h" |
20 #include "chrome/common/stl_util-inl.h" | 20 #include "chrome/common/stl_util-inl.h" |
21 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
22 | 22 |
| 23 #define IPC_MESSAGE_MACROS_ENUMS |
| 24 #include "chrome/common/ipc_sync_channel_unittest.h" |
23 | 25 |
24 #define MESSAGES_INTERNAL_FILE "chrome/common/ipc_sync_message_unittest.h" | 26 // define the classes |
25 #include "chrome/common/ipc_message_macros.h" | 27 #define IPC_MESSAGE_MACROS_CLASSES |
| 28 #include "chrome/common/ipc_sync_channel_unittest.h" |
26 | 29 |
27 using namespace IPC; | 30 using namespace IPC; |
28 using base::WaitableEvent; | 31 using base::WaitableEvent; |
29 | 32 |
30 namespace { | 33 namespace { |
31 | 34 |
32 class IPCSyncChannelTest : public testing::Test { | 35 class IPCSyncChannelTest : public testing::Test { |
33 private: | 36 private: |
34 MessageLoop message_loop_; | 37 MessageLoop message_loop_; |
35 }; | 38 }; |
(...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1001 | 1004 |
1002 // Tests http://b/1474092 - that if after the done_event is set but before | 1005 // Tests http://b/1474092 - that if after the done_event is set but before |
1003 // OnObjectSignaled is called another message is sent out, then after its | 1006 // OnObjectSignaled is called another message is sent out, then after its |
1004 // reply comes back OnObjectSignaled will be called for the first message. | 1007 // reply comes back OnObjectSignaled will be called for the first message. |
1005 TEST_F(IPCSyncChannelTest, DoneEventRace) { | 1008 TEST_F(IPCSyncChannelTest, DoneEventRace) { |
1006 std::vector<Worker*> workers; | 1009 std::vector<Worker*> workers; |
1007 workers.push_back(new DoneEventRaceServer()); | 1010 workers.push_back(new DoneEventRaceServer()); |
1008 workers.push_back(new SimpleClient()); | 1011 workers.push_back(new SimpleClient()); |
1009 RunTest(workers); | 1012 RunTest(workers); |
1010 } | 1013 } |
OLD | NEW |