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

Side by Side Diff: content/browser/fileapi/file_system_file_stream_reader_unittest.cc

Issue 678073006: Standardize usage of virtual/override/final specifiers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix bogus formatting Created 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "storage/browser/fileapi/file_system_file_stream_reader.h" 5 #include "storage/browser/fileapi/file_system_file_stream_reader.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <string> 8 #include <string>
9 9
10 #include "base/files/scoped_temp_dir.h" 10 #include "base/files/scoped_temp_dir.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 } 60 }
61 61
62 void NeverCalled(int unused) { ADD_FAILURE(); } 62 void NeverCalled(int unused) { ADD_FAILURE(); }
63 63
64 } // namespace 64 } // namespace
65 65
66 class FileSystemFileStreamReaderTest : public testing::Test { 66 class FileSystemFileStreamReaderTest : public testing::Test {
67 public: 67 public:
68 FileSystemFileStreamReaderTest() {} 68 FileSystemFileStreamReaderTest() {}
69 69
70 virtual void SetUp() override { 70 void SetUp() override {
71 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); 71 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
72 72
73 file_system_context_ = CreateFileSystemContextForTesting( 73 file_system_context_ = CreateFileSystemContextForTesting(
74 NULL, temp_dir_.path()); 74 NULL, temp_dir_.path());
75 75
76 file_system_context_->OpenFileSystem( 76 file_system_context_->OpenFileSystem(
77 GURL(kURLOrigin), 77 GURL(kURLOrigin),
78 storage::kFileSystemTypeTemporary, 78 storage::kFileSystemTypeTemporary,
79 storage::OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT, 79 storage::OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT,
80 base::Bind(&OnOpenFileSystem)); 80 base::Bind(&OnOpenFileSystem));
81 base::RunLoop().RunUntilIdle(); 81 base::RunLoop().RunUntilIdle();
82 82
83 WriteFile(kTestFileName, kTestData, kTestDataSize, 83 WriteFile(kTestFileName, kTestData, kTestDataSize,
84 &test_file_modification_time_); 84 &test_file_modification_time_);
85 } 85 }
86 86
87 virtual void TearDown() override { 87 void TearDown() override { base::RunLoop().RunUntilIdle(); }
88 base::RunLoop().RunUntilIdle();
89 }
90 88
91 protected: 89 protected:
92 storage::FileSystemFileStreamReader* CreateFileReader( 90 storage::FileSystemFileStreamReader* CreateFileReader(
93 const std::string& file_name, 91 const std::string& file_name,
94 int64 initial_offset, 92 int64 initial_offset,
95 const base::Time& expected_modification_time) { 93 const base::Time& expected_modification_time) {
96 return new FileSystemFileStreamReader(file_system_context_.get(), 94 return new FileSystemFileStreamReader(file_system_context_.get(),
97 GetFileSystemURL(file_name), 95 GetFileSystemURL(file_name),
98 initial_offset, 96 initial_offset,
99 expected_modification_time); 97 expected_modification_time);
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 new net::IOBufferWithSize(kTestDataSize)); 261 new net::IOBufferWithSize(kTestDataSize));
264 int rv = reader->Read(buf.get(), buf->size(), base::Bind(&NeverCalled)); 262 int rv = reader->Read(buf.get(), buf->size(), base::Bind(&NeverCalled));
265 ASSERT_TRUE(rv == net::ERR_IO_PENDING || rv >= 0); 263 ASSERT_TRUE(rv == net::ERR_IO_PENDING || rv >= 0);
266 264
267 // Delete immediately. 265 // Delete immediately.
268 // Should not crash; nor should NeverCalled be callback. 266 // Should not crash; nor should NeverCalled be callback.
269 reader.reset(); 267 reader.reset();
270 } 268 }
271 269
272 } // namespace content 270 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698