| 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.h" | 5 #include "chrome/installer/util/product.h" |
| 6 | 6 |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 machine_state.Initialize(); | 60 machine_state.Initialize(); |
| 61 EXPECT_TRUE(machine_state.GetProductState( | 61 EXPECT_TRUE(machine_state.GetProductState( |
| 62 system_level, distribution->GetType()) == NULL); | 62 system_level, distribution->GetType()) == NULL); |
| 63 | 63 |
| 64 // Let's pretend chrome is installed. | 64 // Let's pretend chrome is installed. |
| 65 RegKey version_key(root, distribution->GetVersionKey().c_str(), | 65 RegKey version_key(root, distribution->GetVersionKey().c_str(), |
| 66 KEY_ALL_ACCESS); | 66 KEY_ALL_ACCESS); |
| 67 ASSERT_TRUE(version_key.Valid()); | 67 ASSERT_TRUE(version_key.Valid()); |
| 68 | 68 |
| 69 const char kCurrentVersion[] = "1.2.3.4"; | 69 const char kCurrentVersion[] = "1.2.3.4"; |
| 70 Version current_version(kCurrentVersion); | 70 base::Version current_version(kCurrentVersion); |
| 71 version_key.WriteValue(google_update::kRegVersionField, | 71 version_key.WriteValue(google_update::kRegVersionField, |
| 72 base::UTF8ToWide( | 72 base::UTF8ToWide( |
| 73 current_version.GetString()).c_str()); | 73 current_version.GetString()).c_str()); |
| 74 | 74 |
| 75 // We started out with a non-msi product. | 75 // We started out with a non-msi product. |
| 76 machine_state.Initialize(); | 76 machine_state.Initialize(); |
| 77 const installer::ProductState* chrome_state = | 77 const installer::ProductState* chrome_state = |
| 78 machine_state.GetProductState(system_level, distribution->GetType()); | 78 machine_state.GetProductState(system_level, distribution->GetType()); |
| 79 EXPECT_TRUE(chrome_state != NULL); | 79 EXPECT_TRUE(chrome_state != NULL); |
| 80 if (chrome_state != NULL) { | 80 if (chrome_state != NULL) { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 97 if (chrome_state != NULL) | 97 if (chrome_state != NULL) |
| 98 EXPECT_TRUE(chrome_state->is_msi()); | 98 EXPECT_TRUE(chrome_state->is_msi()); |
| 99 } | 99 } |
| 100 } | 100 } |
| 101 | 101 |
| 102 TEST(ProductTest, LaunchChrome) { | 102 TEST(ProductTest, LaunchChrome) { |
| 103 // TODO(tommi): Test Product::LaunchChrome and | 103 // TODO(tommi): Test Product::LaunchChrome and |
| 104 // Product::LaunchChromeAndWait. | 104 // Product::LaunchChromeAndWait. |
| 105 NOTIMPLEMENTED(); | 105 NOTIMPLEMENTED(); |
| 106 } | 106 } |
| OLD | NEW |