OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/local_file_stream_reader.h" | 5 #include "storage/browser/fileapi/local_file_stream_reader.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 base::Time new_modified_time = test_file_modification_time() + delta; | 103 base::Time new_modified_time = test_file_modification_time() + delta; |
104 ASSERT_TRUE(base::TouchFile(test_path(), | 104 ASSERT_TRUE(base::TouchFile(test_path(), |
105 test_file_modification_time(), | 105 test_file_modification_time(), |
106 new_modified_time)); | 106 new_modified_time)); |
107 } | 107 } |
108 | 108 |
109 base::SingleThreadTaskRunner* file_task_runner() const { | 109 base::SingleThreadTaskRunner* file_task_runner() const { |
110 return file_thread_.task_runner().get(); | 110 return file_thread_.task_runner().get(); |
111 } | 111 } |
112 | 112 |
113 base::FilePath test_dir() const { return dir_.path(); } | 113 base::FilePath test_dir() const { return dir_.GetPath(); } |
114 base::FilePath test_path() const { return dir_.path().AppendASCII("test"); } | 114 base::FilePath test_path() const { |
| 115 return dir_.GetPath().AppendASCII("test"); |
| 116 } |
115 base::Time test_file_modification_time() const { | 117 base::Time test_file_modification_time() const { |
116 return test_file_modification_time_; | 118 return test_file_modification_time_; |
117 } | 119 } |
118 | 120 |
119 void EnsureFileTaskFinished() { | 121 void EnsureFileTaskFinished() { |
120 file_task_runner()->PostTaskAndReply( | 122 file_task_runner()->PostTaskAndReply( |
121 FROM_HERE, base::Bind(&EmptyCallback), base::Bind(&QuitLoop)); | 123 FROM_HERE, base::Bind(&EmptyCallback), base::Bind(&QuitLoop)); |
122 base::RunLoop().Run(); | 124 base::RunLoop().Run(); |
123 } | 125 } |
124 | 126 |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 int rv = reader->Read(buf.get(), buf->size(), base::Bind(&NeverCalled)); | 274 int rv = reader->Read(buf.get(), buf->size(), base::Bind(&NeverCalled)); |
273 ASSERT_TRUE(rv == net::ERR_IO_PENDING || rv >= 0); | 275 ASSERT_TRUE(rv == net::ERR_IO_PENDING || rv >= 0); |
274 | 276 |
275 // Delete immediately. | 277 // Delete immediately. |
276 // Should not crash; nor should NeverCalled be callback. | 278 // Should not crash; nor should NeverCalled be callback. |
277 reader.reset(); | 279 reader.reset(); |
278 EnsureFileTaskFinished(); | 280 EnsureFileTaskFinished(); |
279 } | 281 } |
280 | 282 |
281 } // namespace content | 283 } // namespace content |
OLD | NEW |