diff options
author | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-27 00:04:24 +0000 |
---|---|---|
committer | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-27 00:04:24 +0000 |
commit | 9fde2a2f20e1cbd68d88ae5769bb8018b9b4422e (patch) | |
tree | a1a7c0a71e057b93275dd29f390cafa3d9dff630 /net/disk_cache/mapped_file_unittest.cc | |
parent | efc7057308ae81e69861d37aaca33b67d5187284 (diff) | |
download | chromium_src-9fde2a2f20e1cbd68d88ae5769bb8018b9b4422e.zip chromium_src-9fde2a2f20e1cbd68d88ae5769bb8018b9b4422e.tar.gz chromium_src-9fde2a2f20e1cbd68d88ae5769bb8018b9b4422e.tar.bz2 |
Implement sync IO for the disk cache, and temporarily redirect
async IO to be performed synchronously.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1414 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache/mapped_file_unittest.cc')
-rw-r--r-- | net/disk_cache/mapped_file_unittest.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/net/disk_cache/mapped_file_unittest.cc b/net/disk_cache/mapped_file_unittest.cc index d626ee0..138f3cb 100644 --- a/net/disk_cache/mapped_file_unittest.cc +++ b/net/disk_cache/mapped_file_unittest.cc @@ -3,6 +3,7 @@ // found in the LICENSE file. #include "base/file_util.h" +#include "base/string_util.h" #include "net/disk_cache/disk_cache_test_util.h" #include "net/disk_cache/mapped_file.h" #include "testing/gtest/include/gtest/gtest.h" @@ -46,6 +47,7 @@ void WaitForCallbacks(int expected) { if (!expected) return; +#if defined(OS_WIN) int iterations = 0; int last = 0; while (iterations < 40) { @@ -57,6 +59,9 @@ void WaitForCallbacks(int expected) { else iterations = 0; } +#elif defined(OS_POSIX) + // TODO(rvargas): Do something when async IO is implemented. +#endif } } // namespace @@ -71,7 +76,7 @@ TEST(DiskCacheTest, MappedFile_SyncIO) { char buffer1[20]; char buffer2[20]; CacheTestFillBuffer(buffer1, sizeof(buffer1), false); - strcpy_s(buffer1, "the data"); + base::strlcpy(buffer1, "the data", sizeof(buffer1)); EXPECT_TRUE(file->Write(buffer1, sizeof(buffer1), 8192)); EXPECT_TRUE(file->Read(buffer2, sizeof(buffer2), 8192)); EXPECT_STREQ(buffer1, buffer2); @@ -92,7 +97,7 @@ TEST(DiskCacheTest, MappedFile_AsyncIO) { char buffer1[20]; char buffer2[20]; CacheTestFillBuffer(buffer1, sizeof(buffer1), false); - strcpy_s(buffer1, "the data"); + base::strlcpy(buffer1, "the data", sizeof(buffer1)); bool completed; EXPECT_TRUE(file->Write(buffer1, sizeof(buffer1), 1024 * 1024, &callback, &completed)); |