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> |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "base/files/file.h" | 13 #include "base/files/file.h" |
14 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
15 #include "base/files/file_util.h" | 15 #include "base/files/file_util.h" |
16 #include "base/files/scoped_temp_dir.h" | 16 #include "base/files/scoped_temp_dir.h" |
17 #include "base/location.h" | 17 #include "base/location.h" |
18 #include "base/macros.h" | 18 #include "base/macros.h" |
| 19 #include "base/message_loop/message_loop.h" |
19 #include "base/run_loop.h" | 20 #include "base/run_loop.h" |
20 #include "base/single_thread_task_runner.h" | 21 #include "base/single_thread_task_runner.h" |
21 #include "base/threading/thread.h" | 22 #include "base/threading/thread.h" |
22 #include "net/base/io_buffer.h" | 23 #include "net/base/io_buffer.h" |
23 #include "net/base/net_errors.h" | 24 #include "net/base/net_errors.h" |
24 #include "net/base/test_completion_callback.h" | 25 #include "net/base/test_completion_callback.h" |
25 #include "testing/gtest/include/gtest/gtest.h" | 26 #include "testing/gtest/include/gtest/gtest.h" |
26 | 27 |
27 using storage::LocalFileStreamReader; | 28 using storage::LocalFileStreamReader; |
28 | 29 |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 int rv = reader->Read(buf.get(), buf->size(), base::Bind(&NeverCalled)); | 275 int rv = reader->Read(buf.get(), buf->size(), base::Bind(&NeverCalled)); |
275 ASSERT_TRUE(rv == net::ERR_IO_PENDING || rv >= 0); | 276 ASSERT_TRUE(rv == net::ERR_IO_PENDING || rv >= 0); |
276 | 277 |
277 // Delete immediately. | 278 // Delete immediately. |
278 // Should not crash; nor should NeverCalled be callback. | 279 // Should not crash; nor should NeverCalled be callback. |
279 reader.reset(); | 280 reader.reset(); |
280 EnsureFileTaskFinished(); | 281 EnsureFileTaskFinished(); |
281 } | 282 } |
282 | 283 |
283 } // namespace content | 284 } // namespace content |
OLD | NEW |