OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <windows.h> | 5 #include <windows.h> |
6 | 6 |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "base/test/test_reg_util_win.h" | 8 #include "base/test/test_reg_util_win.h" |
9 #include "base/version.h" | 9 #include "base/version.h" |
10 #include "base/win/registry.h" | 10 #include "base/win/registry.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 testing::Test::SetUp(); | 60 testing::Test::SetUp(); |
61 | 61 |
62 // Create/open the keys for the product we'll test. | 62 // Create/open the keys for the product we'll test. |
63 system_install_ = true; | 63 system_install_ = true; |
64 overridden_ = (system_install_ ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER); | 64 overridden_ = (system_install_ ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER); |
65 | 65 |
66 // Override for test purposes. We don't use ScopedRegistryKeyOverride | 66 // Override for test purposes. We don't use ScopedRegistryKeyOverride |
67 // directly because it doesn't suit itself to our use here. | 67 // directly because it doesn't suit itself to our use here. |
68 RegKey temp_key; | 68 RegKey temp_key; |
69 | 69 |
70 registry_override_manager_.OverrideRegistry(overridden_, L"ProductStateTest"); | 70 registry_override_manager_.OverrideRegistry(overridden_); |
71 | 71 |
72 EXPECT_EQ(ERROR_SUCCESS, | 72 EXPECT_EQ(ERROR_SUCCESS, |
73 clients_.Create(overridden_, dist_->GetVersionKey().c_str(), | 73 clients_.Create(overridden_, dist_->GetVersionKey().c_str(), |
74 KEY_ALL_ACCESS)); | 74 KEY_ALL_ACCESS)); |
75 EXPECT_EQ(ERROR_SUCCESS, | 75 EXPECT_EQ(ERROR_SUCCESS, |
76 client_state_.Create(overridden_, dist_->GetStateKey().c_str(), | 76 client_state_.Create(overridden_, dist_->GetStateKey().c_str(), |
77 KEY_ALL_ACCESS)); | 77 KEY_ALL_ACCESS)); |
78 } | 78 } |
79 | 79 |
80 void ProductStateTest::TearDown() { | 80 void ProductStateTest::TearDown() { |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 | 405 |
406 // Uninstall command with --multi-install is multi install. | 406 // Uninstall command with --multi-install is multi install. |
407 { | 407 { |
408 ProductState state; | 408 ProductState state; |
409 ApplyUninstallCommand(L"setup.exe", | 409 ApplyUninstallCommand(L"setup.exe", |
410 L"--uninstall --chrome --multi-install"); | 410 L"--uninstall --chrome --multi-install"); |
411 EXPECT_TRUE(state.Initialize(system_install_, dist_)); | 411 EXPECT_TRUE(state.Initialize(system_install_, dist_)); |
412 EXPECT_TRUE(state.is_multi_install()); | 412 EXPECT_TRUE(state.is_multi_install()); |
413 } | 413 } |
414 } | 414 } |
OLD | NEW |