Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1662)

Side by Side Diff: chrome/test/mini_installer_test/chrome_mini_installer.cc

Issue 8355023: Add test for installing Chrome Frame using multi-install (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/test/mini_installer_test/test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "chrome/test/mini_installer_test/chrome_mini_installer.h" 5 #include "chrome/test/mini_installer_test/chrome_mini_installer.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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 << "Install failed: unable to get version."; 189 << "Install failed: unable to get version.";
190 VerifyInstall(over_install); 190 VerifyInstall(over_install);
191 } 191 }
192 192
193 CommandLine ChromeMiniInstaller::GetBaseMultiInstallCommand() { 193 CommandLine ChromeMiniInstaller::GetBaseMultiInstallCommand() {
194 FilePath mini_installer; 194 FilePath mini_installer;
195 if (!GetMiniInstaller(&mini_installer)) 195 if (!GetMiniInstaller(&mini_installer))
196 return CommandLine(CommandLine::NO_PROGRAM); 196 return CommandLine(CommandLine::NO_PROGRAM);
197 CommandLine cmd(mini_installer); 197 CommandLine cmd(mini_installer);
198 cmd.AppendSwitch(installer::switches::kMultiInstall); 198 cmd.AppendSwitch(installer::switches::kMultiInstall);
199 cmd.AppendSwitch(installer::switches::kDoNotLaunchChrome);
200 return cmd; 199 return cmd;
201 } 200 }
202 201
203 void ChromeMiniInstaller::InstallChromeUsingMultiInstall() { 202 void ChromeMiniInstaller::InstallChromeUsingMultiInstall() {
204 CommandLine cmd = GetBaseMultiInstallCommand(); 203 CommandLine cmd = GetBaseMultiInstallCommand();
205 cmd.AppendSwitch(installer::switches::kChrome); 204 cmd.AppendSwitch(installer::switches::kChrome);
206 RunInstaller(cmd); 205 RunInstaller(cmd);
207 206
208 // Verify installation. 207 // Verify installation.
209 InstallationValidator::InstallationType type = 208 InstallationValidator::InstallationType type =
210 installer::ExpectValidInstallation(system_install_); 209 installer::ExpectValidInstallation(system_install_);
211 BrowserDistribution* dist = GetCurrentBrowserDistribution(); 210 BrowserDistribution* dist = GetCurrentBrowserDistribution();
212 ASSERT_TRUE(InstallUtil::IsMultiInstall(dist, system_install_)); 211 ASSERT_TRUE(InstallUtil::IsMultiInstall(dist, system_install_));
213 EXPECT_TRUE(type & InstallationValidator::ProductBits::CHROME_MULTI); 212 EXPECT_TRUE(type & InstallationValidator::ProductBits::CHROME_MULTI);
214 FindChromeShortcut(); 213 FindChromeShortcut();
215 LaunchChrome(true); 214 LaunchChrome(true);
216 } 215 }
217 216
218 void ChromeMiniInstaller::InstallChromeFrameUsingMultiInstall() { 217 void ChromeMiniInstaller::InstallChromeFrameUsingMultiInstall() {
219 CommandLine cmd = GetBaseMultiInstallCommand(); 218 CommandLine cmd = GetBaseMultiInstallCommand();
220 cmd.AppendSwitch(installer::switches::kChromeFrame);
221 RunInstaller(cmd); 219 RunInstaller(cmd);
222 220
223 // Verify installation. 221 // Verify installation.
224 InstallationValidator::InstallationType type = 222 InstallationValidator::InstallationType type =
225 installer::ExpectValidInstallation(system_install_); 223 installer::ExpectValidInstallation(system_install_);
226 BrowserDistribution* dist = GetCurrentBrowserDistribution(); 224 BrowserDistribution* dist = GetCurrentBrowserDistribution();
227 ASSERT_TRUE(InstallUtil::IsMultiInstall(dist, system_install_)); 225 ASSERT_TRUE(InstallUtil::IsMultiInstall(dist, system_install_));
228 EXPECT_TRUE(type & InstallationValidator::ProductBits::CHROME_FRAME_MULTI); 226 EXPECT_TRUE(type & InstallationValidator::ProductBits::CHROME_FRAME_MULTI);
229 // Launch IE 227 // Launch IE
230 LaunchIE(L"gcf:about:version"); 228 LaunchIE(L"gcf:about:version");
231 // Check if Chrome process got spawned. 229 if (system_install_) {
232 MiniInstallerTestUtil::VerifyProcessLaunch(installer::kChromeExe, false); 230 MiniInstallerTestUtil::VerifyProcessLaunch(installer::kChromeExe, true);
231 } else {
232 MiniInstallerTestUtil::VerifyProcessLaunch(
233 installer::kChromeFrameHelperExe, true);
234 }
233 FindChromeShortcut(); 235 FindChromeShortcut();
234 } 236 }
235 237
236 void ChromeMiniInstaller::InstallChromeAndChromeFrame(bool ready_mode) { 238 void ChromeMiniInstaller::InstallChromeAndChromeFrame(bool ready_mode) {
237 CommandLine cmd = GetBaseMultiInstallCommand(); 239 CommandLine cmd = GetBaseMultiInstallCommand();
238 cmd.AppendSwitch(installer::switches::kChrome); 240 cmd.AppendSwitch(installer::switches::kChrome);
239 cmd.AppendSwitch(installer::switches::kChromeFrame); 241 cmd.AppendSwitch(installer::switches::kChromeFrame);
240 if (ready_mode) 242 if (ready_mode)
241 cmd.AppendSwitch(installer::switches::kChromeFrameReadyMode); 243 cmd.AppendSwitch(installer::switches::kChromeFrameReadyMode);
242 RunInstaller(cmd); 244 RunInstaller(cmd);
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after
900 } 902 }
901 903
902 if (installer.empty()) { 904 if (installer.empty()) {
903 LOG(WARNING) << "Failed to find installer with pattern: " << pattern; 905 LOG(WARNING) << "Failed to find installer with pattern: " << pattern;
904 return false; 906 return false;
905 } 907 }
906 908
907 *path = installer; 909 *path = installer;
908 return true; 910 return true;
909 } 911 }
OLDNEW
« no previous file with comments | « no previous file | chrome/test/mini_installer_test/test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698