OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 | 7 |
8 #include <windows.h> | 8 #include <windows.h> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/string_util.h" |
12 | 13 |
13 // This class has methods to install and uninstall Chrome mini installer. | 14 // This class has methods to install and uninstall Chrome mini installer. |
14 class ChromeMiniInstaller { | 15 class ChromeMiniInstaller { |
15 public: | 16 public: |
16 explicit ChromeMiniInstaller(std::wstring install_type) { | 17 explicit ChromeMiniInstaller(const std::wstring& install_type); |
17 install_type_ = install_type; | |
18 } | |
19 | 18 |
20 ~ChromeMiniInstaller() {} | 19 ~ChromeMiniInstaller() {} |
21 | 20 |
22 enum RepairChrome { | 21 enum RepairChrome { |
23 REGISTRY, | 22 REGISTRY, |
24 VERSION_FOLDER | 23 VERSION_FOLDER |
25 }; | 24 }; |
26 | 25 |
27 // This method returns path to either program files | 26 // This method returns path to either program files |
28 // or documents and setting based on the install type. | 27 // or documents and setting based on the install type. |
29 std::wstring GetChromeInstallDirectoryLocation(); | 28 std::wstring GetChromeInstallDirectoryLocation(); |
30 | 29 |
31 // Installs the latest full installer. | 30 // Installs the latest full installer. |
32 void InstallFullInstaller(bool over_install, const wchar_t* channel_type); | 31 void InstallFullInstaller(bool over_install); |
33 | 32 |
34 // Installs chrome. | 33 // Installs chrome. |
35 void Install(); | 34 void Install(); |
36 | 35 |
37 // This method will first install the full installer and | 36 // This method will first install the full installer and |
38 // then over installs with diff installer. | 37 // then over installs with diff installer. |
39 void OverInstallOnFullInstaller(const std::wstring& install_type, | 38 void OverInstallOnFullInstaller(const std::wstring& install_type); |
40 const wchar_t* channel_type); | |
41 | 39 |
42 // Installs Google Chrome through meta installer. | 40 // Installs Google Chrome through meta installer. |
43 void InstallMetaInstaller(); | 41 void InstallMetaInstaller(); |
44 | 42 |
45 // Installs Chrome Mini Installer. | 43 // Installs Chrome Mini Installer. |
46 void InstallMiniInstaller(bool over_install = false, | 44 void InstallMiniInstaller(bool over_install = false, |
47 const std::wstring& path = L""); | 45 const std::wstring& path = L""); |
48 | 46 |
49 // This will test the standalone installer. | 47 // This will test the standalone installer. |
50 void InstallStandaloneInstaller(); | 48 void InstallStandaloneInstaller(); |
51 | 49 |
52 // Repairs Chrome based on the passed argument. | 50 // Repairs Chrome based on the passed argument. |
53 void Repair(RepairChrome repair_type, const wchar_t* channel_type); | 51 void Repair(RepairChrome repair_type); |
54 | 52 |
55 // Uninstalls Chrome. | 53 // Uninstalls Chrome. |
56 void UnInstall(); | 54 void UnInstall(); |
57 | 55 |
58 // This method will perform a over install | 56 // This method will perform a over install |
59 void OverInstall(const wchar_t* channel_type); | 57 void OverInstall(); |
| 58 |
| 59 void SetBuildUnderTest(const std::wstring& build); |
60 | 60 |
61 private: | 61 private: |
62 // This variable holds the install type. | 62 // This variable holds the install type. |
63 // Install type can be either system or user level. | 63 // Install type can be either system or user level. |
64 std::wstring install_type_; | 64 std::wstring install_type_; |
65 | 65 |
66 bool standalone_installer; | 66 bool standalone_installer; |
67 | 67 |
| 68 // Name of the browser (Chrome or Chromium) and install type (sys or user) |
| 69 std::wstring installer_name_; |
| 70 |
| 71 // The full path to the various installers. |
| 72 std::wstring full_installer_, diff_installer_, prev_installer_; |
| 73 |
| 74 // Whether the path to the associated installer could be found. |
| 75 // This is because we do not want to assert that these paths exist |
| 76 // except in the tests that use them. |
| 77 bool has_full_installer_, has_diff_installer_, has_prev_installer_; |
| 78 |
| 79 // The version string of the current and previous builds. |
| 80 std::wstring curr_version_, prev_version_; |
| 81 |
68 // Will clean up the machine if Chrome install is messed up. | 82 // Will clean up the machine if Chrome install is messed up. |
69 void CleanChromeInstall(); | 83 void CleanChromeInstall(); |
70 | 84 |
71 // Closes First Run UI dialog. | 85 // Closes First Run UI dialog. |
72 void CloseFirstRunUIDialog(bool over_install); | 86 void CloseFirstRunUIDialog(bool over_install); |
73 | 87 |
74 // Closes Chrome uninstall confirm dialog window. | 88 // Closes Chrome uninstall confirm dialog window. |
75 bool CloseUninstallWindow(); | 89 bool CloseUninstallWindow(); |
76 | 90 |
77 // Closes Chrome browser. | 91 // Closes Chrome browser. |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 void LaunchInstaller(const std::wstring& install_path, | 131 void LaunchInstaller(const std::wstring& install_path, |
118 const wchar_t* process_name); | 132 const wchar_t* process_name); |
119 | 133 |
120 // Verifies if Chrome launches after install. | 134 // Verifies if Chrome launches after install. |
121 void LaunchAndCloseChrome(bool over_install); | 135 void LaunchAndCloseChrome(bool over_install); |
122 | 136 |
123 // Compares the registry key values after overinstall. | 137 // Compares the registry key values after overinstall. |
124 bool VerifyOverInstall(const std::wstring& reg_key_value_before_overinstall, | 138 bool VerifyOverInstall(const std::wstring& reg_key_value_before_overinstall, |
125 const std::wstring& reg_key_value_after_overinstall); | 139 const std::wstring& reg_key_value_after_overinstall); |
126 | 140 |
127 // Checks if the differential install is correct. | |
128 bool VerifyDifferentialInstall(const std::wstring& full_installer_value, | |
129 const std::wstring& diff_installer_value, | |
130 const std::wstring& diff_installer_name, | |
131 const wchar_t* channel_type); | |
132 | |
133 // This method will verify if the installed build is correct. | 141 // This method will verify if the installed build is correct. |
134 bool VerifyStandaloneInstall(); | 142 bool VerifyStandaloneInstall(); |
135 | 143 |
136 DISALLOW_COPY_AND_ASSIGN(ChromeMiniInstaller); | 144 DISALLOW_COPY_AND_ASSIGN(ChromeMiniInstaller); |
137 }; | 145 }; |
138 | 146 |
139 #endif // CHROME_TEST_MINI_INSTALLER_TEST_CHROME_MINI_INSTALLER_H__ | 147 #endif // CHROME_TEST_MINI_INSTALLER_TEST_CHROME_MINI_INSTALLER_H_ |
| 148 |
OLD | NEW |