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_writer.h" | 5 #include "storage/browser/fileapi/local_file_stream_writer.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/callback.h" | 12 #include "base/callback.h" |
13 #include "base/files/file_util.h" | 13 #include "base/files/file_util.h" |
14 #include "base/files/scoped_temp_dir.h" | 14 #include "base/files/scoped_temp_dir.h" |
15 #include "base/logging.h" | 15 #include "base/logging.h" |
| 16 #include "base/message_loop/message_loop.h" |
16 #include "base/run_loop.h" | 17 #include "base/run_loop.h" |
17 #include "base/single_thread_task_runner.h" | 18 #include "base/single_thread_task_runner.h" |
18 #include "base/threading/thread.h" | 19 #include "base/threading/thread.h" |
19 #include "net/base/io_buffer.h" | 20 #include "net/base/io_buffer.h" |
20 #include "net/base/test_completion_callback.h" | 21 #include "net/base/test_completion_callback.h" |
21 #include "testing/gtest/include/gtest/gtest.h" | 22 #include "testing/gtest/include/gtest/gtest.h" |
22 | 23 |
23 using storage::FileStreamWriter; | 24 using storage::FileStreamWriter; |
24 using storage::LocalFileStreamWriter; | 25 using storage::LocalFileStreamWriter; |
25 | 26 |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 writer->Write(buffer.get(), buffer->size(), base::Bind(&NeverCalled)); | 174 writer->Write(buffer.get(), buffer->size(), base::Bind(&NeverCalled)); |
174 ASSERT_EQ(net::ERR_IO_PENDING, result); | 175 ASSERT_EQ(net::ERR_IO_PENDING, result); |
175 | 176 |
176 net::TestCompletionCallback callback; | 177 net::TestCompletionCallback callback; |
177 writer->Cancel(callback.callback()); | 178 writer->Cancel(callback.callback()); |
178 int cancel_result = callback.WaitForResult(); | 179 int cancel_result = callback.WaitForResult(); |
179 EXPECT_EQ(net::OK, cancel_result); | 180 EXPECT_EQ(net::OK, cancel_result); |
180 } | 181 } |
181 | 182 |
182 } // namespace content | 183 } // namespace content |
OLD | NEW |