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

Unified Diff: chrome/installer/util/google_update_settings_unittest.cc

Issue 377683002: Fixes for re-enabling more MSVC level 4 warnings: chrome/ edition (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/installer/util/google_update_settings_unittest.cc
diff --git a/chrome/installer/util/google_update_settings_unittest.cc b/chrome/installer/util/google_update_settings_unittest.cc
index 776faa799bb4fdf3e07c47a1289231fe25e5c784..722f6d6b3730ec7a1c511ed2ca8898c753d4ab4b 100644
--- a/chrome/installer/util/google_update_settings_unittest.cc
+++ b/chrome/installer/util/google_update_settings_unittest.cc
@@ -246,7 +246,8 @@ class GoogleUpdateSettingsTest : public testing::Test {
return false;
}
- DWORD GetUpdatePolicyForAppGuid(const base::string16& app_guid) {
+ GoogleUpdateSettings::UpdatePolicy GetUpdatePolicyForAppGuid(
+ const base::string16& app_guid) {
RegKey policy_key;
if (policy_key.Create(HKEY_LOCAL_MACHINE,
GoogleUpdateSettings::kPoliciesKey,
@@ -255,13 +256,13 @@ class GoogleUpdateSettingsTest : public testing::Test {
GoogleUpdateSettings::kUpdateOverrideValuePrefix);
app_update_override.append(app_guid);
- DWORD value = -1;
+ DWORD value;
if (policy_key.ReadValueDW(app_update_override.c_str(),
&value) == ERROR_SUCCESS) {
- return value;
+ return static_cast<GoogleUpdateSettings::UpdatePolicy>(value);
}
}
- return -1;
+ return GoogleUpdateSettings::UPDATE_POLICIES_COUNT;
}
bool SetGlobalUpdatePolicy(GoogleUpdateSettings::UpdatePolicy policy) {
@@ -273,14 +274,16 @@ class GoogleUpdateSettingsTest : public testing::Test {
static_cast<DWORD>(policy)) == ERROR_SUCCESS;
}
- DWORD GetGlobalUpdatePolicy() {
+ GoogleUpdateSettings::UpdatePolicy GetGlobalUpdatePolicy() {
RegKey policy_key;
- DWORD value = -1;
+ DWORD value;
return (policy_key.Create(HKEY_LOCAL_MACHINE,
GoogleUpdateSettings::kPoliciesKey,
KEY_QUERY_VALUE) == ERROR_SUCCESS &&
policy_key.ReadValueDW(GoogleUpdateSettings::kUpdatePolicyValue,
- &value) == ERROR_SUCCESS) ? value : -1;
+ &value) == ERROR_SUCCESS) ?
+ static_cast<GoogleUpdateSettings::UpdatePolicy>(value) :
+ GoogleUpdateSettings::UPDATE_POLICIES_COUNT;
}
bool SetUpdateTimeoutOverride(DWORD time_in_minutes) {
@@ -791,10 +794,9 @@ TEST_F(GoogleUpdateSettingsTest, PerAppUpdatesEnabledWithGlobalDisabled) {
// Make sure that the reset action returns true and is a no-op.
EXPECT_TRUE(
GoogleUpdateSettings::ReenableAutoupdatesForApp(kTestProductGuid));
- EXPECT_EQ(static_cast<DWORD>(GoogleUpdateSettings::AUTOMATIC_UPDATES),
+ EXPECT_EQ(GoogleUpdateSettings::AUTOMATIC_UPDATES,
GetUpdatePolicyForAppGuid(kTestProductGuid));
- EXPECT_EQ(static_cast<DWORD>(GoogleUpdateSettings::UPDATES_DISABLED),
- GetGlobalUpdatePolicy());
+ EXPECT_EQ(GoogleUpdateSettings::UPDATES_DISABLED, GetGlobalUpdatePolicy());
}
TEST_F(GoogleUpdateSettingsTest, GlobalUpdatesDisabledByPolicy) {

Powered by Google App Engine
This is Rietveld 408576698