OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "build/build_config.h" | 5 #include "build/build_config.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/hi_res_timer_manager.h" | 8 #include "base/hi_res_timer_manager.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/system_monitor/system_monitor.h" | 10 #include "base/system_monitor/system_monitor.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 platform.PlatformInitialize(); | 32 platform.PlatformInitialize(); |
33 bool no_sandbox = parsed_command_line.HasSwitch(switches::kNoSandbox); | 33 bool no_sandbox = parsed_command_line.HasSwitch(switches::kNoSandbox); |
34 platform.InitSandboxTests(no_sandbox); | 34 platform.InitSandboxTests(no_sandbox); |
35 | 35 |
36 if (!no_sandbox) { | 36 if (!no_sandbox) { |
37 platform.EnableSandbox(); | 37 platform.EnableSandbox(); |
38 } | 38 } |
39 bool sandbox_test_result = platform.RunSandboxTests(); | 39 bool sandbox_test_result = platform.RunSandboxTests(); |
40 | 40 |
41 if (sandbox_test_result) { | 41 if (sandbox_test_result) { |
42 bool debug = parsed_command_line.HasSwitch(switches::kEnableNaClDebug); | |
43 NaClListener listener; | 42 NaClListener listener; |
44 listener.set_debug_enabled(debug); | |
45 listener.Listen(); | 43 listener.Listen(); |
46 } else { | 44 } else { |
47 // This indirectly prevents the test-harness-success-cookie from being set, | 45 // This indirectly prevents the test-harness-success-cookie from being set, |
48 // as a way of communicating test failure, because the nexe won't reply. | 46 // as a way of communicating test failure, because the nexe won't reply. |
49 // TODO(jvoung): find a better way to indicate failure that doesn't | 47 // TODO(jvoung): find a better way to indicate failure that doesn't |
50 // require waiting for a timeout. | 48 // require waiting for a timeout. |
51 VLOG(1) << "Sandbox test failed: Not launching NaCl process"; | 49 VLOG(1) << "Sandbox test failed: Not launching NaCl process"; |
52 } | 50 } |
53 #else | 51 #else |
54 NOTIMPLEMENTED() << " not implemented startup, plugin startup dialog etc."; | 52 NOTIMPLEMENTED() << " not implemented startup, plugin startup dialog etc."; |
55 #endif | 53 #endif |
56 | 54 |
57 platform.PlatformUninitialize(); | 55 platform.PlatformUninitialize(); |
58 return 0; | 56 return 0; |
59 } | 57 } |
OLD | NEW |