OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/chrome_mini_installer.h" | 5 #include "chrome/test/mini_installer_test/chrome_mini_installer.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/platform_thread.h" | 10 #include "base/platform_thread.h" |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 // This method will get the latest full installer from nightly location | 123 // This method will get the latest full installer from nightly location |
124 // and installs it. | 124 // and installs it. |
125 void ChromeMiniInstaller::InstallFullInstaller(bool over_install) { | 125 void ChromeMiniInstaller::InstallFullInstaller(bool over_install) { |
126 ASSERT_TRUE(has_full_installer_); | 126 ASSERT_TRUE(has_full_installer_); |
127 InstallMiniInstaller(over_install, full_installer_); | 127 InstallMiniInstaller(over_install, full_installer_); |
128 } | 128 } |
129 | 129 |
130 // Installs the Chrome mini-installer, checks the registry and shortcuts. | 130 // Installs the Chrome mini-installer, checks the registry and shortcuts. |
131 void ChromeMiniInstaller::InstallMiniInstaller(bool over_install, | 131 void ChromeMiniInstaller::InstallMiniInstaller(bool over_install, |
132 const std::wstring& path) { | 132 const std::wstring& path) { |
133 std::wstring exe_name = file_util::GetFilenameFromPath(path); | |
134 printf("\nChrome will be installed at %ls level\n", install_type_.c_str()); | 133 printf("\nChrome will be installed at %ls level\n", install_type_.c_str()); |
135 printf("\nWill proceed with the test only if this path exists: %ls\n\n", | 134 printf("\nWill proceed with the test only if this path exists: %ls\n\n", |
136 path.c_str()); | 135 path.c_str()); |
137 ASSERT_TRUE(file_util::PathExists(FilePath(path))) << path | 136 |
138 << " does not exist."; | 137 FilePath exe_path(path); |
139 LaunchInstaller(path, exe_name.c_str()); | 138 ASSERT_TRUE(file_util::PathExists(exe_path)) << path << " does not exist."; |
| 139 LaunchInstaller(path, exe_path.BaseName().value().c_str()); |
140 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); | 140 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); |
141 ASSERT_TRUE(CheckRegistryKey(dist->GetVersionKey())) << dist->GetVersionKey() | 141 ASSERT_TRUE(CheckRegistryKey(dist->GetVersionKey())) << dist->GetVersionKey() |
142 << " does not exist."; | 142 << " does not exist."; |
143 VerifyInstall(over_install); | 143 VerifyInstall(over_install); |
144 } | 144 } |
145 | 145 |
146 // This method tests the standalone installer by verifying the steps listed at: | 146 // This method tests the standalone installer by verifying the steps listed at: |
147 // https://sites.google.com/a/google.com/chrome-pmo/ | 147 // https://sites.google.com/a/google.com/chrome-pmo/ |
148 // standalone-installers/testing-standalone-installers | 148 // standalone-installers/testing-standalone-installers |
149 // This method applies appropriate tags to standalone installer and deletes | 149 // This method applies appropriate tags to standalone installer and deletes |
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
676 // This method will verify if the installed build is correct. | 676 // This method will verify if the installed build is correct. |
677 bool ChromeMiniInstaller::VerifyStandaloneInstall() { | 677 bool ChromeMiniInstaller::VerifyStandaloneInstall() { |
678 std::wstring reg_key_value_returned, standalone_installer_version; | 678 std::wstring reg_key_value_returned, standalone_installer_version; |
679 MiniInstallerTestUtil::GetStandaloneVersion(&standalone_installer_version); | 679 MiniInstallerTestUtil::GetStandaloneVersion(&standalone_installer_version); |
680 GetChromeVersionFromRegistry(®_key_value_returned); | 680 GetChromeVersionFromRegistry(®_key_value_returned); |
681 if (standalone_installer_version.compare(reg_key_value_returned) == 0) | 681 if (standalone_installer_version.compare(reg_key_value_returned) == 0) |
682 return true; | 682 return true; |
683 else | 683 else |
684 return false; | 684 return false; |
685 } | 685 } |
OLD | NEW |