| 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/installer/setup/installer_state.h" | 5 #include "chrome/installer/setup/installer_state.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <fstream> | 10 #include <fstream> |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 } | 152 } |
| 153 | 153 |
| 154 // Test GetCurrentVersion when migrating single Chrome to multi | 154 // Test GetCurrentVersion when migrating single Chrome to multi |
| 155 TEST_F(InstallerStateTest, GetCurrentVersionMigrateChrome) { | 155 TEST_F(InstallerStateTest, GetCurrentVersionMigrateChrome) { |
| 156 using installer::FakeInstallationState; | 156 using installer::FakeInstallationState; |
| 157 | 157 |
| 158 const bool system_install = false; | 158 const bool system_install = false; |
| 159 FakeInstallationState machine_state; | 159 FakeInstallationState machine_state; |
| 160 | 160 |
| 161 // Pretend that this version of single-install Chrome is already installed. | 161 // Pretend that this version of single-install Chrome is already installed. |
| 162 machine_state.AddChrome(system_install, false, | 162 machine_state.AddChrome(system_install, |
| 163 new base::Version(chrome::kChromeVersion)); | 163 new base::Version(chrome::kChromeVersion)); |
| 164 | 164 |
| 165 // Now we're invoked to install multi Chrome. | 165 // Now we're invoked to install multi Chrome. |
| 166 base::CommandLine cmd_line( | 166 base::CommandLine cmd_line( |
| 167 base::CommandLine::FromString(L"setup.exe --multi-install --chrome")); | 167 base::CommandLine::FromString(L"setup.exe --multi-install --chrome")); |
| 168 MasterPreferences prefs(cmd_line); | 168 MasterPreferences prefs(cmd_line); |
| 169 InstallerState installer_state; | 169 InstallerState installer_state; |
| 170 installer_state.Initialize(cmd_line, prefs, machine_state); | 170 installer_state.Initialize(cmd_line, prefs, machine_state); |
| 171 | 171 |
| 172 // Is the Chrome version picked up? | 172 // Is the Chrome version picked up? |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 // Critical update newer than the new version. | 376 // Critical update newer than the new version. |
| 377 EXPECT_FALSE( | 377 EXPECT_FALSE( |
| 378 installer_state.DetermineCriticalVersion(NULL, *pv_version_).IsValid()); | 378 installer_state.DetermineCriticalVersion(NULL, *pv_version_).IsValid()); |
| 379 EXPECT_FALSE( | 379 EXPECT_FALSE( |
| 380 installer_state.DetermineCriticalVersion(opv_version_, *pv_version_) | 380 installer_state.DetermineCriticalVersion(opv_version_, *pv_version_) |
| 381 .IsValid()); | 381 .IsValid()); |
| 382 EXPECT_FALSE( | 382 EXPECT_FALSE( |
| 383 installer_state.DetermineCriticalVersion(pv_version_, *pv_version_) | 383 installer_state.DetermineCriticalVersion(pv_version_, *pv_version_) |
| 384 .IsValid()); | 384 .IsValid()); |
| 385 } | 385 } |
| OLD | NEW |