| 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/installer/util/product_unittest.h" | 5 #include "chrome/installer/util/product_unittest.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/scoped_handle.h" | 8 #include "base/scoped_handle.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/installer/util/chrome_frame_distribution.h" | 10 #include "chrome/installer/util/chrome_frame_distribution.h" |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 EXPECT_EQ(launch_cmd, found_launch_cmd); | 133 EXPECT_EQ(launch_cmd, found_launch_cmd); |
| 134 | 134 |
| 135 // There should be no installed version in the registry. | 135 // There should be no installed version in the registry. |
| 136 EXPECT_TRUE(product->GetInstalledVersion() == NULL); | 136 EXPECT_TRUE(product->GetInstalledVersion() == NULL); |
| 137 | 137 |
| 138 // Let's pretend chrome is installed. | 138 // Let's pretend chrome is installed. |
| 139 RegKey version_key(root, distribution->GetVersionKey().c_str(), | 139 RegKey version_key(root, distribution->GetVersionKey().c_str(), |
| 140 KEY_ALL_ACCESS); | 140 KEY_ALL_ACCESS); |
| 141 ASSERT_TRUE(version_key.Valid()); | 141 ASSERT_TRUE(version_key.Valid()); |
| 142 | 142 |
| 143 const wchar_t kCurrentVersion[] = L"1.2.3.4"; | 143 const char kCurrentVersion[] = "1.2.3.4"; |
| 144 scoped_ptr<Version> current_version( | 144 scoped_ptr<Version> current_version( |
| 145 Version::GetVersionFromString(kCurrentVersion)); | 145 Version::GetVersionFromString(kCurrentVersion)); |
| 146 version_key.WriteValue(google_update::kRegVersionField, | 146 version_key.WriteValue(google_update::kRegVersionField, |
| 147 UTF8ToWide(current_version->GetString()).c_str()); | 147 UTF8ToWide(current_version->GetString()).c_str()); |
| 148 | 148 |
| 149 scoped_ptr<Version> installed(product->GetInstalledVersion()); | 149 scoped_ptr<Version> installed(product->GetInstalledVersion()); |
| 150 EXPECT_TRUE(installed.get() != NULL); | 150 EXPECT_TRUE(installed.get() != NULL); |
| 151 if (installed.get()) { | 151 if (installed.get()) { |
| 152 EXPECT_TRUE(installed->Equals(*current_version.get())); | 152 EXPECT_TRUE(installed->Equals(*current_version.get())); |
| 153 } | 153 } |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 installer::MasterPreferences::ForCurrentProcess(); | 187 installer::MasterPreferences::ForCurrentProcess(); |
| 188 | 188 |
| 189 installs.AddDistribution(BrowserDistribution::CHROME_BROWSER, prefs); | 189 installs.AddDistribution(BrowserDistribution::CHROME_BROWSER, prefs); |
| 190 FakeChromeFrameDistribution fake_chrome_frame(prefs); | 190 FakeChromeFrameDistribution fake_chrome_frame(prefs); |
| 191 installs.AddDistribution(&fake_chrome_frame); | 191 installs.AddDistribution(&fake_chrome_frame); |
| 192 EXPECT_EQ(2U, installs.products().size()); | 192 EXPECT_EQ(2U, installs.products().size()); |
| 193 // Since our fake Chrome Frame distribution class is reporting the same | 193 // Since our fake Chrome Frame distribution class is reporting the same |
| 194 // installation directory as Chrome, we should have only one package object. | 194 // installation directory as Chrome, we should have only one package object. |
| 195 EXPECT_EQ(1U, installs.packages().size()); | 195 EXPECT_EQ(1U, installs.packages().size()); |
| 196 } | 196 } |
| OLD | NEW |