| Index: chrome/test/mini_installer_test/chrome_mini_installer.cc
|
| ===================================================================
|
| --- chrome/test/mini_installer_test/chrome_mini_installer.cc (revision 70917)
|
| +++ chrome/test/mini_installer_test/chrome_mini_installer.cc (working copy)
|
| @@ -365,8 +365,9 @@
|
| // Checks for Chrome registry keys.
|
| bool ChromeMiniInstaller::CheckRegistryKey(const std::wstring& key_path) {
|
| RegKey key;
|
| - if (!key.Open(GetRootRegistryKey(), key_path.c_str(), KEY_ALL_ACCESS)) {
|
| - printf("Cannot open reg key\n");
|
| + LONG ret = key.Open(GetRootRegistryKey(), key_path.c_str(), KEY_ALL_ACCESS);
|
| + if (ret != ERROR_SUCCESS) {
|
| + printf("Cannot open reg key. error: %d\n", ret);
|
| return false;
|
| }
|
| std::wstring reg_key_value_returned;
|
| @@ -380,7 +381,8 @@
|
| const std::wstring& key_path) {
|
| RegKey key;
|
| int timer = 0;
|
| - while ((key.Open(GetRootRegistryKey(), key_path.c_str(), KEY_ALL_ACCESS)) &&
|
| + while ((key.Open(GetRootRegistryKey(), key_path.c_str(),
|
| + KEY_ALL_ACCESS) == ERROR_SUCCESS) &&
|
| (timer < 20000)) {
|
| base::PlatformThread::Sleep(200);
|
| timer = timer + 200;
|
| @@ -444,8 +446,9 @@
|
| pv_key.append(dist->GetAppGuid());
|
|
|
| RegKey key;
|
| - if (key.Open(GetRootRegistryKey(), pv_key.c_str(), KEY_ALL_ACCESS))
|
| - ASSERT_TRUE(key.DeleteValue(L"pv"));
|
| + LONG ret = key.Open(GetRootRegistryKey(), pv_key.c_str(), KEY_ALL_ACCESS);
|
| + if (ret == ERROR_SUCCESS)
|
| + ASSERT_EQ(ERROR_SUCCESS, key.DeleteValue(L"pv"));
|
| printf("Deleted %ls key\n", pv_key.c_str());
|
| }
|
|
|
| @@ -523,8 +526,9 @@
|
| std::wstring* build_key_value) {
|
| BrowserDistribution* dist = BrowserDistribution::GetDistribution();
|
| RegKey key(GetRootRegistryKey(), dist->GetVersionKey().c_str(), KEY_READ);
|
| - if (!key.ReadValue(L"pv", build_key_value)) {
|
| - printf("registry key not found\n");
|
| + LONG result = key.ReadValue(L"pv", build_key_value);
|
| + if (result != ERROR_SUCCESS) {
|
| + printf("registry read for chrome version failed. error: %d\n", result);
|
| return false;
|
| }
|
| printf("Build key value is %ls\n\n", build_key_value->c_str());
|
|
|