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

Side by Side Diff: net/base/file_stream_unittest.cc

Issue 509563003: Remove implicit conversions from scoped_refptr to T* in net/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | net/base/sdch_manager_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/base/file_stream.h" 5 #include "net/base/file_stream.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/files/file.h" 10 #include "base/files/file.h"
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 FileStream stream(base::MessageLoopProxy::current()); 165 FileStream stream(base::MessageLoopProxy::current());
166 166
167 EXPECT_FALSE(stream.IsOpen()); 167 EXPECT_FALSE(stream.IsOpen());
168 168
169 // Try seeking... 169 // Try seeking...
170 rv = stream.Seek(base::File::FROM_BEGIN, 5, callback64.callback()); 170 rv = stream.Seek(base::File::FROM_BEGIN, 5, callback64.callback());
171 EXPECT_EQ(ERR_UNEXPECTED, callback64.GetResult(rv)); 171 EXPECT_EQ(ERR_UNEXPECTED, callback64.GetResult(rv));
172 172
173 // Try reading... 173 // Try reading...
174 scoped_refptr<IOBufferWithSize> buf = new IOBufferWithSize(10); 174 scoped_refptr<IOBufferWithSize> buf = new IOBufferWithSize(10);
175 rv = stream.Read(buf, buf->size(), callback.callback()); 175 rv = stream.Read(buf.get(), buf->size(), callback.callback());
176 EXPECT_EQ(ERR_UNEXPECTED, callback.GetResult(rv)); 176 EXPECT_EQ(ERR_UNEXPECTED, callback.GetResult(rv));
177 } 177 }
178 178
179 TEST_F(FileStreamTest, Read) { 179 TEST_F(FileStreamTest, Read) {
180 int64 file_size; 180 int64 file_size;
181 EXPECT_TRUE(base::GetFileSize(temp_file_path(), &file_size)); 181 EXPECT_TRUE(base::GetFileSize(temp_file_path(), &file_size));
182 182
183 FileStream stream(base::MessageLoopProxy::current()); 183 FileStream stream(base::MessageLoopProxy::current());
184 int flags = base::File::FLAG_OPEN | base::File::FLAG_READ | 184 int flags = base::File::FLAG_OPEN | base::File::FLAG_READ |
185 base::File::FLAG_ASYNC; 185 base::File::FLAG_ASYNC;
(...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after
874 total_bytes_read += rv; 874 total_bytes_read += rv;
875 data_read.append(buf->data(), rv); 875 data_read.append(buf->data(), rv);
876 } 876 }
877 EXPECT_EQ(file_size, total_bytes_read); 877 EXPECT_EQ(file_size, total_bytes_read);
878 } 878 }
879 #endif 879 #endif
880 880
881 } // namespace 881 } // namespace
882 882
883 } // namespace net 883 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/base/sdch_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698