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

Unified Diff: chrome_frame/test/policy_settings_unittest.cc

Issue 6090006: Regkey functions return error code instead of bool (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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_frame/test/policy_settings_unittest.cc
===================================================================
--- chrome_frame/test/policy_settings_unittest.cc (revision 71561)
+++ chrome_frame/test/policy_settings_unittest.cc (working copy)
@@ -23,7 +23,8 @@
// A best effort way to zap CF policy entries that may be in the registry.
void DeleteChromeFramePolicyEntries(HKEY root) {
RegKey key;
- if (key.Open(root, policy::kRegistrySubKey, KEY_ALL_ACCESS)) {
+ if (key.Open(root, policy::kRegistrySubKey,
+ KEY_ALL_ACCESS) == ERROR_SUCCESS) {
key.DeleteValue(
ASCIIToWide(policy::key::kChromeFrameRendererSettings).c_str());
key.DeleteKey(ASCIIToWide(policy::key::kRenderInChromeFrameList).c_str());
@@ -34,8 +35,8 @@
}
bool InitializePolicyKey(HKEY policy_root, RegKey* policy_key) {
- EXPECT_TRUE(policy_key->Create(policy_root, policy::kRegistrySubKey,
- KEY_ALL_ACCESS));
+ EXPECT_EQ(ERROR_SUCCESS, policy_key->Create(policy_root,
+ policy::kRegistrySubKey, KEY_ALL_ACCESS));
return policy_key->Valid();
}
@@ -46,10 +47,11 @@
policy_key->DeleteKey(list_name);
RegKey list_key;
- EXPECT_TRUE(list_key.Create(policy_key->Handle(), list_name, KEY_ALL_ACCESS));
+ EXPECT_EQ(ERROR_SUCCESS, list_key.Create(policy_key->Handle(), list_name,
+ KEY_ALL_ACCESS));
for (int i = 0; i < count; ++i) {
- EXPECT_TRUE(list_key.WriteValue(base::StringPrintf(L"%i", i).c_str(),
- values[i]));
+ EXPECT_EQ(ERROR_SUCCESS,
+ list_key.WriteValue(base::StringPrintf(L"%i", i).c_str(), values[i]));
}
}
@@ -94,7 +96,8 @@
std::wstring application_locale_value(
ASCIIToWide(policy::key::kApplicationLocaleValue));
- EXPECT_TRUE(policy_key.WriteValue(application_locale_value.c_str(), locale));
+ EXPECT_EQ(ERROR_SUCCESS,
+ policy_key.WriteValue(application_locale_value.c_str(), locale));
return true;
}

Powered by Google App Engine
This is Rietveld 408576698