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

Unified Diff: net/base/upload_bytes_element_reader_unittest.cc

Issue 15829004: Update net/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: license twerk Created 7 years, 7 months 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
« no previous file with comments | « net/base/test_completion_callback_unittest.cc ('k') | net/base/upload_data_stream.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/upload_bytes_element_reader_unittest.cc
diff --git a/net/base/upload_bytes_element_reader_unittest.cc b/net/base/upload_bytes_element_reader_unittest.cc
index b5bd5884a548aeff16312349fa363e2f0823b0c1..1aad55ee5ce04cb7076600b5efb466af93aa7c9b 100644
--- a/net/base/upload_bytes_element_reader_unittest.cc
+++ b/net/base/upload_bytes_element_reader_unittest.cc
@@ -33,8 +33,9 @@ TEST_F(UploadBytesElementReaderTest, ReadPartially) {
const size_t kHalfSize = bytes_.size() / 2;
std::vector<char> buf(kHalfSize);
scoped_refptr<IOBuffer> wrapped_buffer = new WrappedIOBuffer(&buf[0]);
- EXPECT_EQ(static_cast<int>(buf.size()),
- reader_->Read(wrapped_buffer, buf.size(), CompletionCallback()));
+ EXPECT_EQ(
+ static_cast<int>(buf.size()),
+ reader_->Read(wrapped_buffer.get(), buf.size(), CompletionCallback()));
EXPECT_EQ(bytes_.size() - buf.size(), reader_->BytesRemaining());
bytes_.resize(kHalfSize); // Resize to compare.
EXPECT_EQ(bytes_, buf);
@@ -43,20 +44,23 @@ TEST_F(UploadBytesElementReaderTest, ReadPartially) {
TEST_F(UploadBytesElementReaderTest, ReadAll) {
std::vector<char> buf(bytes_.size());
scoped_refptr<IOBuffer> wrapped_buffer = new WrappedIOBuffer(&buf[0]);
- EXPECT_EQ(static_cast<int>(buf.size()),
- reader_->Read(wrapped_buffer, buf.size(), CompletionCallback()));
+ EXPECT_EQ(
+ static_cast<int>(buf.size()),
+ reader_->Read(wrapped_buffer.get(), buf.size(), CompletionCallback()));
EXPECT_EQ(0U, reader_->BytesRemaining());
EXPECT_EQ(bytes_, buf);
// Try to read again.
- EXPECT_EQ(0, reader_->Read(wrapped_buffer, buf.size(), CompletionCallback()));
+ EXPECT_EQ(
+ 0, reader_->Read(wrapped_buffer.get(), buf.size(), CompletionCallback()));
}
TEST_F(UploadBytesElementReaderTest, ReadTooMuch) {
const size_t kTooLargeSize = bytes_.size() * 2;
std::vector<char> buf(kTooLargeSize);
scoped_refptr<IOBuffer> wrapped_buffer = new WrappedIOBuffer(&buf[0]);
- EXPECT_EQ(static_cast<int>(bytes_.size()),
- reader_->Read(wrapped_buffer, buf.size(), CompletionCallback()));
+ EXPECT_EQ(
+ static_cast<int>(bytes_.size()),
+ reader_->Read(wrapped_buffer.get(), buf.size(), CompletionCallback()));
EXPECT_EQ(0U, reader_->BytesRemaining());
buf.resize(bytes_.size()); // Resize to compare.
EXPECT_EQ(bytes_, buf);
@@ -67,8 +71,9 @@ TEST_F(UploadBytesElementReaderTest, MultipleInit) {
scoped_refptr<IOBuffer> wrapped_buffer = new WrappedIOBuffer(&buf[0]);
// Read all.
- EXPECT_EQ(static_cast<int>(buf.size()),
- reader_->Read(wrapped_buffer, buf.size(), CompletionCallback()));
+ EXPECT_EQ(
+ static_cast<int>(buf.size()),
+ reader_->Read(wrapped_buffer.get(), buf.size(), CompletionCallback()));
EXPECT_EQ(0U, reader_->BytesRemaining());
EXPECT_EQ(bytes_, buf);
@@ -78,8 +83,9 @@ TEST_F(UploadBytesElementReaderTest, MultipleInit) {
EXPECT_EQ(bytes_.size(), reader_->BytesRemaining());
// Read again.
- EXPECT_EQ(static_cast<int>(buf.size()),
- reader_->Read(wrapped_buffer, buf.size(), CompletionCallback()));
+ EXPECT_EQ(
+ static_cast<int>(buf.size()),
+ reader_->Read(wrapped_buffer.get(), buf.size(), CompletionCallback()));
EXPECT_EQ(0U, reader_->BytesRemaining());
EXPECT_EQ(bytes_, buf);
}
« no previous file with comments | « net/base/test_completion_callback_unittest.cc ('k') | net/base/upload_data_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698