OLD | NEW |
1 // Copyright (c) 2009 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 #ifndef CHROME_TEST_MINI_INSTALLER_TEST_CHROME_MINI_INSTALLER_H_ | 5 #ifndef CHROME_TEST_MINI_INSTALLER_TEST_CHROME_MINI_INSTALLER_H_ |
6 #define CHROME_TEST_MINI_INSTALLER_TEST_CHROME_MINI_INSTALLER_H_ | 6 #define CHROME_TEST_MINI_INSTALLER_TEST_CHROME_MINI_INSTALLER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <windows.h> | 9 #include <windows.h> |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/string_util.h" | |
14 | 13 |
15 class FilePath; | 14 class FilePath; |
16 | 15 |
17 // This class has methods to install and uninstall Chrome mini installer. | 16 // This class has methods to install and uninstall Chrome mini installer. |
18 class ChromeMiniInstaller { | 17 class ChromeMiniInstaller { |
19 public: | 18 public: |
20 explicit ChromeMiniInstaller(const std::wstring& install_type, | 19 explicit ChromeMiniInstaller(const std::wstring& install_type, |
21 bool is_chrome_frame); | 20 bool is_chrome_frame); |
22 | 21 |
23 ~ChromeMiniInstaller() {} | 22 ~ChromeMiniInstaller() {} |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 | 55 |
57 // Uninstalls Chrome. | 56 // Uninstalls Chrome. |
58 void UnInstall(); | 57 void UnInstall(); |
59 | 58 |
60 // This method will perform a over install | 59 // This method will perform a over install |
61 void OverInstall(); | 60 void OverInstall(); |
62 | 61 |
63 void SetBuildUnderTest(const std::wstring& build); | 62 void SetBuildUnderTest(const std::wstring& build); |
64 | 63 |
65 private: | 64 private: |
66 // This variable holds the install type. | |
67 // Install type can be either system or user level. | |
68 std::wstring install_type_; | |
69 | |
70 bool standalone_installer; | |
71 | |
72 bool is_chrome_frame_; | |
73 | |
74 // Name of the browser (Chrome or Chromium) and install type (sys or user) | |
75 std::wstring installer_name_; | |
76 | |
77 // The full path to the various installers. | |
78 std::wstring full_installer_, diff_installer_, prev_installer_; | |
79 | |
80 // Whether the path to the associated installer could be found. | |
81 // This is because we do not want to assert that these paths exist | |
82 // except in the tests that use them. | |
83 bool has_full_installer_, has_diff_installer_, has_prev_installer_; | |
84 | |
85 // The version string of the current and previous builds. | |
86 std::wstring curr_version_, prev_version_; | |
87 | |
88 // Will clean up the machine if Chrome install is messed up. | 65 // Will clean up the machine if Chrome install is messed up. |
89 void CleanChromeInstall(); | 66 void CleanChromeInstall(); |
90 | 67 |
91 // Closes Chrome uninstall confirm dialog window. | 68 // Closes Chrome uninstall confirm dialog window. |
92 bool CloseUninstallWindow(); | 69 bool CloseUninstallWindow(); |
93 | 70 |
94 // Closes Chrome browser. | 71 // Closes Chrome browser. |
95 bool CloseChromeBrowser(); | 72 bool CloseChromeBrowser(); |
96 | 73 |
97 // Checks for registry key. | 74 // Checks for registry key. |
(...skipping 10 matching lines...) Expand all Loading... |
108 | 85 |
109 // This will delete pv key from client registry. | 86 // This will delete pv key from client registry. |
110 void DeletePvRegistryKey(); | 87 void DeletePvRegistryKey(); |
111 | 88 |
112 // This method verifies Chrome shortcut. | 89 // This method verifies Chrome shortcut. |
113 void FindChromeShortcut(); | 90 void FindChromeShortcut(); |
114 | 91 |
115 // Get HKEY based on install type. | 92 // Get HKEY based on install type. |
116 HKEY GetRootRegistryKey(); | 93 HKEY GetRootRegistryKey(); |
117 | 94 |
118 // Returns Chrome pv registry key value | 95 // Returns Chrome pv registry key value. |
119 bool GetChromeVersionFromRegistry(std::wstring *return_reg_key_value); | 96 bool GetChromeVersionFromRegistry(std::wstring* reg_key_value); |
120 | 97 |
121 // This method gets the shortcut path from start menu based on install type. | 98 // This method gets the shortcut path from start menu based on install type. |
122 std::wstring GetStartMenuShortcutPath(); | 99 FilePath GetStartMenuShortcutPath(); |
123 | 100 |
124 // Get path for uninstall. | 101 // Get path for uninstall. |
125 std::wstring GetUninstallPath(); | 102 std::wstring GetUninstallPath(); |
126 | 103 |
127 // Get user data directory path. | 104 // Get user data directory path. |
128 FilePath GetUserDataDirPath(); | 105 FilePath GetUserDataDirPath(); |
129 | 106 |
130 // Gets the path to launch Chrome. | 107 // Gets the path to launch Chrome. |
131 bool GetChromeLaunchPath(std::wstring* launch_path); | 108 bool GetChromeLaunchPath(std::wstring* launch_path); |
132 | 109 |
133 // This method will get Chrome.exe path and launch it. | 110 // This method will get Chrome.exe path and launch it. |
134 void VerifyChromeLaunch(bool expected_status); | 111 void VerifyChromeLaunch(bool expected_status); |
135 | 112 |
136 // This method verifies if Chrome/Chrome Frame installed correctly. | 113 // This method verifies if Chrome/Chrome Frame installed correctly. |
137 void VerifyInstall(bool over_install); | 114 void VerifyInstall(bool over_install); |
138 | 115 |
139 // This method will verify if ChromeFrame got successfully installed | 116 // This method will verify if ChromeFrame got successfully installed on the |
140 // on the machine. | 117 // machine. |
141 void VerifyChromeFrameInstall(); | 118 void VerifyChromeFrameInstall(); |
142 | 119 |
143 // Launches the chrome installer and waits for it to end. | 120 // Launches the chrome installer and waits for it to end. |
144 void LaunchInstaller(const std::wstring& install_path, | 121 void LaunchInstaller(const std::wstring& install_path, |
145 const wchar_t* process_name); | 122 const wchar_t* process_name); |
146 | 123 |
147 // Verifies if Chrome launches after install. | 124 // Verifies if Chrome launches after install. |
148 void LaunchAndCloseChrome(bool over_install); | 125 void LaunchAndCloseChrome(bool over_install); |
149 | 126 |
150 // Launches any requested browser. | 127 // Launches any requested browser. |
151 void LaunchBrowser(const std::wstring& launch_path, | 128 void LaunchBrowser(const std::wstring& launch_path, |
152 const std::wstring& launch_arg, | 129 const std::wstring& launch_arg, |
153 const std::wstring& process_name, | 130 const std::wstring& process_name, |
154 bool expected_status); | 131 bool expected_status); |
155 | 132 |
156 // Compares the registry key values after overinstall. | 133 // Compares the registry key values after overinstall. |
157 bool VerifyOverInstall(const std::wstring& reg_key_value_before_overinstall, | 134 bool VerifyOverInstall(const std::wstring& reg_key_value_before_overinstall, |
158 const std::wstring& reg_key_value_after_overinstall); | 135 const std::wstring& reg_key_value_after_overinstall); |
159 | 136 |
160 // This method will verify if the installed build is correct. | 137 // This method will verify if the installed build is correct. |
161 bool VerifyStandaloneInstall(); | 138 bool VerifyStandaloneInstall(); |
162 | 139 |
| 140 // This variable holds the install type. |
| 141 // Install type can be either system or user level. |
| 142 std::wstring install_type_; |
| 143 |
| 144 bool is_chrome_frame_; |
| 145 |
| 146 // Name of the browser (Chrome or Chromium) and install type (sys or user) |
| 147 std::wstring installer_name_; |
| 148 |
| 149 // The full path to the various installers. |
| 150 std::wstring full_installer_, diff_installer_, prev_installer_; |
| 151 |
| 152 // Whether the path to the associated installer could be found. |
| 153 // This is because we do not want to assert that these paths exist |
| 154 // except in the tests that use them. |
| 155 bool has_full_installer_, has_diff_installer_, has_prev_installer_; |
| 156 |
| 157 // The version string of the current and previous builds. |
| 158 std::wstring curr_version_, prev_version_; |
| 159 |
163 DISALLOW_COPY_AND_ASSIGN(ChromeMiniInstaller); | 160 DISALLOW_COPY_AND_ASSIGN(ChromeMiniInstaller); |
164 }; | 161 }; |
165 | 162 |
166 #endif // CHROME_TEST_MINI_INSTALLER_TEST_CHROME_MINI_INSTALLER_H_ | 163 #endif // CHROME_TEST_MINI_INSTALLER_TEST_CHROME_MINI_INSTALLER_H_ |
167 | |
OLD | NEW |