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 <gtest/gtest.h> | 5 #include <gtest/gtest.h> |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <sys/wait.h> | 8 #include <sys/wait.h> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 MessageLoop::QuitClosure()); | 208 MessageLoop::QuitClosure()); |
209 } | 209 } |
210 | 210 |
211 void RunTest() { | 211 void RunTest() { |
212 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, | 212 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, |
213 base::Bind(&ProcessProxyTest::InitRegistryTest, | 213 base::Bind(&ProcessProxyTest::InitRegistryTest, |
214 base::Unretained(this))); | 214 base::Unretained(this))); |
215 | 215 |
216 // Wait until all data from output watcher is received (QuitTask will be | 216 // Wait until all data from output watcher is received (QuitTask will be |
217 // fired on watcher thread). | 217 // fired on watcher thread). |
218 ui_test_utils::RunMessageLoop(); | 218 content::RunMessageLoop(); |
219 | 219 |
220 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, | 220 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, |
221 base::Bind(&ProcessProxyTest::EndRegistryTest, | 221 base::Bind(&ProcessProxyTest::EndRegistryTest, |
222 base::Unretained(this))); | 222 base::Unretained(this))); |
223 | 223 |
224 // Wait until we clean up the process proxy. | 224 // Wait until we clean up the process proxy. |
225 ui_test_utils::RunMessageLoop(); | 225 content::RunMessageLoop(); |
226 } | 226 } |
227 | 227 |
228 scoped_ptr<TestRunner> test_runner_; | 228 scoped_ptr<TestRunner> test_runner_; |
229 | 229 |
230 private: | 230 private: |
231 ProcessProxyRegistry* registry_; | 231 ProcessProxyRegistry* registry_; |
232 pid_t pid_; | 232 pid_t pid_; |
233 }; | 233 }; |
234 | 234 |
235 // Test will open new process that will run cat command, and verify data we | 235 // Test will open new process that will run cat command, and verify data we |
236 // write to process gets echoed back. | 236 // write to process gets echoed back. |
237 IN_PROC_BROWSER_TEST_F(ProcessProxyTest, RegistryTest) { | 237 IN_PROC_BROWSER_TEST_F(ProcessProxyTest, RegistryTest) { |
238 test_runner_.reset(new RegistryTestRunner()); | 238 test_runner_.reset(new RegistryTestRunner()); |
239 RunTest(); | 239 RunTest(); |
240 } | 240 } |
241 | 241 |
242 // Open new process, then kill it. Verifiy that we detect when the process dies. | 242 // Open new process, then kill it. Verifiy that we detect when the process dies. |
243 IN_PROC_BROWSER_TEST_F(ProcessProxyTest, RegistryNotifiedOnProcessExit) { | 243 IN_PROC_BROWSER_TEST_F(ProcessProxyTest, RegistryNotifiedOnProcessExit) { |
244 test_runner_.reset(new RegistryNotifiedOnProcessExitTestRunner()); | 244 test_runner_.reset(new RegistryNotifiedOnProcessExitTestRunner()); |
245 RunTest(); | 245 RunTest(); |
246 } | 246 } |
247 | 247 |
248 // Test verifies that \003 message send to process is processed as SigInt. | 248 // Test verifies that \003 message send to process is processed as SigInt. |
249 // Timing out on the waterfall: http://crbug.com/115064 | 249 // Timing out on the waterfall: http://crbug.com/115064 |
250 IN_PROC_BROWSER_TEST_F(ProcessProxyTest, DISABLED_SigInt) { | 250 IN_PROC_BROWSER_TEST_F(ProcessProxyTest, DISABLED_SigInt) { |
251 test_runner_.reset(new SigIntTestRunner()); | 251 test_runner_.reset(new SigIntTestRunner()); |
252 RunTest(); | 252 RunTest(); |
253 } | 253 } |
OLD | NEW |