Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(245)

Side by Side Diff: chrome/browser/nacl_host/test/gdb_debug_stub_browsertest.cc

Issue 1349783006: Cleanup: Pass std::string as const reference if possible (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert third_party changes Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/process/process.h" 10 #include "base/process/process.h"
11 #include "base/strings/string_number_conversions.h" 11 #include "base/strings/string_number_conversions.h"
12 #include "chrome/common/chrome_paths.h" 12 #include "chrome/common/chrome_paths.h"
13 #include "chrome/test/ppapi/ppapi_test.h" 13 #include "chrome/test/ppapi/ppapi_test.h"
14 #include "components/nacl/browser/nacl_browser.h" 14 #include "components/nacl/browser/nacl_browser.h"
15 #include "components/nacl/common/nacl_switches.h" 15 #include "components/nacl/common/nacl_switches.h"
16 #include "content/public/test/test_utils.h" 16 #include "content/public/test/test_utils.h"
17 17
18 class NaClGdbDebugStubTest : public PPAPINaClNewlibTest { 18 class NaClGdbDebugStubTest : public PPAPINaClNewlibTest {
19 public: 19 public:
20 NaClGdbDebugStubTest() { 20 NaClGdbDebugStubTest() {
21 } 21 }
22 22
23 void SetUpCommandLine(base::CommandLine* command_line) override; 23 void SetUpCommandLine(base::CommandLine* command_line) override;
24 24
25 void StartTestScript(base::Process* test_process, 25 void StartTestScript(base::Process* test_process,
26 std::string test_name, int debug_stub_port); 26 const std::string& test_name,
27 int debug_stub_port);
27 void RunDebugStubTest(const std::string& nacl_module, 28 void RunDebugStubTest(const std::string& nacl_module,
28 const std::string& test_name); 29 const std::string& test_name);
29 }; 30 };
30 31
31 void NaClGdbDebugStubTest::SetUpCommandLine(base::CommandLine* command_line) { 32 void NaClGdbDebugStubTest::SetUpCommandLine(base::CommandLine* command_line) {
32 PPAPINaClNewlibTest::SetUpCommandLine(command_line); 33 PPAPINaClNewlibTest::SetUpCommandLine(command_line);
33 command_line->AppendSwitch(switches::kEnableNaClDebug); 34 command_line->AppendSwitch(switches::kEnableNaClDebug);
34 } 35 }
35 36
36 void NaClGdbDebugStubTest::StartTestScript(base::Process* test_process, 37 void NaClGdbDebugStubTest::StartTestScript(base::Process* test_process,
37 std::string test_name, 38 const std::string& test_name,
38 int debug_stub_port) { 39 int debug_stub_port) {
39 // We call python script to reuse GDB RSP protocol implementation. 40 // We call python script to reuse GDB RSP protocol implementation.
40 base::CommandLine cmd(base::FilePath(FILE_PATH_LITERAL("python"))); 41 base::CommandLine cmd(base::FilePath(FILE_PATH_LITERAL("python")));
41 base::FilePath script; 42 base::FilePath script;
42 PathService::Get(chrome::DIR_TEST_DATA, &script); 43 PathService::Get(chrome::DIR_TEST_DATA, &script);
43 script = script.AppendASCII("nacl/debug_stub_browser_tests.py"); 44 script = script.AppendASCII("nacl/debug_stub_browser_tests.py");
44 cmd.AppendArgPath(script); 45 cmd.AppendArgPath(script);
45 cmd.AppendArg(base::IntToString(debug_stub_port)); 46 cmd.AppendArg(base::IntToString(debug_stub_port));
46 cmd.AppendArg(test_name); 47 cmd.AppendArg(test_name);
47 LOG(INFO) << cmd.GetCommandLineString(); 48 LOG(INFO) << cmd.GetCommandLineString();
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 #elif defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY) 82 #elif defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY)
82 // Timing out on ARM linux: http://crbug.com/238469 83 // Timing out on ARM linux: http://crbug.com/238469
83 # define MAYBE_Breakpoint DISABLED_Breakpoint 84 # define MAYBE_Breakpoint DISABLED_Breakpoint
84 #else 85 #else
85 # define MAYBE_Breakpoint Breakpoint 86 # define MAYBE_Breakpoint Breakpoint
86 #endif 87 #endif
87 88
88 IN_PROC_BROWSER_TEST_F(NaClGdbDebugStubTest, MAYBE_Breakpoint) { 89 IN_PROC_BROWSER_TEST_F(NaClGdbDebugStubTest, MAYBE_Breakpoint) {
89 RunDebugStubTest("Empty", "breakpoint"); 90 RunDebugStubTest("Empty", "breakpoint");
90 } 91 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698