OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/importer/firefox_importer_unittest_utils.h" | 5 #include "chrome/browser/importer/firefox_importer_unittest_utils.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/base_switches.h" | 8 #include "base/base_switches.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
11 #include "base/file_util.h" | 11 #include "base/file_util.h" |
| 12 #include "base/global_descriptors_posix.h" |
12 #include "base/message_loop.h" | 13 #include "base/message_loop.h" |
13 #include "base/test/test_timeouts.h" | 14 #include "base/test/test_timeouts.h" |
14 #include "chrome/browser/importer/firefox_importer_utils.h" | 15 #include "chrome/browser/importer/firefox_importer_utils.h" |
15 #include "ipc/ipc_channel.h" | 16 #include "ipc/ipc_channel.h" |
16 #include "ipc/ipc_descriptors.h" | 17 #include "ipc/ipc_descriptors.h" |
17 #include "ipc/ipc_message.h" | 18 #include "ipc/ipc_message.h" |
18 #include "ipc/ipc_switches.h" | 19 #include "ipc/ipc_switches.h" |
| 20 #include "ipc/ipc_tests.h" |
19 #include "testing/multiprocess_func_list.h" | 21 #include "testing/multiprocess_func_list.h" |
20 | 22 |
21 #define IPC_MESSAGE_IMPL | 23 #define IPC_MESSAGE_IMPL |
22 #include "chrome/browser/importer/firefox_importer_unittest_messages_internal.h" | 24 #include "chrome/browser/importer/firefox_importer_unittest_messages_internal.h" |
23 | 25 |
24 namespace { | 26 namespace { |
25 | 27 |
26 // Name of IPC Channel to use for Server<-> Child Communications. | 28 // Name of IPC Channel to use for Server<-> Child Communications. |
27 const char kTestChannelID[] = "T1"; | 29 const char kTestChannelID[] = "T1"; |
28 | 30 |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 virtual void OnChannelError() { | 258 virtual void OnChannelError() { |
257 MessageLoop::current()->Quit(); | 259 MessageLoop::current()->Quit(); |
258 } | 260 } |
259 | 261 |
260 private: | 262 private: |
261 NSSDecryptor decryptor_; | 263 NSSDecryptor decryptor_; |
262 IPC::Message::Sender* sender_; | 264 IPC::Message::Sender* sender_; |
263 }; | 265 }; |
264 | 266 |
265 // Entry function in child process. | 267 // Entry function in child process. |
266 MULTIPROCESS_TEST_MAIN(NSSDecrypterChildProcess) { | 268 MULTIPROCESS_TEST_MAIN(NSSDecrypterChildProcess, MultiProcessTestIPCSetUp) { |
267 MessageLoopForIO main_message_loop; | 269 MessageLoopForIO main_message_loop; |
268 FFDecryptorClientChannelListener listener; | 270 FFDecryptorClientChannelListener listener; |
269 | 271 |
270 IPC::Channel channel(kTestChannelID, IPC::Channel::MODE_CLIENT, &listener); | 272 IPC::Channel channel(kTestChannelID, IPC::Channel::MODE_CLIENT, &listener); |
271 CHECK(channel.Connect()); | 273 CHECK(channel.Connect()); |
272 listener.SetSender(&channel); | 274 listener.SetSender(&channel); |
273 | 275 |
274 // run message loop | 276 // run message loop |
275 MessageLoop::current()->Run(); | 277 MessageLoop::current()->Run(); |
276 | 278 |
277 return 0; | 279 return 0; |
278 } | 280 } |
OLD | NEW |