Home | History | Annotate | Download | only in disk_cache

Lines Matching refs:buffer1

80   scoped_refptr<net::IOBuffer> buffer1(new net::IOBuffer(kSize1));
81 CacheTestFillBuffer(buffer1->data(), kSize1, false);
82 EXPECT_EQ(0, entry->ReadData(0, 0, buffer1, kSize1, NULL));
83 base::strlcpy(buffer1->data(), "the data", kSize1);
84 EXPECT_EQ(10, entry->WriteData(0, 0, buffer1, kSize1, NULL, false));
85 memset(buffer1->data(), 0, kSize1);
86 EXPECT_EQ(10, entry->ReadData(0, 0, buffer1, kSize1, NULL));
87 EXPECT_STREQ("the data", buffer1->data());
183 scoped_refptr<net::IOBuffer> buffer1(new net::IOBuffer(kSize1));
186 CacheTestFillBuffer(buffer1->data(), kSize1, false);
190 EXPECT_EQ(0, entry->ReadData(0, 15 * 1024, buffer1, kSize1, &callback1));
191 base::strlcpy(buffer1->data(), "the data", kSize1);
193 int ret = entry->WriteData(0, 0, buffer1, kSize1, &callback2, false);
255 ret = entry->ReadData(0, 0, buffer1, kSize1, &callback12);
302 scoped_refptr<net::IOBuffer> buffer1(new net::IOBuffer(kSize1));
304 CacheTestFillBuffer(buffer1->data(), kSize1, false);
306 base::strlcpy(buffer1->data(), "the data", kSize1);
307 EXPECT_EQ(17000, entry->WriteData(0, 0, buffer1, kSize1, NULL, false));
308 memset(buffer1->data(), 0, kSize1);
309 EXPECT_EQ(17000, entry->ReadData(0, 0, buffer1, kSize1, NULL));
310 EXPECT_STREQ("the data", buffer1->data());
322 EXPECT_EQ(17000, entry->ReadData(1, 0, buffer1, kSize1, NULL));
323 EXPECT_EQ(17000, entry->WriteData(1, 20000, buffer1, kSize1, NULL, false));
387 scoped_refptr<net::IOBuffer> buffer1(new net::IOBuffer(kSize1));
390 CacheTestFillBuffer(buffer1->data(), kSize1, false);
393 base::strlcpy(buffer1->data(), "the data", kSize1);
394 int ret = entry->WriteData(0, 0, buffer1, kSize1, &callback1, false);
408 EXPECT_STREQ("the data", buffer1->data());
439 ret = entry->ReadData(1, 0, buffer1, kSize1, &callback8);
443 ret = entry->WriteData(1, 20000, buffer1, kSize1, &callback9, false);
485 scoped_refptr<net::IOBuffer> buffer1(new net::IOBuffer(kBufferSize));
490 CacheTestFillBuffer(buffer1->data(), kBufferSize, false);
491 EXPECT_EQ(kBufferSize, WriteData(entry, i, 0, buffer1, kBufferSize, false));
494 EXPECT_EQ(0, memcmp(buffer1->data(), buffer2->data(), kBufferSize));
498 ReadData(entry, kNumStreams, 0, buffer1, kBufferSize));
618 scoped_refptr<net::IOBuffer> buffer1(new net::IOBuffer(kSize));
620 CacheTestFillBuffer(buffer1->data(), kSize, false);
623 base::strlcpy(buffer1->data(), "the data", kSize);
624 EXPECT_EQ(10, WriteData(entry, 0, 0, buffer1, 10, false));
629 EXPECT_EQ(2000, WriteData(entry, 0, 0, buffer1, 2000, false));
632 EXPECT_TRUE(!memcmp(buffer1->data(), buffer2->data(), 2000));
634 EXPECT_EQ(20000, WriteData(entry, 0, 0, buffer1, kSize, false));
637 EXPECT_TRUE(!memcmp(buffer1->data(), buffer2->data(), kSize));
643 EXPECT_EQ(10, WriteData(entry, 0, 0, buffer1, 10, false));
649 EXPECT_EQ(2000, WriteData(entry, 0, 0, buffer1, 2000, false));
652 EXPECT_TRUE(!memcmp(buffer1->data(), buffer2->data(), 2000));
658 EXPECT_EQ(20000, WriteData(entry, 0, 0, buffer1, kSize, false));
661 EXPECT_TRUE(!memcmp(buffer1->data(), buffer2->data(), kSize));
669 EXPECT_EQ(0, WriteData(entry, 0, 45500, buffer1, 0, false));
703 scoped_refptr<net::IOBuffer> buffer1(new net::IOBuffer(kSize1));
706 CacheTestFillBuffer(buffer1->data(), kSize1, false);
710 EXPECT_EQ(200, WriteData(entry, 0, 0, buffer1, 200, false));
712 EXPECT_EQ(100, WriteData(entry, 0, 0, buffer1, 100, false));
714 EXPECT_EQ(100, WriteData(entry, 0, 0, buffer1, 100, true));
716 EXPECT_EQ(0, WriteData(entry, 0, 50, buffer1, 0, true));
718 EXPECT_EQ(0, WriteData(entry, 0, 0, buffer1, 0, true));
724 EXPECT_EQ(20000, WriteData(entry, 0, 0, buffer1, 20000, true));
727 EXPECT_TRUE(!memcmp(buffer1->data(), buffer2->data(), 20000));
731 EXPECT_EQ(18000, WriteData(entry, 0, 0, buffer1, 18000, false));
733 EXPECT_EQ(18000, WriteData(entry, 0, 0, buffer1, 18000, true));
735 EXPECT_EQ(0, WriteData(entry, 0, 17500, buffer1, 0, true));
739 EXPECT_EQ(600, WriteData(entry, 0, 1000, buffer1, 600, true));
742 EXPECT_TRUE(!memcmp(buffer1->data(), buffer2->data(), 600));
744 EXPECT_TRUE(!memcmp(buffer1->data(), buffer2->data(), 1000)) <<
748 EXPECT_EQ(20000, WriteData(entry, 0, 0, buffer1, 20000, true));
750 EXPECT_EQ(0, WriteData(entry, 0, 0, buffer1, 0, true));
837 scoped_refptr<net::IOBuffer> buffer1(new net::IOBuffer(kSize));
839 CacheTestFillBuffer(buffer1->data(), kSize, true);
842 EXPECT_EQ(kSize, WriteData(entry, 1, 0, buffer1, kSize, false));
847 EXPECT_EQ(kSize, WriteData(entry, 1, 5000, buffer1, kSize, false));
849 EXPECT_TRUE(!memcmp(buffer2->data(), buffer1->data(), kSize));
852 EXPECT_EQ(kSize, WriteData(entry, 1, 18000, buffer1, kSize, false));
857 EXPECT_EQ(kSize, WriteData(entry, 1, 10000, buffer1, kSize, false));
860 EXPECT_TRUE(!memcmp(buffer2->data(), buffer1->data(), kSize));
863 EXPECT_TRUE(!memcmp(buffer2->data(), buffer1->data(), kSize));
866 EXPECT_TRUE(!memcmp(buffer2->data(), buffer1->data(), kSize));
869 EXPECT_EQ(kSize, WriteData(entry, 1, 23000, buffer1, kSize, false));
874 EXPECT_EQ(kSize, WriteData(entry, 1, 17000, buffer1, kSize, false));
877 EXPECT_EQ(kSize, WriteData(entry, 1, 19000, buffer1, kSize, false));
880 EXPECT_TRUE(!memcmp(buffer2->data(), buffer1->data(), kSize));
883 EXPECT_TRUE(!memcmp(buffer2->data(), buffer1->data(), kSize));
885 EXPECT_EQ(kSize, WriteData(entry, 1, 22900, buffer1, kSize, false));
888 EXPECT_TRUE(!memcmp(buffer2->data(), buffer1->data() + 100, 100));
892 EXPECT_TRUE(!memcmp(buffer2->data(), buffer1->data() + 100, 100));
895 EXPECT_EQ(kSize, WriteData(entry, 1, 25000, buffer1, kSize, false));
896 EXPECT_EQ(kSize, WriteData(entry, 1, 45000, buffer1, kSize, false));
899 EXPECT_TRUE(!memcmp(buffer2->data(), buffer1->data(), kSize));
902 EXPECT_TRUE(!memcmp(buffer2->data(), buffer1->data(), kSize));
928 scoped_refptr<net::IOBuffer> buffer1(new net::IOBuffer(kSize));
930 CacheTestFillBuffer(buffer1->data(), kSize, true);
933 EXPECT_EQ(kSize, WriteData(entry, 1, 0, buffer1, kSize, true));
934 EXPECT_EQ(kSize, WriteData(entry, 1, 17000, buffer1, kSize, true));
935 EXPECT_EQ(kSize, WriteData(entry, 1, 23000, buffer1, kSize, true));
941 EXPECT_EQ(kSize, WriteData(entry, 1, 25000, buffer1, kSize, true));
948 EXPECT_TRUE(!memcmp(buffer2->data(), buffer1->data() + kSize - 35, 35));
954 EXPECT_TRUE(!memcmp(buffer2->data() + 100, buffer1->data(), kSize - 100));
957 EXPECT_EQ(kSize, WriteData(entry, 1, 26000, buffer1, kSize, true));
962 EXPECT_TRUE(!memcmp(buffer2->data() + 100, buffer1->data(), kSize - 100));
965 EXPECT_EQ(kSize, WriteData(entry, 1, 25000, buffer1, kSize, true));
968 EXPECT_TRUE(!memcmp(buffer2->data(), buffer1->data() + kSize - 28, 28));
971 EXPECT_EQ(kSize, WriteData(entry, 1, 24000, buffer1, kSize, false));
973 EXPECT_EQ(kSize, WriteData(entry, 1, 24500, buffer1, kSize, true));
977 EXPECT_TRUE(!memcmp(buffer2->data() + 100, buffer1->data(), kSize - 100));
980 EXPECT_EQ(kSize, WriteData(entry, 1, 19000, buffer1, kSize, true));
984 EXPECT_TRUE(!memcmp(buffer2->data() + 100, buffer1->data(), kSize - 100));
1071 scoped_refptr<net::IOBuffer> buffer1(new net::IOBuffer(kSize1));
1075 CacheTestFillBuffer(buffer1->data(), kSize1, false);
1079 EXPECT_EQ(200, WriteData(entry, 0, 400, buffer1, 200, false));
1087 EXPECT_EQ(200, WriteData(entry, 0, 800, buffer1, 200, false));
1095 EXPECT_EQ(200, WriteData(entry, 0, 1800, buffer1, 200, true));
1101 EXPECT_EQ(200, WriteData(entry, 0, 19800, buffer1, 200, false));
1107 EXPECT_EQ(600, WriteData(entry, 0, 1000, buffer1, 600, true));
1110 EXPECT_TRUE(!memcmp(buffer3->data(), buffer1->data(), 600));
1113 EXPECT_EQ(600, WriteData(entry, 0, 2000, buffer1, 600, false));
1119 EXPECT_EQ(600, WriteData(entry, 0, 3000, buffer1, 600, true));
1224 scoped_refptr<net::IOBuffer> buffer1(new net::IOBuffer(kSize1));
1226 CacheTestFillBuffer(buffer1->data(), kSize1, false);
1229 EXPECT_EQ(2000, WriteData(entry, 0, 0, buffer1, 2000, false));
1231 EXPECT_EQ(0, memcmp(buffer1->data(), buffer2->data(), kSize1));