| Index: chrome/test/base/testing_profile.cc
|
| diff --git a/chrome/test/base/testing_profile.cc b/chrome/test/base/testing_profile.cc
|
| index c43d29fdee2dbfb04d59119c832b39124fcdedb7..3c8a43c4c868c6addf0faa182fa1ed734af640bb 100644
|
| --- a/chrome/test/base/testing_profile.cc
|
| +++ b/chrome/test/base/testing_profile.cc
|
| @@ -566,7 +566,19 @@ TestingProfile::~TestingProfile() {
|
| }
|
|
|
| base::ThreadRestrictions::ScopedAllowIO allow_io;
|
| - ignore_result(temp_dir_.Delete());
|
| + // Release the temp dir during the |allow_io| scope (otherwise the
|
| + // ScopedTempDir destructor will do it in a context where IO is not allowed).
|
| + // If Delete fails (other than in the valid case where the path is empty), the
|
| + // test will leave detritus, so fail the test.
|
| + if (!temp_dir_.IsEmpty()) {
|
| + if (!temp_dir_.Delete()) {
|
| + LOG(ERROR) << "CHECK(temp_dir_.Delete()) would fail!!!";
|
| + } else {
|
| + LOG(WARNING) << "Delete in ScopedAllowIO succeeded";
|
| + }
|
| + } else {
|
| + LOG(WARNING) << "Not calling Delete in ScopedAllowIO (path is empty)";
|
| + }
|
| }
|
|
|
| void TestingProfile::CreateFaviconService() {
|
|
|