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

Unified Diff: net/base/upload_file_element_reader_unittest.cc

Issue 15984016: Call scoped_refptr<T>::get() rather than relying on implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 6 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/upload_data_stream_unittest.cc ('k') | net/disk_cache/backend_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/upload_file_element_reader_unittest.cc
diff --git a/net/base/upload_file_element_reader_unittest.cc b/net/base/upload_file_element_reader_unittest.cc
index bd0594ce0e73cb23309201d7c75b461234da72f1..8224f773046beee8317096143cdea81c0feb446e 100644
--- a/net/base/upload_file_element_reader_unittest.cc
+++ b/net/base/upload_file_element_reader_unittest.cc
@@ -30,9 +30,12 @@ class UploadFileElementReaderTest : public PlatformTest {
static_cast<int>(bytes_.size()),
file_util::WriteFile(temp_file_path_, &bytes_[0], bytes_.size()));
- reader_.reset(new UploadFileElementReader(
- base::MessageLoopProxy::current(),
- temp_file_path_, 0, kuint64max, base::Time()));
+ reader_.reset(
+ new UploadFileElementReader(base::MessageLoopProxy::current().get(),
+ temp_file_path_,
+ 0,
+ kuint64max,
+ base::Time()));
TestCompletionCallback callback;
ASSERT_EQ(ERR_IO_PENDING, reader_->Init(callback.callback()));
EXPECT_EQ(OK, callback.WaitForResult());
@@ -170,9 +173,12 @@ TEST_F(UploadFileElementReaderTest, InitDuringAsyncOperation) {
TEST_F(UploadFileElementReaderTest, Range) {
const uint64 kOffset = 2;
const uint64 kLength = bytes_.size() - kOffset * 3;
- reader_.reset(new UploadFileElementReader(
- base::MessageLoopProxy::current(),
- temp_file_path_, kOffset, kLength, base::Time()));
+ reader_.reset(
+ new UploadFileElementReader(base::MessageLoopProxy::current().get(),
+ temp_file_path_,
+ kOffset,
+ kLength,
+ base::Time()));
TestCompletionCallback init_callback;
ASSERT_EQ(ERR_IO_PENDING, reader_->Init(init_callback.callback()));
EXPECT_EQ(OK, init_callback.WaitForResult());
@@ -197,9 +203,12 @@ TEST_F(UploadFileElementReaderTest, FileChanged) {
// Expect one second before the actual modification time to simulate change.
const base::Time expected_modification_time =
info.last_modified - base::TimeDelta::FromSeconds(1);
- reader_.reset(new UploadFileElementReader(
- base::MessageLoopProxy::current(),
- temp_file_path_, 0, kuint64max, expected_modification_time));
+ reader_.reset(
+ new UploadFileElementReader(base::MessageLoopProxy::current().get(),
+ temp_file_path_,
+ 0,
+ kuint64max,
+ expected_modification_time));
TestCompletionCallback init_callback;
ASSERT_EQ(ERR_IO_PENDING, reader_->Init(init_callback.callback()));
EXPECT_EQ(ERR_UPLOAD_FILE_CHANGED, init_callback.WaitForResult());
@@ -207,9 +216,12 @@ TEST_F(UploadFileElementReaderTest, FileChanged) {
TEST_F(UploadFileElementReaderTest, WrongPath) {
const base::FilePath wrong_path(FILE_PATH_LITERAL("wrong_path"));
- reader_.reset(new UploadFileElementReader(
- base::MessageLoopProxy::current(),
- wrong_path, 0, kuint64max, base::Time()));
+ reader_.reset(
+ new UploadFileElementReader(base::MessageLoopProxy::current().get(),
+ wrong_path,
+ 0,
+ kuint64max,
+ base::Time()));
TestCompletionCallback init_callback;
ASSERT_EQ(ERR_IO_PENDING, reader_->Init(init_callback.callback()));
EXPECT_EQ(OK, init_callback.WaitForResult());
« no previous file with comments | « net/base/upload_data_stream_unittest.cc ('k') | net/disk_cache/backend_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698