Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Side by Side Diff: chrome/installer/test/alternate_version_generator.cc

Issue 14105014: Fix disabled InstallerStateTest.RemoveOldVersionDirs on x64 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/installer/util/installer_state_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 // The file contains the implementation of the mini_installer re-versioner. 5 // The file contains the implementation of the mini_installer re-versioner.
6 // The main function (GenerateNextVersion) does the following in a temp dir: 6 // The main function (GenerateNextVersion) does the following in a temp dir:
7 // - Extracts and unpacks setup.exe and the Chrome-bin folder from 7 // - Extracts and unpacks setup.exe and the Chrome-bin folder from
8 // mini_installer.exe. 8 // mini_installer.exe.
9 // - Inspects setup.exe to determine the current version. 9 // - Inspects setup.exe to determine the current version.
10 // - Runs through all .dll and .exe files: 10 // - Runs through all .dll and .exe files:
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 } 172 }
173 } 173 }
174 174
175 bool MappedFile::Initialize(base::PlatformFile file) { 175 bool MappedFile::Initialize(base::PlatformFile file) {
176 DCHECK(mapping_ == NULL); 176 DCHECK(mapping_ == NULL);
177 bool result = false; 177 bool result = false;
178 base::PlatformFileInfo file_info; 178 base::PlatformFileInfo file_info;
179 179
180 if (base::GetPlatformFileInfo(file, &file_info)) { 180 if (base::GetPlatformFileInfo(file, &file_info)) {
181 if (file_info.size <= 181 if (file_info.size <=
182 static_cast<int64>(std::numeric_limits<size_t>::max())) { 182 static_cast<int64>(std::numeric_limits<DWORD>::max())) {
robertshield 2013/04/29 20:04:45 Really curious: how does this fix the test?
183 mapping_ = CreateFileMapping(file, NULL, PAGE_READWRITE, 0, 183 mapping_ = CreateFileMapping(file, NULL, PAGE_READWRITE, 0,
184 static_cast<DWORD>(file_info.size), NULL); 184 static_cast<DWORD>(file_info.size), NULL);
185 if (mapping_ != NULL) { 185 if (mapping_ != NULL) {
186 view_ = MapViewOfFile(mapping_, FILE_MAP_WRITE, 0, 0, 186 view_ = MapViewOfFile(mapping_, FILE_MAP_WRITE, 0, 0,
187 static_cast<size_t>(file_info.size)); 187 static_cast<size_t>(file_info.size));
188 if (view_ != NULL) { 188 if (view_ != NULL) {
189 result = true; 189 result = true;
190 } else { 190 } else {
191 PLOG(DFATAL) << "MapViewOfFile failed"; 191 PLOG(DFATAL) << "MapViewOfFile failed";
192 } 192 }
193 } else { 193 } else {
194 PLOG(DFATAL) << "CreateFileMapping failed"; 194 PLOG(DFATAL) << "CreateFileMapping failed";
195 } 195 }
196 } else { 196 } else {
197 LOG(DFATAL) << "Files larger than " << std::numeric_limits<size_t>::max() 197 LOG(DFATAL) << "Files larger than " << std::numeric_limits<DWORD>::max()
198 << " are not supported."; 198 << " are not supported.";
199 } 199 }
200 } else { 200 } else {
201 PLOG(DFATAL) << "GetPlatformFileInfo failed"; 201 PLOG(DFATAL) << "GetPlatformFileInfo failed";
202 } 202 }
203 return result; 203 return result;
204 } 204 }
205 205
206 // Calls CreateProcess with good default parameters and waits for the process 206 // Calls CreateProcess with good default parameters and waits for the process
207 // to terminate returning the process exit code. 207 // to terminate returning the process exit code.
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after
692 return false; 692 return false;
693 } 693 }
694 ctx.current_version_str = ctx.current_version.ToString(); 694 ctx.current_version_str = ctx.current_version.ToString();
695 ctx.new_version = ChromeVersion::FromString(version.GetString()); 695 ctx.new_version = ChromeVersion::FromString(version.GetString());
696 ctx.new_version_str = ctx.new_version.ToString(); 696 ctx.new_version_str = ctx.new_version.ToString();
697 697
698 return UpdateVersionIfMatch(target_file, &ctx); 698 return UpdateVersionIfMatch(target_file, &ctx);
699 } 699 }
700 700
701 } // namespace upgrade_test 701 } // namespace upgrade_test
OLDNEW
« no previous file with comments | « no previous file | chrome/installer/util/installer_state_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698