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 #include <windows.h> | 5 #include <windows.h> |
6 | 6 |
7 #include <fstream> | 7 #include <fstream> |
8 | 8 |
9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 ASSERT_TRUE(temp_handle != NULL); | 489 ASSERT_TRUE(temp_handle != NULL); |
490 | 490 |
491 // The file should now be in use. | 491 // The file should now be in use. |
492 EXPECT_TRUE(MockInstallerState::IsFileInUse(temp_file)); | 492 EXPECT_TRUE(MockInstallerState::IsFileInUse(temp_file)); |
493 } | 493 } |
494 | 494 |
495 // And once the handle is gone, it should no longer be in use. | 495 // And once the handle is gone, it should no longer be in use. |
496 EXPECT_FALSE(MockInstallerState::IsFileInUse(temp_file)); | 496 EXPECT_FALSE(MockInstallerState::IsFileInUse(temp_file)); |
497 } | 497 } |
498 | 498 |
499 TEST_F(InstallerStateTest, RemoveOldVersionDirs) { | 499 // TODO(jschuh): crbug.com/167707 need to fix Win64 pe_image issues due to |
| 500 // calling upgrade_test::GenerateSpecificPEFileVersion |
| 501 #if defined(OS_WIN) && defined(ARCH_CPU_X86_64) |
| 502 #define MAYBE_RemoveOldVersionDirs DISABLED_RemoveOldVersionDirs |
| 503 #else |
| 504 #define MAYBE_RemoveOldVersionDirs RemoveOldVersionDirs |
| 505 #endif |
| 506 |
| 507 TEST_F(InstallerStateTest, MAYBE_RemoveOldVersionDirs) { |
500 MockInstallerState installer_state; | 508 MockInstallerState installer_state; |
501 installer_state.set_target_path(test_dir_.path()); | 509 installer_state.set_target_path(test_dir_.path()); |
502 EXPECT_EQ(test_dir_.path().value(), installer_state.target_path().value()); | 510 EXPECT_EQ(test_dir_.path().value(), installer_state.target_path().value()); |
503 | 511 |
504 const char kOldVersion[] = "2.0.0.0"; | 512 const char kOldVersion[] = "2.0.0.0"; |
505 const char kNewVersion[] = "3.0.0.0"; | 513 const char kNewVersion[] = "3.0.0.0"; |
506 const char kOldChromeExeVersion[] = "2.1.0.0"; | 514 const char kOldChromeExeVersion[] = "2.1.0.0"; |
507 const char kChromeExeVersion[] = "2.1.1.1"; | 515 const char kChromeExeVersion[] = "2.1.1.1"; |
508 const char kNewChromeExeVersion[] = "3.0.0.0"; | 516 const char kNewChromeExeVersion[] = "3.0.0.0"; |
509 | 517 |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
748 // Critical update newer than the new version. | 756 // Critical update newer than the new version. |
749 EXPECT_FALSE( | 757 EXPECT_FALSE( |
750 installer_state.DetermineCriticalVersion(NULL, *pv_version_).IsValid()); | 758 installer_state.DetermineCriticalVersion(NULL, *pv_version_).IsValid()); |
751 EXPECT_FALSE( | 759 EXPECT_FALSE( |
752 installer_state.DetermineCriticalVersion(opv_version_, *pv_version_) | 760 installer_state.DetermineCriticalVersion(opv_version_, *pv_version_) |
753 .IsValid()); | 761 .IsValid()); |
754 EXPECT_FALSE( | 762 EXPECT_FALSE( |
755 installer_state.DetermineCriticalVersion(pv_version_, *pv_version_) | 763 installer_state.DetermineCriticalVersion(pv_version_, *pv_version_) |
756 .IsValid()); | 764 .IsValid()); |
757 } | 765 } |
OLD | NEW |