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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/environment.h" | 6 #include "base/environment.h" |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "base/process/kill.h" | 8 #include "base/process/kill.h" |
9 #include "base/process/launch.h" | 9 #include "base/process/launch.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
11 #include "chrome/common/chrome_paths.h" | 11 #include "chrome/common/chrome_paths.h" |
12 #include "chrome/test/ppapi/ppapi_test.h" | 12 #include "chrome/test/ppapi/ppapi_test.h" |
13 #include "components/nacl/browser/nacl_browser.h" | 13 #include "components/nacl/browser/nacl_browser.h" |
14 #include "components/nacl/common/nacl_switches.h" | 14 #include "components/nacl/common/nacl_switches.h" |
15 #include "content/public/common/content_switches.h" | |
15 #include "content/public/test/test_utils.h" | 16 #include "content/public/test/test_utils.h" |
16 | 17 |
17 class NaClGdbDebugStubTest : public PPAPINaClNewlibTest { | 18 class NaClGdbDebugStubTest : public PPAPINaClNewlibTest { |
18 public: | 19 public: |
19 NaClGdbDebugStubTest() { | 20 NaClGdbDebugStubTest() { |
20 } | 21 } |
21 | 22 |
22 virtual void SetUpCommandLine(CommandLine* command_line) override; | 23 virtual void SetUpCommandLine(CommandLine* command_line) override; |
23 | 24 |
24 void StartTestScript(base::ProcessHandle* test_process, | 25 void StartTestScript(base::ProcessHandle* test_process, |
25 std::string test_name, int debug_stub_port); | 26 std::string test_name, int debug_stub_port); |
26 void RunDebugStubTest(const std::string& nacl_module, | 27 void RunDebugStubTest(const std::string& nacl_module, |
27 const std::string& test_name); | 28 const std::string& test_name); |
28 }; | 29 }; |
29 | 30 |
30 void NaClGdbDebugStubTest::SetUpCommandLine(CommandLine* command_line) { | 31 void NaClGdbDebugStubTest::SetUpCommandLine(CommandLine* command_line) { |
31 PPAPINaClNewlibTest::SetUpCommandLine(command_line); | 32 PPAPINaClNewlibTest::SetUpCommandLine(command_line); |
32 command_line->AppendSwitch(switches::kEnableNaClDebug); | 33 command_line->AppendSwitch(switches::kEnableNaClDebug); |
34 // The debug stub requires --no-sandbox. | |
Mark Seaborn
2014/10/21 22:08:40
Well, we don't *want* using the debug stub to requ
rickyz (no longer on Chrome)
2014/10/22 03:25:05
Ah, upon further inspection, it looks like the rec
| |
35 command_line->AppendSwitch(switches::kNoSandbox); | |
33 } | 36 } |
34 | 37 |
35 void NaClGdbDebugStubTest::StartTestScript(base::ProcessHandle* test_process, | 38 void NaClGdbDebugStubTest::StartTestScript(base::ProcessHandle* test_process, |
36 std::string test_name, | 39 std::string test_name, |
37 int debug_stub_port) { | 40 int debug_stub_port) { |
38 // We call python script to reuse GDB RSP protocol implementation. | 41 // We call python script to reuse GDB RSP protocol implementation. |
39 CommandLine cmd(base::FilePath(FILE_PATH_LITERAL("python"))); | 42 CommandLine cmd(base::FilePath(FILE_PATH_LITERAL("python"))); |
40 base::FilePath script; | 43 base::FilePath script; |
41 PathService::Get(chrome::DIR_TEST_DATA, &script); | 44 PathService::Get(chrome::DIR_TEST_DATA, &script); |
42 script = script.AppendASCII("nacl/debug_stub_browser_tests.py"); | 45 script = script.AppendASCII("nacl/debug_stub_browser_tests.py"); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
80 #elif defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY) | 83 #elif defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY) |
81 // Timing out on ARM linux: http://crbug.com/238469 | 84 // Timing out on ARM linux: http://crbug.com/238469 |
82 # define MAYBE_Breakpoint DISABLED_Breakpoint | 85 # define MAYBE_Breakpoint DISABLED_Breakpoint |
83 #else | 86 #else |
84 # define MAYBE_Breakpoint Breakpoint | 87 # define MAYBE_Breakpoint Breakpoint |
85 #endif | 88 #endif |
86 | 89 |
87 IN_PROC_BROWSER_TEST_F(NaClGdbDebugStubTest, MAYBE_Breakpoint) { | 90 IN_PROC_BROWSER_TEST_F(NaClGdbDebugStubTest, MAYBE_Breakpoint) { |
88 RunDebugStubTest("Empty", "breakpoint"); | 91 RunDebugStubTest("Empty", "breakpoint"); |
89 } | 92 } |
OLD | NEW |