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

Side by Side Diff: chrome/installer/util/install_util_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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/installer/util/install_util.cc ('k') | chrome/installer/util/installation_state.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 <string> 5 #include <string>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/win/registry.h" 8 #include "base/win/registry.h"
9 #include "chrome/installer/util/browser_distribution.h" 9 #include "chrome/installer/util/browser_distribution.h"
10 #include "chrome/installer/util/installation_state.h" 10 #include "chrome/installer/util/installation_state.h"
(...skipping 27 matching lines...) Expand all
38 CommandLine::FromString(L"setup.exe --system-level")); 38 CommandLine::FromString(L"setup.exe --system-level"));
39 InstallationState machine_state; 39 InstallationState machine_state;
40 machine_state.Initialize(prefs); 40 machine_state.Initialize(prefs);
41 InstallerState state; 41 InstallerState state;
42 state.Initialize(prefs, machine_state); 42 state.Initialize(prefs, machine_state);
43 InstallUtil::WriteInstallerResult(system_level, state.state_key(), 43 InstallUtil::WriteInstallerResult(system_level, state.state_key(),
44 installer::FIRST_INSTALL_SUCCESS, 0, &launch_cmd); 44 installer::FIRST_INSTALL_SUCCESS, 0, &launch_cmd);
45 BrowserDistribution* distribution = 45 BrowserDistribution* distribution =
46 BrowserDistribution::GetSpecificDistribution( 46 BrowserDistribution::GetSpecificDistribution(
47 BrowserDistribution::CHROME_BROWSER, prefs); 47 BrowserDistribution::CHROME_BROWSER, prefs);
48 EXPECT_TRUE(key.Open(root, distribution->GetStateKey().c_str(), KEY_READ)); 48 EXPECT_EQ(ERROR_SUCCESS,
49 EXPECT_TRUE(key.ReadValue(installer::kInstallerSuccessLaunchCmdLine, 49 key.Open(root, distribution->GetStateKey().c_str(), KEY_READ));
50 &value)); 50 EXPECT_EQ(ERROR_SUCCESS,
51 key.ReadValue(installer::kInstallerSuccessLaunchCmdLine, &value));
51 EXPECT_EQ(launch_cmd, value); 52 EXPECT_EQ(launch_cmd, value);
52 } 53 }
53 TempRegKeyOverride::DeleteAllTempKeys(); 54 TempRegKeyOverride::DeleteAllTempKeys();
54 55
55 // check results for a fresh install of multi Chrome 56 // check results for a fresh install of multi Chrome
56 { 57 {
57 TempRegKeyOverride override(root, L"root_inst_res"); 58 TempRegKeyOverride override(root, L"root_inst_res");
58 const MasterPreferences prefs( 59 const MasterPreferences prefs(
59 CommandLine::FromString( 60 CommandLine::FromString(
60 L"setup.exe --system-level --multi-install --chrome")); 61 L"setup.exe --system-level --multi-install --chrome"));
61 InstallationState machine_state; 62 InstallationState machine_state;
62 machine_state.Initialize(prefs); 63 machine_state.Initialize(prefs);
63 InstallerState state; 64 InstallerState state;
64 state.Initialize(prefs, machine_state); 65 state.Initialize(prefs, machine_state);
65 InstallUtil::WriteInstallerResult(system_level, state.state_key(), 66 InstallUtil::WriteInstallerResult(system_level, state.state_key(),
66 installer::FIRST_INSTALL_SUCCESS, 0, &launch_cmd); 67 installer::FIRST_INSTALL_SUCCESS, 0, &launch_cmd);
67 BrowserDistribution* distribution = 68 BrowserDistribution* distribution =
68 BrowserDistribution::GetSpecificDistribution( 69 BrowserDistribution::GetSpecificDistribution(
69 BrowserDistribution::CHROME_BROWSER, prefs); 70 BrowserDistribution::CHROME_BROWSER, prefs);
70 EXPECT_TRUE(key.Open(root, distribution->GetStateKey().c_str(), KEY_READ)); 71 EXPECT_EQ(ERROR_SUCCESS,
71 EXPECT_TRUE(key.ReadValue(installer::kInstallerSuccessLaunchCmdLine, 72 key.Open(root, distribution->GetStateKey().c_str(), KEY_READ));
72 &value)); 73 EXPECT_EQ(ERROR_SUCCESS,
74 key.ReadValue(installer::kInstallerSuccessLaunchCmdLine, &value));
73 EXPECT_EQ(launch_cmd, value); 75 EXPECT_EQ(launch_cmd, value);
74 key.Close(); 76 key.Close();
75 } 77 }
76 TempRegKeyOverride::DeleteAllTempKeys(); 78 TempRegKeyOverride::DeleteAllTempKeys();
77 } 79 }
OLDNEW
« no previous file with comments | « chrome/installer/util/install_util.cc ('k') | chrome/installer/util/installation_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698