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/test/test_reg_util_win.h" | 8 #include "base/test/test_reg_util_win.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/common/chrome_constants.h" | 10 #include "chrome/common/chrome_constants.h" |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Version current_version(kCurrentVersion); | 111 Version current_version(kCurrentVersion); |
112 version_key.WriteValue(google_update::kRegVersionField, | 112 version_key.WriteValue(google_update::kRegVersionField, |
113 UTF8ToWide(current_version.GetString()).c_str()); | 113 base::UTF8ToWide(current_version.GetString()).c_str()); |
114 | 114 |
115 // We started out with a non-msi product. | 115 // We started out with a non-msi product. |
116 machine_state.Initialize(); | 116 machine_state.Initialize(); |
117 const installer::ProductState* chrome_state = | 117 const installer::ProductState* chrome_state = |
118 machine_state.GetProductState(system_level, distribution->GetType()); | 118 machine_state.GetProductState(system_level, distribution->GetType()); |
119 EXPECT_TRUE(chrome_state != NULL); | 119 EXPECT_TRUE(chrome_state != NULL); |
120 if (chrome_state != NULL) { | 120 if (chrome_state != NULL) { |
121 EXPECT_TRUE(chrome_state->version().Equals(current_version)); | 121 EXPECT_TRUE(chrome_state->version().Equals(current_version)); |
122 EXPECT_FALSE(chrome_state->is_msi()); | 122 EXPECT_FALSE(chrome_state->is_msi()); |
123 } | 123 } |
(...skipping 13 matching lines...) Expand all Loading... |
137 if (chrome_state != NULL) | 137 if (chrome_state != NULL) |
138 EXPECT_TRUE(chrome_state->is_msi()); | 138 EXPECT_TRUE(chrome_state->is_msi()); |
139 } | 139 } |
140 } | 140 } |
141 | 141 |
142 TEST_F(ProductTest, LaunchChrome) { | 142 TEST_F(ProductTest, LaunchChrome) { |
143 // TODO(tommi): Test Product::LaunchChrome and | 143 // TODO(tommi): Test Product::LaunchChrome and |
144 // Product::LaunchChromeAndWait. | 144 // Product::LaunchChromeAndWait. |
145 LOG(ERROR) << "Test not implemented."; | 145 LOG(ERROR) << "Test not implemented."; |
146 } | 146 } |
OLD | NEW |