Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(155)

Side by Side Diff: chrome/installer/util/google_update_settings_unittest.cc

Issue 8344004: base/win: Add documentation to RegKey::Read/Write functions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix indentation Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 429 matching lines...) Expand 10 before | Expand all | Expand 10 after
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, chrome, 444 EXPECT_TRUE(GoogleUpdateSettings::SetEULAConsent(machine_state, chrome,
445 true)); 445 true));
446 EXPECT_EQ(ERROR_SUCCESS, 446 EXPECT_EQ(ERROR_SUCCESS,
447 key.Open(HKEY_LOCAL_MACHINE, binaries->GetStateMediumKey().c_str(), 447 key.Open(HKEY_LOCAL_MACHINE, binaries->GetStateMediumKey().c_str(),
448 KEY_QUERY_VALUE)); 448 KEY_QUERY_VALUE));
449 EXPECT_EQ(ERROR_SUCCESS, 449 EXPECT_EQ(ERROR_SUCCESS,
450 key.ReadValueDW(google_update::kRegEULAAceptedField, &value)); 450 key.ReadValue(google_update::kRegEULAAceptedField, &value));
451 EXPECT_EQ(1U, value); 451 EXPECT_EQ(1U, value);
452 EXPECT_EQ(ERROR_SUCCESS, 452 EXPECT_EQ(ERROR_SUCCESS,
453 key.Open(HKEY_LOCAL_MACHINE, chrome->GetStateMediumKey().c_str(), 453 key.Open(HKEY_LOCAL_MACHINE, chrome->GetStateMediumKey().c_str(),
454 KEY_QUERY_VALUE)); 454 KEY_QUERY_VALUE));
455 EXPECT_EQ(ERROR_SUCCESS, 455 EXPECT_EQ(ERROR_SUCCESS,
456 key.ReadValueDW(google_update::kRegEULAAceptedField, &value)); 456 key.ReadValue(google_update::kRegEULAAceptedField, &value));
457 EXPECT_EQ(1U, value); 457 EXPECT_EQ(1U, value);
458 } 458 }
459 459
460 // Test that the appropriate default is returned if no update override is 460 // Test that the appropriate default is returned if no update override is
461 // present. 461 // present.
462 TEST_F(GoogleUpdateSettingsTest, GetAppUpdatePolicyNoOverride) { 462 TEST_F(GoogleUpdateSettingsTest, GetAppUpdatePolicyNoOverride) {
463 // There are no policies at all. 463 // There are no policies at all.
464 EXPECT_EQ(ERROR_FILE_NOT_FOUND, 464 EXPECT_EQ(ERROR_FILE_NOT_FOUND,
465 RegKey().Open(HKEY_LOCAL_MACHINE, kGoogleUpdatePoliciesKey, 465 RegKey().Open(HKEY_LOCAL_MACHINE, kGoogleUpdatePoliciesKey,
466 KEY_QUERY_VALUE)); 466 KEY_QUERY_VALUE));
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 KEY_SET_VALUE).WriteValue(app_policy_value.c_str(), 580 KEY_SET_VALUE).WriteValue(app_policy_value.c_str(),
581 static_cast<DWORD>(3))); 581 static_cast<DWORD>(3)));
582 is_overridden = true; 582 is_overridden = true;
583 EXPECT_EQ(GoogleUpdateSettings::UPDATES_DISABLED, 583 EXPECT_EQ(GoogleUpdateSettings::UPDATES_DISABLED,
584 GoogleUpdateSettings::GetAppUpdatePolicy(kTestProductGuid, 584 GoogleUpdateSettings::GetAppUpdatePolicy(kTestProductGuid,
585 &is_overridden)); 585 &is_overridden));
586 EXPECT_FALSE(is_overridden); 586 EXPECT_FALSE(is_overridden);
587 } 587 }
588 588
589 #endif // defined(GOOGLE_CHROME_BUILD) 589 #endif // defined(GOOGLE_CHROME_BUILD)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698