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" | |
25 | 23 |
26 // define the classes | 24 #define MESSAGES_INTERNAL_FILE "chrome/common/ipc_sync_message_unittest.h" |
27 #define IPC_MESSAGE_MACROS_CLASSES | 25 #include "chrome/common/ipc_message_macros.h" |
28 #include "chrome/common/ipc_sync_channel_unittest.h" | |
29 | 26 |
30 using namespace IPC; | 27 using namespace IPC; |
31 using base::WaitableEvent; | 28 using base::WaitableEvent; |
32 | 29 |
33 namespace { | 30 namespace { |
34 | 31 |
35 class IPCSyncChannelTest : public testing::Test { | 32 class IPCSyncChannelTest : public testing::Test { |
36 private: | 33 private: |
37 MessageLoop message_loop_; | 34 MessageLoop message_loop_; |
38 }; | 35 }; |
(...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1004 | 1001 |
1005 // Tests http://b/1474092 - that if after the done_event is set but before | 1002 // Tests http://b/1474092 - that if after the done_event is set but before |
1006 // OnObjectSignaled is called another message is sent out, then after its | 1003 // OnObjectSignaled is called another message is sent out, then after its |
1007 // reply comes back OnObjectSignaled will be called for the first message. | 1004 // reply comes back OnObjectSignaled will be called for the first message. |
1008 TEST_F(IPCSyncChannelTest, DoneEventRace) { | 1005 TEST_F(IPCSyncChannelTest, DoneEventRace) { |
1009 std::vector<Worker*> workers; | 1006 std::vector<Worker*> workers; |
1010 workers.push_back(new DoneEventRaceServer()); | 1007 workers.push_back(new DoneEventRaceServer()); |
1011 workers.push_back(new SimpleClient()); | 1008 workers.push_back(new SimpleClient()); |
1012 RunTest(workers); | 1009 RunTest(workers); |
1013 } | 1010 } |
OLD | NEW |