| 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/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "base/test/test_reg_util_win.h" | 10 #include "base/test/test_reg_util_win.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 machine_state.Initialize(); | 85 machine_state.Initialize(); |
| 86 EXPECT_TRUE(machine_state.GetProductState( | 86 EXPECT_TRUE(machine_state.GetProductState( |
| 87 system_level, distribution->GetType()) == NULL); | 87 system_level, distribution->GetType()) == NULL); |
| 88 | 88 |
| 89 // Let's pretend chrome is installed. | 89 // Let's pretend chrome is installed. |
| 90 RegKey version_key(root, distribution->GetVersionKey().c_str(), | 90 RegKey version_key(root, distribution->GetVersionKey().c_str(), |
| 91 KEY_ALL_ACCESS); | 91 KEY_ALL_ACCESS); |
| 92 ASSERT_TRUE(version_key.Valid()); | 92 ASSERT_TRUE(version_key.Valid()); |
| 93 | 93 |
| 94 const char kCurrentVersion[] = "1.2.3.4"; | 94 const char kCurrentVersion[] = "1.2.3.4"; |
| 95 Version current_version(kCurrentVersion); | 95 base::Version current_version(kCurrentVersion); |
| 96 version_key.WriteValue(google_update::kRegVersionField, | 96 version_key.WriteValue(google_update::kRegVersionField, |
| 97 base::UTF8ToWide( | 97 base::UTF8ToWide( |
| 98 current_version.GetString()).c_str()); | 98 current_version.GetString()).c_str()); |
| 99 | 99 |
| 100 // We started out with a non-msi product. | 100 // We started out with a non-msi product. |
| 101 machine_state.Initialize(); | 101 machine_state.Initialize(); |
| 102 const installer::ProductState* chrome_state = | 102 const installer::ProductState* chrome_state = |
| 103 machine_state.GetProductState(system_level, distribution->GetType()); | 103 machine_state.GetProductState(system_level, distribution->GetType()); |
| 104 EXPECT_TRUE(chrome_state != NULL); | 104 EXPECT_TRUE(chrome_state != NULL); |
| 105 if (chrome_state != NULL) { | 105 if (chrome_state != NULL) { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 122 if (chrome_state != NULL) | 122 if (chrome_state != NULL) |
| 123 EXPECT_TRUE(chrome_state->is_msi()); | 123 EXPECT_TRUE(chrome_state->is_msi()); |
| 124 } | 124 } |
| 125 } | 125 } |
| 126 | 126 |
| 127 TEST_F(ProductTest, LaunchChrome) { | 127 TEST_F(ProductTest, LaunchChrome) { |
| 128 // TODO(tommi): Test Product::LaunchChrome and | 128 // TODO(tommi): Test Product::LaunchChrome and |
| 129 // Product::LaunchChromeAndWait. | 129 // Product::LaunchChromeAndWait. |
| 130 LOG(ERROR) << "Test not implemented."; | 130 LOG(ERROR) << "Test not implemented."; |
| 131 } | 131 } |
| OLD | NEW |