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 "chrome/installer/setup/setup_util_unittest.h" | 5 #include "chrome/installer/setup/setup_util_unittest.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 work_dir = work_dir.AppendASCII("ApplyDiffPatchTest"); | 100 work_dir = work_dir.AppendASCII("ApplyDiffPatchTest"); |
101 ASSERT_FALSE(base::PathExists(work_dir)); | 101 ASSERT_FALSE(base::PathExists(work_dir)); |
102 EXPECT_TRUE(file_util::CreateDirectory(work_dir)); | 102 EXPECT_TRUE(file_util::CreateDirectory(work_dir)); |
103 ASSERT_TRUE(base::PathExists(work_dir)); | 103 ASSERT_TRUE(base::PathExists(work_dir)); |
104 | 104 |
105 base::FilePath src = data_dir_.AppendASCII("archive1.7z"); | 105 base::FilePath src = data_dir_.AppendASCII("archive1.7z"); |
106 base::FilePath patch = data_dir_.AppendASCII("archive.diff"); | 106 base::FilePath patch = data_dir_.AppendASCII("archive.diff"); |
107 base::FilePath dest = work_dir.AppendASCII("archive2.7z"); | 107 base::FilePath dest = work_dir.AppendASCII("archive2.7z"); |
108 EXPECT_EQ(installer::ApplyDiffPatch(src, patch, dest, NULL), 0); | 108 EXPECT_EQ(installer::ApplyDiffPatch(src, patch, dest, NULL), 0); |
109 base::FilePath base = data_dir_.AppendASCII("archive2.7z"); | 109 base::FilePath base = data_dir_.AppendASCII("archive2.7z"); |
110 EXPECT_TRUE(file_util::ContentsEqual(dest, base)); | 110 EXPECT_TRUE(base::ContentsEqual(dest, base)); |
111 | 111 |
112 EXPECT_EQ(installer::ApplyDiffPatch(base::FilePath(), base::FilePath(), | 112 EXPECT_EQ(installer::ApplyDiffPatch(base::FilePath(), base::FilePath(), |
113 base::FilePath(), NULL), | 113 base::FilePath(), NULL), |
114 6); | 114 6); |
115 } | 115 } |
116 | 116 |
117 // Test that we are parsing Chrome version correctly. | 117 // Test that we are parsing Chrome version correctly. |
118 TEST_F(SetupUtilTestWithDir, GetMaxVersionFromArchiveDirTest) { | 118 TEST_F(SetupUtilTestWithDir, GetMaxVersionFromArchiveDirTest) { |
119 // Create a version dir | 119 // Create a version dir |
120 base::FilePath chrome_dir = test_dir_.path().AppendASCII("1.0.0.0"); | 120 base::FilePath chrome_dir = test_dir_.path().AppendASCII("1.0.0.0"); |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 // sufficiently recent operating systems. | 270 // sufficiently recent operating systems. |
271 TEST(SetupUtilTest, AdjustFromBelowNormalPriority) { | 271 TEST(SetupUtilTest, AdjustFromBelowNormalPriority) { |
272 scoped_ptr<ScopedPriorityClass> below_normal = | 272 scoped_ptr<ScopedPriorityClass> below_normal = |
273 ScopedPriorityClass::Create(BELOW_NORMAL_PRIORITY_CLASS); | 273 ScopedPriorityClass::Create(BELOW_NORMAL_PRIORITY_CLASS); |
274 ASSERT_TRUE(below_normal); | 274 ASSERT_TRUE(below_normal); |
275 if (base::win::GetVersion() > base::win::VERSION_SERVER_2003) | 275 if (base::win::GetVersion() > base::win::VERSION_SERVER_2003) |
276 EXPECT_EQ(PCCR_CHANGED, RelaunchAndDoProcessPriorityAdjustment()); | 276 EXPECT_EQ(PCCR_CHANGED, RelaunchAndDoProcessPriorityAdjustment()); |
277 else | 277 else |
278 EXPECT_EQ(PCCR_UNCHANGED, RelaunchAndDoProcessPriorityAdjustment()); | 278 EXPECT_EQ(PCCR_UNCHANGED, RelaunchAndDoProcessPriorityAdjustment()); |
279 } | 279 } |
OLD | NEW |