Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1799)

Unified Diff: net/url_request/url_request_unittest.cc

Issue 9074: Port more of url_request_unittest.cc.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« base/file_util.cc ('K') | « base/file_util_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_unittest.cc
===================================================================
--- net/url_request/url_request_unittest.cc (revision 4515)
+++ net/url_request/url_request_unittest.cc (working copy)
@@ -331,21 +331,13 @@
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));
+ int64 size_read = file_util::ReadFile(path, buf.get(), size);
+ ASSERT_EQ(size, size_read);
- CloseHandle(file);
-
- EXPECT_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 @@
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);
« base/file_util.cc ('K') | « base/file_util_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698