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

Unified Diff: chrome/installer/test/alternate_version_generator.cc

Issue 7866043: Prevent redirector from returning the current module in cases where it fails to look up the first... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome_frame/dll_redirector.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/test/alternate_version_generator.cc
===================================================================
--- chrome/installer/test/alternate_version_generator.cc (revision 100136)
+++ chrome/installer/test/alternate_version_generator.cc (working copy)
@@ -90,6 +90,7 @@
DCHECK(!directory_.empty());
return directory_;
}
+
private:
FilePath directory_;
DISALLOW_COPY_AND_ASSIGN(ScopedTempDirectory);
@@ -336,7 +337,22 @@
(base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_READ |
base::PLATFORM_FILE_WRITE | base::PLATFORM_FILE_EXCLUSIVE_READ |
base::PLATFORM_FILE_EXCLUSIVE_WRITE), NULL, NULL));
- if (image_handle.Get() != INVALID_HANDLE_VALUE) {
+ // It turns out that the underlying CreateFile can fail due to unhelpful
+ // security software locking the newly created DLL. So add a few brief
+ // retries to help tests that use this pass on machines thusly encumbered.
+ int retries = 3;
+ while (!image_handle.IsValid() && retries-- > 0) {
+ LOG(WARNING) << "Failed to open \"" << image_file.value() << "\"."
+ << " Retrying " << retries << " more times.";
+ Sleep(1000);
+ image_handle.Set(base::CreatePlatformFile(
+ image_file,
+ (base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_READ |
+ base::PLATFORM_FILE_WRITE | base::PLATFORM_FILE_EXCLUSIVE_READ |
+ base::PLATFORM_FILE_EXCLUSIVE_WRITE), NULL, NULL));
+ }
+
+ if (image_handle.IsValid()) {
MappedFile image_mapping;
if (image_mapping.Initialize(image_handle)) {
base::win::PEImageAsData image(
« no previous file with comments | « no previous file | chrome_frame/dll_redirector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698