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

Side by Side Diff: util/win/process_info_test.cc

Issue 1356753004: Use argument escaping function in util/win/process_info_test.cc (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Crashpad Authors. All rights reserved. 1 // Copyright 2015 The Crashpad Authors. All rights reserved.
2 // 2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 ASSERT_TRUE(done.get()); 117 ASSERT_TRUE(done.get());
118 118
119 base::FilePath test_executable = Paths::Executable(); 119 base::FilePath test_executable = Paths::Executable();
120 120
121 std::wstring child_test_executable = 121 std::wstring child_test_executable =
122 test_executable.DirName() 122 test_executable.DirName()
123 .Append(directory_modification) 123 .Append(directory_modification)
124 .Append(test_executable.BaseName().RemoveFinalExtension().value() + 124 .Append(test_executable.BaseName().RemoveFinalExtension().value() +
125 L"_process_info_test_child.exe") 125 L"_process_info_test_child.exe")
126 .value(); 126 .value();
127 // TODO(scottmg): Command line escaping utility. 127
128 ChildLauncher child( 128 std::wstring args;
129 child_test_executable, 129 AppendCommandLineArgument(started_uuid.ToString16(), &args);
130 started_uuid.ToString16() + L" " + done_uuid.ToString16()); 130 args += L" ";
131 AppendCommandLineArgument(done_uuid.ToString16(), &args);
132
133 ChildLauncher child(child_test_executable, args);
131 child.Start(); 134 child.Start();
132 135
133 // Wait until the test has completed initialization. 136 // Wait until the test has completed initialization.
134 ASSERT_EQ(WaitForSingleObject(started.get(), INFINITE), WAIT_OBJECT_0); 137 ASSERT_EQ(WaitForSingleObject(started.get(), INFINITE), WAIT_OBJECT_0);
135 138
136 ASSERT_TRUE(process_info.Initialize(child.process_handle())); 139 ASSERT_TRUE(process_info.Initialize(child.process_handle()));
137 140
138 // Tell the test it's OK to shut down now that we've read our data. 141 // Tell the test it's OK to shut down now that we've read our data.
139 SetEvent(done.get()); 142 SetEvent(done.get());
140 143
(...skipping 27 matching lines...) Expand all
168 TestOtherProcess(FILE_PATH_LITERAL("..\\..\\out\\Debug")); 171 TestOtherProcess(FILE_PATH_LITERAL("..\\..\\out\\Debug"));
169 #else 172 #else
170 TestOtherProcess(FILE_PATH_LITERAL("..\\..\\out\\Release")); 173 TestOtherProcess(FILE_PATH_LITERAL("..\\..\\out\\Release"));
171 #endif 174 #endif
172 } 175 }
173 #endif // ARCH_CPU_64_BITS 176 #endif // ARCH_CPU_64_BITS
174 177
175 } // namespace 178 } // namespace
176 } // namespace test 179 } // namespace test
177 } // namespace crashpad 180 } // namespace crashpad
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698