| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // Unit tests for master preferences related methods. | 5 // Unit tests for master preferences related methods. |
| 6 | 6 |
| 7 #include "chrome/installer/util/master_preferences.h" | 7 #include "chrome/installer/util/master_preferences.h" |
| 8 | 8 |
| 9 #include <stddef.h> | 9 #include <stddef.h> |
| 10 | 10 |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 } | 314 } |
| 315 | 315 |
| 316 TEST_F(MasterPreferencesTest, TestDefaultInstallConfig) { | 316 TEST_F(MasterPreferencesTest, TestDefaultInstallConfig) { |
| 317 std::wstringstream chrome_cmd; | 317 std::wstringstream chrome_cmd; |
| 318 chrome_cmd << "setup.exe"; | 318 chrome_cmd << "setup.exe"; |
| 319 | 319 |
| 320 base::CommandLine chrome_install( | 320 base::CommandLine chrome_install( |
| 321 base::CommandLine::FromString(chrome_cmd.str())); | 321 base::CommandLine::FromString(chrome_cmd.str())); |
| 322 | 322 |
| 323 installer::MasterPreferences pref_chrome(chrome_install); | 323 installer::MasterPreferences pref_chrome(chrome_install); |
| 324 | |
| 325 EXPECT_FALSE(pref_chrome.is_multi_install()); | |
| 326 } | |
| 327 | |
| 328 TEST_F(MasterPreferencesTest, TestMultiInstallIgnoredConfig) { | |
| 329 using installer::switches::kMultiInstall; | |
| 330 using installer::switches::kChrome; | |
| 331 | |
| 332 std::wstringstream chrome_cmd, cf_cmd, chrome_cf_cmd; | |
| 333 chrome_cmd << "setup.exe --" << kMultiInstall << " --" << kChrome; | |
| 334 | |
| 335 base::CommandLine chrome_install( | |
| 336 base::CommandLine::FromString(chrome_cmd.str())); | |
| 337 | |
| 338 installer::MasterPreferences pref_chrome(chrome_install); | |
| 339 | |
| 340 EXPECT_FALSE(pref_chrome.is_multi_install()); | |
| 341 } | 324 } |
| 342 | 325 |
| 343 TEST_F(MasterPreferencesTest, EnforceLegacyCreateAllShortcutsFalse) { | 326 TEST_F(MasterPreferencesTest, EnforceLegacyCreateAllShortcutsFalse) { |
| 344 static const char kCreateAllShortcutsFalsePrefs[] = | 327 static const char kCreateAllShortcutsFalsePrefs[] = |
| 345 "{" | 328 "{" |
| 346 " \"distribution\": {" | 329 " \"distribution\": {" |
| 347 " \"create_all_shortcuts\": false" | 330 " \"create_all_shortcuts\": false" |
| 348 " }" | 331 " }" |
| 349 "}"; | 332 "}"; |
| 350 | 333 |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 } | 434 } |
| 452 { | 435 { |
| 453 ScopedGoogleUpdateIsMachine env_setter("2"); | 436 ScopedGoogleUpdateIsMachine env_setter("2"); |
| 454 installer::MasterPreferences prefs( | 437 installer::MasterPreferences prefs( |
| 455 base::CommandLine(base::FilePath(FILE_PATH_LITERAL("setup.exe")))); | 438 base::CommandLine(base::FilePath(FILE_PATH_LITERAL("setup.exe")))); |
| 456 bool value = false; | 439 bool value = false; |
| 457 prefs.GetBool(installer::master_preferences::kSystemLevel, &value); | 440 prefs.GetBool(installer::master_preferences::kSystemLevel, &value); |
| 458 EXPECT_FALSE(value); | 441 EXPECT_FALSE(value); |
| 459 } | 442 } |
| 460 } | 443 } |
| OLD | NEW |