summaryrefslogtreecommitdiffstats
path: root/chrome/common/win_safe_util.cc
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-01 22:24:50 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-01 22:24:50 +0000
commit9efd3d3fc0ada0acf27550cacb06885b466432f7 (patch)
treed4d07aebbb5fecd6563760cc41defab33da2b396 /chrome/common/win_safe_util.cc
parentdc1ce7854fa8d73c7683eff94cf714e698a38a8e (diff)
downloadchromium_src-9efd3d3fc0ada0acf27550cacb06885b466432f7.zip
chromium_src-9efd3d3fc0ada0acf27550cacb06885b466432f7.tar.gz
chromium_src-9efd3d3fc0ada0acf27550cacb06885b466432f7.tar.bz2
Attempt to make DownloadTest UI test less flaky.
It often fails in the assertion which verify the contents of the Internet Zone Identifier ADS. Flushing it doesn't solve the problem entirely due to Windows file semantics (only using the exactly same handle would be a 100% fix), but it is simple and should have a high effect-to-effort ratio. Review URL: http://codereview.chromium.org/177057 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25095 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/win_safe_util.cc')
-rw-r--r--chrome/common/win_safe_util.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/chrome/common/win_safe_util.cc b/chrome/common/win_safe_util.cc
index 8afe8c5..53cc9b2 100644
--- a/chrome/common/win_safe_util.cc
+++ b/chrome/common/win_safe_util.cc
@@ -106,10 +106,11 @@ bool SetInternetZoneIdentifier(const FilePath& full_path) {
DWORD written = 0;
BOOL result = WriteFile(file, kIdentifier, arraysize(kIdentifier), &written,
NULL);
+ BOOL flush_result = FlushFileBuffers(file);
CloseHandle(file);
- if (!result || written != arraysize(kIdentifier)) {
- DCHECK(FALSE);
+ if (!result || !flush_result || written != arraysize(kIdentifier)) {
+ NOTREACHED();
return false;
}