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 <windows.h> | 5 #include <windows.h> |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/test/multiprocess_test.h" | 10 #include "base/test/multiprocess_test.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 ASSERT_TRUE(events[0]); | 55 ASSERT_TRUE(events[0]); |
56 events[1] = ::CreateEvent(&security_attributes, false, false, NULL); | 56 events[1] = ::CreateEvent(&security_attributes, false, false, NULL); |
57 ASSERT_TRUE(events[1]); | 57 ASSERT_TRUE(events[1]); |
58 | 58 |
59 ASSERT_TRUE(startup_info.InitializeProcThreadAttributeList(1)); | 59 ASSERT_TRUE(startup_info.InitializeProcThreadAttributeList(1)); |
60 ASSERT_TRUE(startup_info.UpdateProcThreadAttribute( | 60 ASSERT_TRUE(startup_info.UpdateProcThreadAttribute( |
61 PROC_THREAD_ATTRIBUTE_HANDLE_LIST, &events[0], | 61 PROC_THREAD_ATTRIBUTE_HANDLE_LIST, &events[0], |
62 sizeof(events[0]))); | 62 sizeof(events[0]))); |
63 | 63 |
64 std::wstring cmd_line = | 64 std::wstring cmd_line = |
65 this->MakeCmdLine("FireInheritedEvents", false).GetCommandLineString(); | 65 MakeCmdLine("FireInheritedEvents").GetCommandLineString(); |
66 | 66 |
67 PROCESS_INFORMATION temp_process_info = {}; | 67 PROCESS_INFORMATION temp_process_info = {}; |
68 ASSERT_TRUE(::CreateProcess(NULL, const_cast<wchar_t*>(cmd_line.c_str()), | 68 ASSERT_TRUE(::CreateProcess(NULL, const_cast<wchar_t*>(cmd_line.c_str()), |
69 NULL, NULL, true, EXTENDED_STARTUPINFO_PRESENT, | 69 NULL, NULL, true, EXTENDED_STARTUPINFO_PRESENT, |
70 NULL, NULL, startup_info.startup_info(), | 70 NULL, NULL, startup_info.startup_info(), |
71 &temp_process_info)) << ::GetLastError(); | 71 &temp_process_info)) << ::GetLastError(); |
72 base::win::ScopedProcessInformation process_info(temp_process_info); | 72 base::win::ScopedProcessInformation process_info(temp_process_info); |
73 | 73 |
74 // Only the first event should be signalled | 74 // Only the first event should be signalled |
75 EXPECT_EQ(WAIT_OBJECT_0, ::WaitForMultipleObjects(2, events, false, | 75 EXPECT_EQ(WAIT_OBJECT_0, ::WaitForMultipleObjects(2, events, false, |
76 4000)); | 76 4000)); |
77 } | 77 } |
78 | 78 |
OLD | NEW |