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

Side by Side Diff: chrome/test/mini_installer_test/chrome_mini_installer.cc

Issue 3172009: Cleanup Registry API: part 3. (Closed) Base URL: git://git.chromium.org/chromium.git
Patch Set: chrome fixes Created 10 years, 4 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
« no previous file with comments | « chrome/installer/util/shell_util.cc ('k') | chrome_frame/test/chrome_frame_test_utils.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "chrome/test/mini_installer_test/chrome_mini_installer.h" 5 #include "chrome/test/mini_installer_test/chrome_mini_installer.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "base/platform_thread.h" 9 #include "base/platform_thread.h"
10 #include "base/process_util.h" 10 #include "base/process_util.h"
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 return L""; 499 return L"";
500 } 500 }
501 printf("uninstall path is %ls\n", path.c_str()); 501 printf("uninstall path is %ls\n", path.c_str());
502 return path; 502 return path;
503 } 503 }
504 504
505 // Returns Chrome pv registry key value 505 // Returns Chrome pv registry key value
506 bool ChromeMiniInstaller::GetChromeVersionFromRegistry( 506 bool ChromeMiniInstaller::GetChromeVersionFromRegistry(
507 std::wstring* build_key_value) { 507 std::wstring* build_key_value) {
508 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); 508 BrowserDistribution* dist = BrowserDistribution::GetDistribution();
509 RegKey key(GetRootRegistryKey(), dist->GetVersionKey().c_str()); 509 RegKey key(GetRootRegistryKey(), dist->GetVersionKey().c_str(), KEY_READ);
510 if (!key.ReadValue(L"pv", build_key_value)) { 510 if (!key.ReadValue(L"pv", build_key_value)) {
511 printf("registry key not found\n"); 511 printf("registry key not found\n");
512 return false; 512 return false;
513 } 513 }
514 printf("Build key value is %ls\n\n", build_key_value->c_str()); 514 printf("Build key value is %ls\n\n", build_key_value->c_str());
515 return true; 515 return true;
516 } 516 }
517 517
518 // Get HKEY based on install type. 518 // Get HKEY based on install type.
519 HKEY ChromeMiniInstaller::GetRootRegistryKey() { 519 HKEY ChromeMiniInstaller::GetRootRegistryKey() {
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
653 // This method will verify if the installed build is correct. 653 // This method will verify if the installed build is correct.
654 bool ChromeMiniInstaller::VerifyStandaloneInstall() { 654 bool ChromeMiniInstaller::VerifyStandaloneInstall() {
655 std::wstring reg_key_value_returned, standalone_installer_version; 655 std::wstring reg_key_value_returned, standalone_installer_version;
656 MiniInstallerTestUtil::GetStandaloneVersion(&standalone_installer_version); 656 MiniInstallerTestUtil::GetStandaloneVersion(&standalone_installer_version);
657 GetChromeVersionFromRegistry(&reg_key_value_returned); 657 GetChromeVersionFromRegistry(&reg_key_value_returned);
658 if (standalone_installer_version.compare(reg_key_value_returned) == 0) 658 if (standalone_installer_version.compare(reg_key_value_returned) == 0)
659 return true; 659 return true;
660 else 660 else
661 return false; 661 return false;
662 } 662 }
OLDNEW
« no previous file with comments | « chrome/installer/util/shell_util.cc ('k') | chrome_frame/test/chrome_frame_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698