| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "base/logging.h" | |
| 6 #include "base/win/registry.h" | |
| 7 #include "chrome/installer/util/google_update_constants.h" | |
| 8 #include "chrome/installer/util/package_properties.h" | |
| 9 #include "chrome/installer/util/product_unittest.h" | |
| 10 #include "chrome/installer/util/util_constants.h" | |
| 11 #include "testing/gtest/include/gtest/gtest.h" | |
| 12 | |
| 13 using base::win::RegKey; | |
| 14 using installer::PackageProperties; | |
| 15 using installer::ChromePackageProperties; | |
| 16 using installer::ChromiumPackageProperties; | |
| 17 | |
| 18 class PackagePropertiesTest : public testing::Test { | |
| 19 protected: | |
| 20 }; | |
| 21 | |
| 22 TEST_F(PackagePropertiesTest, Basic) { | |
| 23 TempRegKeyOverride::DeleteAllTempKeys(); | |
| 24 ChromePackageProperties chrome_props; | |
| 25 ChromiumPackageProperties chromium_props; | |
| 26 PackageProperties* props[] = { &chrome_props, &chromium_props }; | |
| 27 for (size_t i = 0; i < arraysize(props); ++i) { | |
| 28 std::wstring state_key(props[i]->GetStateKey()); | |
| 29 EXPECT_FALSE(state_key.empty()); | |
| 30 std::wstring version_key(props[i]->GetVersionKey()); | |
| 31 EXPECT_FALSE(version_key.empty()); | |
| 32 if (!props[i]->ReceivesUpdates()) { | |
| 33 TempRegKeyOverride override(HKEY_CURRENT_USER, L"props"); | |
| 34 RegKey key; | |
| 35 EXPECT_EQ(ERROR_SUCCESS, | |
| 36 key.Create(HKEY_CURRENT_USER, state_key.c_str(), KEY_ALL_ACCESS)); | |
| 37 } | |
| 38 TempRegKeyOverride::DeleteAllTempKeys(); | |
| 39 } | |
| 40 } | |
| OLD | NEW |