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 // TODO(jschuh): crbug.com/167707 need to fix Win64 pe_image issues due to | 499 TEST_F(InstallerStateTest, RemoveOldVersionDirs) { |
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) { | |
508 MockInstallerState installer_state; | 500 MockInstallerState installer_state; |
509 installer_state.set_target_path(test_dir_.path()); | 501 installer_state.set_target_path(test_dir_.path()); |
510 EXPECT_EQ(test_dir_.path().value(), installer_state.target_path().value()); | 502 EXPECT_EQ(test_dir_.path().value(), installer_state.target_path().value()); |
511 | 503 |
512 const char kOldVersion[] = "2.0.0.0"; | 504 const char kOldVersion[] = "2.0.0.0"; |
513 const char kNewVersion[] = "3.0.0.0"; | 505 const char kNewVersion[] = "3.0.0.0"; |
514 const char kOldChromeExeVersion[] = "2.1.0.0"; | 506 const char kOldChromeExeVersion[] = "2.1.0.0"; |
515 const char kChromeExeVersion[] = "2.1.1.1"; | 507 const char kChromeExeVersion[] = "2.1.1.1"; |
516 const char kNewChromeExeVersion[] = "3.0.0.0"; | 508 const char kNewChromeExeVersion[] = "3.0.0.0"; |
517 | 509 |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
756 // Critical update newer than the new version. | 748 // Critical update newer than the new version. |
757 EXPECT_FALSE( | 749 EXPECT_FALSE( |
758 installer_state.DetermineCriticalVersion(NULL, *pv_version_).IsValid()); | 750 installer_state.DetermineCriticalVersion(NULL, *pv_version_).IsValid()); |
759 EXPECT_FALSE( | 751 EXPECT_FALSE( |
760 installer_state.DetermineCriticalVersion(opv_version_, *pv_version_) | 752 installer_state.DetermineCriticalVersion(opv_version_, *pv_version_) |
761 .IsValid()); | 753 .IsValid()); |
762 EXPECT_FALSE( | 754 EXPECT_FALSE( |
763 installer_state.DetermineCriticalVersion(pv_version_, *pv_version_) | 755 installer_state.DetermineCriticalVersion(pv_version_, *pv_version_) |
764 .IsValid()); | 756 .IsValid()); |
765 } | 757 } |
OLD | NEW |