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 #include <shlwapi.h> // For SHDeleteKey. | 6 #include <shlwapi.h> // For SHDeleteKey. |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/win/registry.h" | 9 #include "base/win/registry.h" |
10 #include "chrome/common/chrome_constants.h" | 10 #include "chrome/common/chrome_constants.h" |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 RegKey key; | 434 RegKey key; |
435 DWORD value; | 435 DWORD value; |
436 BrowserDistribution* binaries = | 436 BrowserDistribution* binaries = |
437 BrowserDistribution::GetSpecificDistribution( | 437 BrowserDistribution::GetSpecificDistribution( |
438 BrowserDistribution::CHROME_BINARIES); | 438 BrowserDistribution::CHROME_BINARIES); |
439 BrowserDistribution* chrome = | 439 BrowserDistribution* chrome = |
440 BrowserDistribution::GetSpecificDistribution( | 440 BrowserDistribution::GetSpecificDistribution( |
441 BrowserDistribution::CHROME_BROWSER); | 441 BrowserDistribution::CHROME_BROWSER); |
442 | 442 |
443 // eulaconsent is set on both the product and the binaries. | 443 // eulaconsent is set on both the product and the binaries. |
444 EXPECT_TRUE(GoogleUpdateSettings::SetEULAConsent(machine_state, true)); | 444 EXPECT_TRUE(GoogleUpdateSettings::SetEULAConsent(machine_state, chrome, |
| 445 true)); |
445 EXPECT_EQ(ERROR_SUCCESS, | 446 EXPECT_EQ(ERROR_SUCCESS, |
446 key.Open(HKEY_LOCAL_MACHINE, binaries->GetStateMediumKey().c_str(), | 447 key.Open(HKEY_LOCAL_MACHINE, binaries->GetStateMediumKey().c_str(), |
447 KEY_QUERY_VALUE)); | 448 KEY_QUERY_VALUE)); |
448 EXPECT_EQ(ERROR_SUCCESS, | 449 EXPECT_EQ(ERROR_SUCCESS, |
449 key.ReadValueDW(google_update::kRegEULAAceptedField, &value)); | 450 key.ReadValueDW(google_update::kRegEULAAceptedField, &value)); |
450 EXPECT_EQ(1U, value); | 451 EXPECT_EQ(1U, value); |
451 EXPECT_EQ(ERROR_SUCCESS, | 452 EXPECT_EQ(ERROR_SUCCESS, |
452 key.Open(HKEY_LOCAL_MACHINE, chrome->GetStateMediumKey().c_str(), | 453 key.Open(HKEY_LOCAL_MACHINE, chrome->GetStateMediumKey().c_str(), |
453 KEY_QUERY_VALUE)); | 454 KEY_QUERY_VALUE)); |
454 EXPECT_EQ(ERROR_SUCCESS, | 455 EXPECT_EQ(ERROR_SUCCESS, |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
579 KEY_SET_VALUE).WriteValue(app_policy_value.c_str(), | 580 KEY_SET_VALUE).WriteValue(app_policy_value.c_str(), |
580 static_cast<DWORD>(3))); | 581 static_cast<DWORD>(3))); |
581 is_overridden = true; | 582 is_overridden = true; |
582 EXPECT_EQ(GoogleUpdateSettings::UPDATES_DISABLED, | 583 EXPECT_EQ(GoogleUpdateSettings::UPDATES_DISABLED, |
583 GoogleUpdateSettings::GetAppUpdatePolicy(kTestProductGuid, | 584 GoogleUpdateSettings::GetAppUpdatePolicy(kTestProductGuid, |
584 &is_overridden)); | 585 &is_overridden)); |
585 EXPECT_FALSE(is_overridden); | 586 EXPECT_FALSE(is_overridden); |
586 } | 587 } |
587 | 588 |
588 #endif // defined(GOOGLE_CHROME_BUILD) | 589 #endif // defined(GOOGLE_CHROME_BUILD) |
OLD | NEW |