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

Side by Side Diff: base/win/scoped_handle_unittest.cc

Issue 2733323002: Changing multiprocess test SpawnChild to return a struct. (Closed)
Patch Set: Synced Created 3 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 unified diff | Download patch
« no previous file with comments | « base/test/multiprocess_test_android.cc ('k') | base/win/wait_chain_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <windows.h> 5 #include <windows.h>
6 #include <winternl.h> 6 #include <winternl.h>
7 7
8 #include "base/base_switches.h" 8 #include "base/base_switches.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 #define MAYBE_MultiProcess MultiProcess 107 #define MAYBE_MultiProcess MultiProcess
108 #endif 108 #endif
109 109
110 TEST(ScopedHandleTest, MAYBE_MultiProcess) { 110 TEST(ScopedHandleTest, MAYBE_MultiProcess) {
111 // Initializing ICU in the child process causes a scoped handle to be created 111 // Initializing ICU in the child process causes a scoped handle to be created
112 // before the test gets a chance to test the race condition, so disable ICU 112 // before the test gets a chance to test the race condition, so disable ICU
113 // for the child process here. 113 // for the child process here.
114 CommandLine command_line(base::GetMultiProcessTestChildBaseCommandLine()); 114 CommandLine command_line(base::GetMultiProcessTestChildBaseCommandLine());
115 command_line.AppendSwitch(switches::kTestDoNotInitializeIcu); 115 command_line.AppendSwitch(switches::kTestDoNotInitializeIcu);
116 116
117 base::Process test_child_process = base::SpawnMultiProcessTestChild( 117 base::SpawnChildResult spawn_child = base::SpawnMultiProcessTestChild(
118 "ActiveVerifierChildProcess", command_line, LaunchOptions()); 118 "ActiveVerifierChildProcess", command_line, LaunchOptions());
119 119
120 int rv = -1; 120 int rv = -1;
121 ASSERT_TRUE(test_child_process.WaitForExitWithTimeout( 121 ASSERT_TRUE(spawn_child.process.WaitForExitWithTimeout(
122 TestTimeouts::action_timeout(), &rv)); 122 TestTimeouts::action_timeout(), &rv));
123 EXPECT_EQ(0, rv); 123 EXPECT_EQ(0, rv);
124 } 124 }
125 125
126 MULTIPROCESS_TEST_MAIN(ActiveVerifierChildProcess) { 126 MULTIPROCESS_TEST_MAIN(ActiveVerifierChildProcess) {
127 ScopedNativeLibrary module(FilePath(L"scoped_handle_test_dll.dll")); 127 ScopedNativeLibrary module(FilePath(L"scoped_handle_test_dll.dll"));
128 128
129 if (!module.is_valid()) 129 if (!module.is_valid())
130 return 1; 130 return 1;
131 auto run_test_function = reinterpret_cast<decltype(&testing::RunTest)>( 131 auto run_test_function = reinterpret_cast<decltype(&testing::RunTest)>(
132 module.GetFunctionPointer("RunTest")); 132 module.GetFunctionPointer("RunTest"));
133 if (!run_test_function) 133 if (!run_test_function)
134 return 1; 134 return 1;
135 if (!run_test_function()) 135 if (!run_test_function())
136 return 1; 136 return 1;
137 137
138 return 0; 138 return 0;
139 } 139 }
140 140
141 } // namespace win 141 } // namespace win
142 } // namespace base 142 } // namespace base
OLDNEW
« no previous file with comments | « base/test/multiprocess_test_android.cc ('k') | base/win/wait_chain_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698