| 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 "chrome/test/mini_installer_test/installer_path_provider.h" | 5 #include "chrome/test/mini_installer_test/installer_path_provider.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 | 103 |
| 104 bool InstallerPathProvider::GetDiffInstaller(base::FilePath* path) { | 104 bool InstallerPathProvider::GetDiffInstaller(base::FilePath* path) { |
| 105 std::string diff_installer_pattern("*_from_*"); | 105 std::string diff_installer_pattern("*_from_*"); |
| 106 return GetInstaller(diff_installer_pattern, path); | 106 return GetInstaller(diff_installer_pattern, path); |
| 107 } | 107 } |
| 108 | 108 |
| 109 bool InstallerPathProvider::GetMiniInstaller(base::FilePath* path) { | 109 bool InstallerPathProvider::GetMiniInstaller(base::FilePath* path) { |
| 110 // Use local copy of installer, else fall back to filer. | 110 // Use local copy of installer, else fall back to filer. |
| 111 base::FilePath mini_installer = PathFromExeDir( | 111 base::FilePath mini_installer = PathFromExeDir( |
| 112 mini_installer_constants::kChromeMiniInstallerExecutable); | 112 mini_installer_constants::kChromeMiniInstallerExecutable); |
| 113 if (file_util::PathExists(mini_installer)) { | 113 if (base::PathExists(mini_installer)) { |
| 114 *path = mini_installer; | 114 *path = mini_installer; |
| 115 return true; | 115 return true; |
| 116 } | 116 } |
| 117 std::string mini_installer_pattern("mini_installer.exe"); | 117 std::string mini_installer_pattern("mini_installer.exe"); |
| 118 return GetInstaller(mini_installer_pattern, path); | 118 return GetInstaller(mini_installer_pattern, path); |
| 119 } | 119 } |
| 120 | 120 |
| 121 bool InstallerPathProvider::GetPreviousInstaller(base::FilePath* path) { | 121 bool InstallerPathProvider::GetPreviousInstaller(base::FilePath* path) { |
| 122 std::string diff_installer_pattern("*_from_*"); | 122 std::string diff_installer_pattern("*_from_*"); |
| 123 std::string full_installer_pattern("*_chrome_installer*"); | 123 std::string full_installer_pattern("*_chrome_installer*"); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 std::string standalone_installer_filename = base::StringPrintf( | 159 std::string standalone_installer_filename = base::StringPrintf( |
| 160 "%s%s_%s.exe", | 160 "%s%s_%s.exe", |
| 161 base::FilePath(mini_installer_constants::kUntaggedInstallerPattern) | 161 base::FilePath(mini_installer_constants::kUntaggedInstallerPattern) |
| 162 .MaybeAsASCII().c_str(), | 162 .MaybeAsASCII().c_str(), |
| 163 tokenized_build_number[2].c_str(), | 163 tokenized_build_number[2].c_str(), |
| 164 tokenized_build_number[3].c_str()); | 164 tokenized_build_number[3].c_str()); |
| 165 standalone_installer = standalone_installer.AppendASCII(current_build_) | 165 standalone_installer = standalone_installer.AppendASCII(current_build_) |
| 166 .Append(mini_installer_constants::kWinFolder) | 166 .Append(mini_installer_constants::kWinFolder) |
| 167 .AppendASCII(standalone_installer_filename); | 167 .AppendASCII(standalone_installer_filename); |
| 168 *path = standalone_installer; | 168 *path = standalone_installer; |
| 169 return file_util::PathExists(standalone_installer); | 169 return base::PathExists(standalone_installer); |
| 170 } | 170 } |
| 171 | 171 |
| 172 bool InstallerPathProvider::GetSignedStandaloneInstaller(base::FilePath* path) { | 172 bool InstallerPathProvider::GetSignedStandaloneInstaller(base::FilePath* path) { |
| 173 base::FilePath standalone_installer; | 173 base::FilePath standalone_installer; |
| 174 if (!GetStandaloneInstaller(&standalone_installer)) | 174 if (!GetStandaloneInstaller(&standalone_installer)) |
| 175 return false; | 175 return false; |
| 176 base::FilePath tagged_installer = PathFromExeDir( | 176 base::FilePath tagged_installer = PathFromExeDir( |
| 177 mini_installer_constants::kStandaloneInstaller); | 177 mini_installer_constants::kStandaloneInstaller); |
| 178 CommandLine sign_command = CommandLine::FromString( | 178 CommandLine sign_command = CommandLine::FromString( |
| 179 base::StringPrintf(L"%ls %ls %ls %ls", | 179 base::StringPrintf(L"%ls %ls %ls %ls", |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 | 229 |
| 230 std::string InstallerPathProvider::GetCurrentBuild() { | 230 std::string InstallerPathProvider::GetCurrentBuild() { |
| 231 return current_build_; | 231 return current_build_; |
| 232 } | 232 } |
| 233 | 233 |
| 234 std::string InstallerPathProvider::GetPreviousBuild() { | 234 std::string InstallerPathProvider::GetPreviousBuild() { |
| 235 return previous_build_; | 235 return previous_build_; |
| 236 } | 236 } |
| 237 | 237 |
| 238 } // namespace | 238 } // namespace |
| OLD | NEW |