| 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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 base::CommandLine MakeCmdLine(const std::string& procname) override { | 133 base::CommandLine MakeCmdLine(const std::string& procname) override { |
| 134 base::CommandLine command_line = | 134 base::CommandLine command_line = |
| 135 base::MultiProcessTest::MakeCmdLine(procname); | 135 base::MultiProcessTest::MakeCmdLine(procname); |
| 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 base::SpawnChildResult spawn_result = |
| 144 SpawnChildWithOptions(process_name, options); |
| 145 return std::move(spawn_result.process); |
| 144 } | 146 } |
| 145 | 147 |
| 146 const base::FilePath& install_dir_path() const { | 148 const base::FilePath& install_dir_path() const { |
| 147 return install_dir_.GetPath(); | 149 return install_dir_.GetPath(); |
| 148 } | 150 } |
| 149 | 151 |
| 150 private: | 152 private: |
| 151 base::ScopedTempDir install_dir_; | 153 base::ScopedTempDir install_dir_; |
| 152 | 154 |
| 153 DISALLOW_COPY_AND_ASSIGN(SetupSingletonTest); | 155 DISALLOW_COPY_AND_ASSIGN(SetupSingletonTest); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 // we are in the scope of a SetupSingleton). | 215 // we are in the scope of a SetupSingleton). |
| 214 EXPECT_EQ(SUCCESS, CreateAndDeleteSentinelFile(install_dir_path())); | 216 EXPECT_EQ(SUCCESS, CreateAndDeleteSentinelFile(install_dir_path())); |
| 215 | 217 |
| 216 // Join |wait_process|. | 218 // Join |wait_process|. |
| 217 int exit_code = 0; | 219 int exit_code = 0; |
| 218 EXPECT_TRUE(wait_process.WaitForExit(&exit_code)); | 220 EXPECT_TRUE(wait_process.WaitForExit(&exit_code)); |
| 219 EXPECT_EQ(SUCCESS, exit_code); | 221 EXPECT_EQ(SUCCESS, exit_code); |
| 220 } | 222 } |
| 221 | 223 |
| 222 } // namespace installer | 224 } // namespace installer |
| OLD | NEW |