OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/installer/mini_installer/configuration.h" | 5 #include "chrome/installer/mini_installer/configuration.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdlib.h> | 8 #include <stdlib.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 #else | 171 #else |
172 EXPECT_FALSE( | 172 EXPECT_FALSE( |
173 TestConfiguration(L"spam.exe --system-level").is_updating_multi_chrome()); | 173 TestConfiguration(L"spam.exe --system-level").is_updating_multi_chrome()); |
174 #endif | 174 #endif |
175 } | 175 } |
176 | 176 |
177 #if defined(GOOGLE_CHROME_BUILD) | 177 #if defined(GOOGLE_CHROME_BUILD) |
178 TEST_F(MiniInstallerConfigurationTest, ChromeAppGuid) { | 178 TEST_F(MiniInstallerConfigurationTest, ChromeAppGuid) { |
179 EXPECT_STREQ(google_update::kAppGuid, | 179 EXPECT_STREQ(google_update::kAppGuid, |
180 TestConfiguration(L"spam.exe").chrome_app_guid()); | 180 TestConfiguration(L"spam.exe").chrome_app_guid()); |
| 181 EXPECT_STREQ(google_update::kBetaAppGuid, |
| 182 TestConfiguration(L"spam.exe --chrome-beta").chrome_app_guid()); |
| 183 EXPECT_STREQ(google_update::kDevAppGuid, |
| 184 TestConfiguration(L"spam.exe --chrome-dev").chrome_app_guid()); |
181 EXPECT_STREQ(google_update::kSxSAppGuid, | 185 EXPECT_STREQ(google_update::kSxSAppGuid, |
182 TestConfiguration(L"spam.exe --chrome-sxs").chrome_app_guid()); | 186 TestConfiguration(L"spam.exe --chrome-sxs").chrome_app_guid()); |
183 } | 187 } |
184 #endif | 188 #endif |
185 | 189 |
186 TEST_F(MiniInstallerConfigurationTest, IsSystemLevel) { | 190 TEST_F(MiniInstallerConfigurationTest, IsSystemLevel) { |
187 EXPECT_FALSE(TestConfiguration(L"spam.exe").is_system_level()); | 191 EXPECT_FALSE(TestConfiguration(L"spam.exe").is_system_level()); |
188 EXPECT_FALSE(TestConfiguration(L"spam.exe --chrome").is_system_level()); | 192 EXPECT_FALSE(TestConfiguration(L"spam.exe --chrome").is_system_level()); |
189 EXPECT_TRUE(TestConfiguration(L"spam.exe --system-level").is_system_level()); | 193 EXPECT_TRUE(TestConfiguration(L"spam.exe --system-level").is_system_level()); |
190 | 194 |
191 { | 195 { |
192 ScopedGoogleUpdateIsMachine env_setter(false); | 196 ScopedGoogleUpdateIsMachine env_setter(false); |
193 EXPECT_FALSE(TestConfiguration(L"spam.exe").is_system_level()); | 197 EXPECT_FALSE(TestConfiguration(L"spam.exe").is_system_level()); |
194 } | 198 } |
195 | 199 |
196 { | 200 { |
197 ScopedGoogleUpdateIsMachine env_setter(true); | 201 ScopedGoogleUpdateIsMachine env_setter(true); |
198 EXPECT_TRUE(TestConfiguration(L"spam.exe").is_system_level()); | 202 EXPECT_TRUE(TestConfiguration(L"spam.exe").is_system_level()); |
199 } | 203 } |
200 } | 204 } |
201 | 205 |
202 TEST_F(MiniInstallerConfigurationTest, HasInvalidSwitch) { | 206 TEST_F(MiniInstallerConfigurationTest, HasInvalidSwitch) { |
203 EXPECT_FALSE(TestConfiguration(L"spam.exe").has_invalid_switch()); | 207 EXPECT_FALSE(TestConfiguration(L"spam.exe").has_invalid_switch()); |
204 EXPECT_TRUE(TestConfiguration(L"spam.exe --chrome-frame") | 208 EXPECT_TRUE(TestConfiguration(L"spam.exe --chrome-frame") |
205 .has_invalid_switch()); | 209 .has_invalid_switch()); |
206 } | 210 } |
207 | 211 |
208 } // namespace mini_installer | 212 } // namespace mini_installer |
OLD | NEW |