| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "base/compiler_specific.h" | 5 #include "base/compiler_specific.h" |
| 6 #include "base/message_loop.h" | 6 #include "base/message_loop.h" |
| 7 #include "base/process_util.h" | 7 #include "base/process_util.h" |
| 8 #include "base/test/multiprocess_test.h" | 8 #include "base/test/multiprocess_test.h" |
| 9 #include "base/test/test_timeouts.h" | 9 #include "base/test/test_timeouts.h" |
| 10 #include "chrome/common/chrome_switches.h" | 10 #include "chrome/common/chrome_switches.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 fds_to_map.push_back(std::pair<int,int>(ipcfd, 3)); | 66 fds_to_map.push_back(std::pair<int,int>(ipcfd, 3)); |
| 67 } | 67 } |
| 68 | 68 |
| 69 return MultiProcessTest::SpawnChild(procname, fds_to_map, false); | 69 return MultiProcessTest::SpawnChild(procname, fds_to_map, false); |
| 70 } | 70 } |
| 71 | 71 |
| 72 CommandLine RendererMainTest::MakeCmdLine(const std::string& procname, | 72 CommandLine RendererMainTest::MakeCmdLine(const std::string& procname, |
| 73 bool debug_on_start) { | 73 bool debug_on_start) { |
| 74 CommandLine command_line = | 74 CommandLine command_line = |
| 75 MultiProcessTest::MakeCmdLine(procname, debug_on_start); | 75 MultiProcessTest::MakeCmdLine(procname, debug_on_start); |
| 76 #if defined(USE_SECCOMP_SANDBOX) | 76 |
| 77 // Turn off seccomp for this test. It's just a problem of refactoring, | 77 // Force seccomp off for this test. It's just a problem of refactoring, |
| 78 // not a bug. | 78 // not a bug. |
| 79 // http://code.google.com/p/chromium/issues/detail?id=59376 | 79 // http://code.google.com/p/chromium/issues/detail?id=59376 |
| 80 command_line.AppendSwitch(switches::kDisableSeccompSandbox); | 80 command_line.AppendSwitch(switches::kDisableSeccompSandbox); |
| 81 #endif | 81 |
| 82 return command_line; | 82 return command_line; |
| 83 } | 83 } |
| 84 | 84 |
| 85 // Listener class that kills the message loop when it connects. | 85 // Listener class that kills the message loop when it connects. |
| 86 class SuicidalListener : public IPC::Channel::Listener { | 86 class SuicidalListener : public IPC::Channel::Listener { |
| 87 public: | 87 public: |
| 88 void OnChannelConnected(int32 peer_pid) { | 88 void OnChannelConnected(int32 peer_pid) { |
| 89 MessageLoop::current()->Quit(); | 89 MessageLoop::current()->Quit(); |
| 90 } | 90 } |
| 91 | 91 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 116 | 116 |
| 117 MessageLoop::current()->Run(); | 117 MessageLoop::current()->Run(); |
| 118 | 118 |
| 119 // The renderer should exit when we close the channel. | 119 // The renderer should exit when we close the channel. |
| 120 control_channel.Close(); | 120 control_channel.Close(); |
| 121 | 121 |
| 122 EXPECT_TRUE(base::WaitForSingleProcess(renderer_pid, | 122 EXPECT_TRUE(base::WaitForSingleProcess(renderer_pid, |
| 123 TestTimeouts::action_timeout_ms())); | 123 TestTimeouts::action_timeout_ms())); |
| 124 } | 124 } |
| 125 #endif // defined(OS_POSIX) | 125 #endif // defined(OS_POSIX) |
| OLD | NEW |