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

Unified Diff: sandbox/win/src/process_mitigations_test.cc

Issue 1847213002: Make second param for TestChildProcess optional. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/win/src/process_mitigations_test.cc
diff --git a/sandbox/win/src/process_mitigations_test.cc b/sandbox/win/src/process_mitigations_test.cc
index b7c608eafb2380339d9f3e9325e29faaa0953f35..4e48017565bffd7cf33f1ec12098b97ec0321a60 100644
--- a/sandbox/win/src/process_mitigations_test.cc
+++ b/sandbox/win/src/process_mitigations_test.cc
@@ -205,7 +205,7 @@ void TestWin10ImageLoadLowLabel(bool is_success_test) {
namespace sandbox {
// A shared helper test command that will attempt to CreateProcess
-// with a given command line. The second parameter, if set to non-zero
+// with a given command line. The second optional parameter, if set to non-zero
penny 2016/04/01 17:20:30 <whisper>comma after 'non-zero'?</whisper> :)
Will Harris 2016/04/01 18:23:52 actually it had a comma but it went over 80chars s
penny 2016/04/01 18:35:36 ROFL
// will cause the child process to return exit code STATUS_ACCESS_VIOLATION.
//
// ***Make sure you've enabled basic process creation in the
@@ -214,12 +214,16 @@ namespace sandbox {
// sandbox::TargetPolicy::SetTokenLevel(),
// and TestRunner::SetDisableCsrss().
SBOX_TESTS_COMMAND int TestChildProcess(int argc, wchar_t** argv) {
- if (argc < 2)
+ if (argc < 1)
return SBOX_TEST_INVALID_PARAMETER;
- int desired_exit_code = _wtoi(argv[1]);
- if (desired_exit_code)
+ int desired_exit_code = 0;
+
+ if (argc == 2) {
+ desired_exit_code = _wtoi(argv[1]);
+ if (desired_exit_code)
desired_exit_code = STATUS_ACCESS_VIOLATION;
+ }
std::wstring cmd = argv[0];
base::LaunchOptions options = base::LaunchOptionsForTest();
« 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