| OLD | NEW |
| 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 ASSERT_NE(HANDLE(nullptr), handle); | 92 ASSERT_NE(HANDLE(nullptr), handle); |
| 93 | 93 |
| 94 ASSERT_DEATH({ | 94 ASSERT_DEATH({ |
| 95 base::win::ScopedHandle handle_holder; | 95 base::win::ScopedHandle handle_holder; |
| 96 handle_holder.handle_ = handle; | 96 handle_holder.handle_ = handle; |
| 97 }, ""); | 97 }, ""); |
| 98 | 98 |
| 99 ASSERT_TRUE(::CloseHandle(handle)); | 99 ASSERT_TRUE(::CloseHandle(handle)); |
| 100 } | 100 } |
| 101 | 101 |
| 102 TEST(ScopedHandleTest, MultiProcess) { | 102 // Under ASan, the multi-process test crashes during process shutdown for |
| 103 // unknown reasons. Disable it for now. http://crbug.com/685262 |
| 104 #if defined(ADDRESS_SANITIZER) |
| 105 #define MAYBE_MultiProcess DISABLED_MultiProcess |
| 106 #else |
| 107 #define MAYBE_MultiProcess MultiProcess |
| 108 #endif |
| 109 |
| 110 TEST(ScopedHandleTest, MAYBE_MultiProcess) { |
| 103 // 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 |
| 104 // 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 |
| 105 // for the child process here. | 113 // for the child process here. |
| 106 CommandLine command_line(base::GetMultiProcessTestChildBaseCommandLine()); | 114 CommandLine command_line(base::GetMultiProcessTestChildBaseCommandLine()); |
| 107 command_line.AppendSwitch(switches::kTestDoNotInitializeIcu); | 115 command_line.AppendSwitch(switches::kTestDoNotInitializeIcu); |
| 108 | 116 |
| 109 base::Process test_child_process = base::SpawnMultiProcessTestChild( | 117 base::Process test_child_process = base::SpawnMultiProcessTestChild( |
| 110 "ActiveVerifierChildProcess", command_line, LaunchOptions()); | 118 "ActiveVerifierChildProcess", command_line, LaunchOptions()); |
| 111 | 119 |
| 112 int rv = -1; | 120 int rv = -1; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 125 if (!run_test_function) | 133 if (!run_test_function) |
| 126 return 1; | 134 return 1; |
| 127 if (!run_test_function()) | 135 if (!run_test_function()) |
| 128 return 1; | 136 return 1; |
| 129 | 137 |
| 130 return 0; | 138 return 0; |
| 131 } | 139 } |
| 132 | 140 |
| 133 } // namespace win | 141 } // namespace win |
| 134 } // namespace base | 142 } // namespace base |
| OLD | NEW |