Commit ecc45062 authored by xeor's avatar xeor Committed by Commit bot

Fix for DiskCacheBackendTest.SimpleCacheOpenBadFile spurious failures

The test sometimes fails on windows, because entry file is not yet
closed when the test tries to write into it.

Review URL: https://codereview.chromium.org/783473002

Cr-Commit-Position: refs/heads/master@{#308085}
parent 8444156d
......@@ -6,6 +6,7 @@
#include "base/files/file_util.h"
#include "base/metrics/field_trial.h"
#include "base/port.h"
#include "base/run_loop.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/third_party/dynamic_annotations/dynamic_annotations.h"
......@@ -3282,6 +3283,10 @@ TEST_F(DiskCacheBackendTest, SimpleCacheOpenBadFile) {
entry->Close();
entry = NULL;
// The entry is being closed on the Simple Cache worker pool
disk_cache::SimpleBackendImpl::FlushWorkerPoolForTesting();
base::RunLoop().RunUntilIdle();
// Write an invalid header for stream 0 and stream 1.
base::FilePath entry_file1_path = cache_path_.AppendASCII(
disk_cache::simple_util::GetFilenameFromKeyAndFileIndex(key, 0));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment