summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authordkegel@google.com <dkegel@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-04 21:00:46 +0000
committerdkegel@google.com <dkegel@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-04 21:00:46 +0000
commiteac0709a26a824381291cbf78440c969a846b1ab (patch)
tree98255561598331f85ab1e519c2fba40c16da67e6 /net
parent379979b98bbc0af3e1f3eebacda613c771b2d104 (diff)
downloadchromium_src-eac0709a26a824381291cbf78440c969a846b1ab.zip
chromium_src-eac0709a26a824381291cbf78440c969a846b1ab.tar.gz
chromium_src-eac0709a26a824381291cbf78440c969a846b1ab.tar.bz2
Port more of url_request_unittest.cc.
Also do a little bit of the FilePath rewrite as it pertains to this test. Review URL: http://codereview.chromium.org/9074 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4652 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/url_request/url_request_unittest.cc19
1 files changed, 4 insertions, 15 deletions
diff --git a/net/url_request/url_request_unittest.cc b/net/url_request/url_request_unittest.cc
index f2c8c58..4c55aea 100644
--- a/net/url_request/url_request_unittest.cc
+++ b/net/url_request/url_request_unittest.cc
@@ -331,20 +331,12 @@ TEST(URLRequestTest, PostFileTest) {
MessageLoop::current()->Run();
-#if defined(OS_WIN)
- HANDLE file = CreateFile(path.c_str(), GENERIC_READ, FILE_SHARE_READ, NULL,
- OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
- ASSERT_NE(INVALID_HANDLE_VALUE, file);
-
- DWORD size = GetFileSize(file, NULL);
+ int64 size;
+ ASSERT_EQ(true, file_util::GetFileSize(path, &size));
scoped_array<char> buf(new char[size]);
- DWORD size_read;
- EXPECT_TRUE(ReadFile(file, buf.get(), size, &size_read, NULL));
-
- CloseHandle(file);
-
- EXPECT_EQ(size, size_read);
+ int64 size_read = file_util::ReadFile(path, buf.get(), size);
+ ASSERT_EQ(size, size_read);
ASSERT_EQ(1, d.response_started_count()) << "request failed: " <<
(int) r.status().status() << ", os error: " << r.status().os_error();
@@ -353,9 +345,6 @@ TEST(URLRequestTest, PostFileTest) {
ASSERT_EQ(size, d.bytes_received());
EXPECT_EQ(0, memcmp(d.data_received().c_str(), buf.get(), size));
-#else
- NOTIMPLEMENTED();
-#endif
}
#ifndef NDEBUG
DCHECK_EQ(url_request_metrics.object_count,0);