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/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/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "base/test/test_reg_util_win.h" | 9 #include "base/test/test_reg_util_win.h" |
10 #include "chrome/common/chrome_constants.h" | 10 #include "chrome/common/chrome_constants.h" |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 { | 101 { |
102 RegistryOverrideManager override_manager; | 102 RegistryOverrideManager override_manager; |
103 override_manager.OverrideRegistry(root, L"root_pit"); | 103 override_manager.OverrideRegistry(root, L"root_pit"); |
104 | 104 |
105 // Let's pretend chrome is installed. | 105 // Let's pretend chrome is installed. |
106 RegKey version_key(root, distribution->GetVersionKey().c_str(), | 106 RegKey version_key(root, distribution->GetVersionKey().c_str(), |
107 KEY_ALL_ACCESS); | 107 KEY_ALL_ACCESS); |
108 ASSERT_TRUE(version_key.Valid()); | 108 ASSERT_TRUE(version_key.Valid()); |
109 | 109 |
110 const char kCurrentVersion[] = "1.2.3.4"; | 110 const char kCurrentVersion[] = "1.2.3.4"; |
111 base::Version current_version(kCurrentVersion); | 111 Version current_version(kCurrentVersion); |
112 version_key.WriteValue(google_update::kRegVersionField, | 112 version_key.WriteValue(google_update::kRegVersionField, |
113 base::UTF8ToWide( | 113 base::UTF8ToWide( |
114 current_version.GetString()).c_str()); | 114 current_version.GetString()).c_str()); |
115 | 115 |
116 // We started out with a non-msi product. | 116 // We started out with a non-msi product. |
117 machine_state.Initialize(); | 117 machine_state.Initialize(); |
118 const installer::ProductState* chrome_state = | 118 const installer::ProductState* chrome_state = |
119 machine_state.GetProductState(system_level, distribution->GetType()); | 119 machine_state.GetProductState(system_level, distribution->GetType()); |
120 EXPECT_TRUE(chrome_state != NULL); | 120 EXPECT_TRUE(chrome_state != NULL); |
121 if (chrome_state != NULL) { | 121 if (chrome_state != NULL) { |
(...skipping 16 matching lines...) Expand all Loading... |
138 if (chrome_state != NULL) | 138 if (chrome_state != NULL) |
139 EXPECT_TRUE(chrome_state->is_msi()); | 139 EXPECT_TRUE(chrome_state->is_msi()); |
140 } | 140 } |
141 } | 141 } |
142 | 142 |
143 TEST_F(ProductTest, LaunchChrome) { | 143 TEST_F(ProductTest, LaunchChrome) { |
144 // TODO(tommi): Test Product::LaunchChrome and | 144 // TODO(tommi): Test Product::LaunchChrome and |
145 // Product::LaunchChromeAndWait. | 145 // Product::LaunchChromeAndWait. |
146 LOG(ERROR) << "Test not implemented."; | 146 LOG(ERROR) << "Test not implemented."; |
147 } | 147 } |
OLD | NEW |