Chromium Code Reviews| Index: net/disk_cache/entry_unittest.cc |
| =================================================================== |
| --- net/disk_cache/entry_unittest.cc (Revision 30242) |
| +++ net/disk_cache/entry_unittest.cc (Arbeitskopie) |
| @@ -1356,8 +1356,16 @@ |
| SimpleCallbackTest cb1, cb2, cb3, cb4; |
| int64 offset = 0; |
| - for (int ret = 0; ret != net::ERR_IO_PENDING; offset += kSize * 4) |
| + int tries = 0; |
| + const int maxtries = 1000; // Avoid hang on infinitely fast disks |
|
rvargas (doing something else)
2009/10/27 23:04:58
Are you sure you want to have a number that high?
|
| + for (int ret = 0; ret != net::ERR_IO_PENDING; offset += kSize * 4) { |
| ret = entry->WriteSparseData(offset, buf, kSize, &cb1); |
| + if (++tries > maxtries) { |
| + LOG(ERROR) << "Data writes never come back PENDING; skipping test"; |
| + entry->Close(); |
| + return; |
| + } |
| + } |
| // Cannot use the entry at this point. |
| offset = 0; |