OLD | NEW |
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 "webkit/fileapi/file_system_dir_url_request_job.h" | 5 #include "webkit/fileapi/file_system_dir_url_request_job.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
| 10 #include "base/files/scoped_temp_dir.h" |
10 #include "base/format_macros.h" | 11 #include "base/format_macros.h" |
11 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
12 #include "base/message_loop.h" | 13 #include "base/message_loop.h" |
13 #include "base/platform_file.h" | 14 #include "base/platform_file.h" |
14 #include "base/scoped_temp_dir.h" | |
15 #include "base/string_piece.h" | 15 #include "base/string_piece.h" |
16 #include "base/utf_string_conversions.h" | 16 #include "base/utf_string_conversions.h" |
17 #include "net/base/net_errors.h" | 17 #include "net/base/net_errors.h" |
18 #include "net/base/net_util.h" | 18 #include "net/base/net_util.h" |
19 #include "net/http/http_request_headers.h" | 19 #include "net/http/http_request_headers.h" |
20 #include "net/url_request/url_request.h" | 20 #include "net/url_request/url_request.h" |
21 #include "net/url_request/url_request_context.h" | 21 #include "net/url_request/url_request_context.h" |
22 #include "net/url_request/url_request_test_util.h" | 22 #include "net/url_request/url_request_test_util.h" |
23 #include "testing/gtest/include/gtest/gtest.h" | 23 #include "testing/gtest/include/gtest/gtest.h" |
24 #include "unicode/regex.h" | 24 #include "unicode/regex.h" |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 FileSystemFileUtil* file_util() { | 205 FileSystemFileUtil* file_util() { |
206 return file_system_context_->sandbox_provider()->GetFileUtil( | 206 return file_system_context_->sandbox_provider()->GetFileUtil( |
207 kFileSystemTypeTemporary); | 207 kFileSystemTypeTemporary); |
208 } | 208 } |
209 | 209 |
210 // Put the message loop at the top, so that it's the last thing deleted. | 210 // Put the message loop at the top, so that it's the last thing deleted. |
211 // Delete all MessageLoopProxy objects before the MessageLoop, to help prevent | 211 // Delete all MessageLoopProxy objects before the MessageLoop, to help prevent |
212 // leaks caused by tasks posted during shutdown. | 212 // leaks caused by tasks posted during shutdown. |
213 MessageLoop message_loop_; | 213 MessageLoop message_loop_; |
214 | 214 |
215 ScopedTempDir temp_dir_; | 215 base::ScopedTempDir temp_dir_; |
216 net::URLRequestContext empty_context_; | 216 net::URLRequestContext empty_context_; |
217 scoped_ptr<net::TestDelegate> delegate_; | 217 scoped_ptr<net::TestDelegate> delegate_; |
218 scoped_ptr<net::URLRequest> request_; | 218 scoped_ptr<net::URLRequest> request_; |
219 scoped_refptr<quota::MockSpecialStoragePolicy> special_storage_policy_; | 219 scoped_refptr<quota::MockSpecialStoragePolicy> special_storage_policy_; |
220 scoped_refptr<FileSystemContext> file_system_context_; | 220 scoped_refptr<FileSystemContext> file_system_context_; |
221 base::WeakPtrFactory<FileSystemDirURLRequestJobTest> weak_factory_; | 221 base::WeakPtrFactory<FileSystemDirURLRequestJobTest> weak_factory_; |
222 | 222 |
223 static net::URLRequestJob* job_; | 223 static net::URLRequestJob* job_; |
224 }; | 224 }; |
225 | 225 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 CreateDirectory("foo"); | 286 CreateDirectory("foo"); |
287 TestRequestNoRun(CreateFileSystemURL("foo/")); | 287 TestRequestNoRun(CreateFileSystemURL("foo/")); |
288 // Run StartAsync() and only StartAsync(). | 288 // Run StartAsync() and only StartAsync(). |
289 MessageLoop::current()->DeleteSoon(FROM_HERE, request_.release()); | 289 MessageLoop::current()->DeleteSoon(FROM_HERE, request_.release()); |
290 MessageLoop::current()->RunAllPending(); | 290 MessageLoop::current()->RunAllPending(); |
291 // If we get here, success! we didn't crash! | 291 // If we get here, success! we didn't crash! |
292 } | 292 } |
293 | 293 |
294 } // namespace (anonymous) | 294 } // namespace (anonymous) |
295 } // namespace fileapi | 295 } // namespace fileapi |
OLD | NEW |