| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "chrome/installer/setup/setup_singleton.h" | 5 #include "chrome/installer/setup/setup_singleton.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 | 8 |
| 9 #include <functional> | 9 #include <functional> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 command_line.AppendSwitchPath(kInstallDirSwitch, install_dir_path()); | 136 command_line.AppendSwitchPath(kInstallDirSwitch, install_dir_path()); |
| 137 return command_line; | 137 return command_line; |
| 138 } | 138 } |
| 139 | 139 |
| 140 base::Process SpawnChildProcess(const std::string& process_name) { | 140 base::Process SpawnChildProcess(const std::string& process_name) { |
| 141 base::LaunchOptions options; | 141 base::LaunchOptions options; |
| 142 options.start_hidden = true; | 142 options.start_hidden = true; |
| 143 return SpawnChildWithOptions(process_name, options); | 143 return SpawnChildWithOptions(process_name, options); |
| 144 } | 144 } |
| 145 | 145 |
| 146 const base::FilePath& install_dir_path() const { return install_dir_.path(); } | 146 const base::FilePath& install_dir_path() const { |
| 147 return install_dir_.GetPath(); |
| 148 } |
| 147 | 149 |
| 148 private: | 150 private: |
| 149 base::ScopedTempDir install_dir_; | 151 base::ScopedTempDir install_dir_; |
| 150 | 152 |
| 151 DISALLOW_COPY_AND_ASSIGN(SetupSingletonTest); | 153 DISALLOW_COPY_AND_ASSIGN(SetupSingletonTest); |
| 152 }; | 154 }; |
| 153 | 155 |
| 154 } // namespace | 156 } // namespace |
| 155 | 157 |
| 156 // Verify that a single SetupSingleton can be active at a time for a given | 158 // Verify that a single SetupSingleton can be active at a time for a given |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 // we are in the scope of a SetupSingleton). | 213 // we are in the scope of a SetupSingleton). |
| 212 EXPECT_EQ(SUCCESS, CreateAndDeleteSentinelFile(install_dir_path())); | 214 EXPECT_EQ(SUCCESS, CreateAndDeleteSentinelFile(install_dir_path())); |
| 213 | 215 |
| 214 // Join |wait_process|. | 216 // Join |wait_process|. |
| 215 int exit_code = 0; | 217 int exit_code = 0; |
| 216 EXPECT_TRUE(wait_process.WaitForExit(&exit_code)); | 218 EXPECT_TRUE(wait_process.WaitForExit(&exit_code)); |
| 217 EXPECT_EQ(SUCCESS, exit_code); | 219 EXPECT_EQ(SUCCESS, exit_code); |
| 218 } | 220 } |
| 219 | 221 |
| 220 } // namespace installer | 222 } // namespace installer |
| OLD | NEW |