OLD | NEW |
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 <stdint.h> | 5 #include <stdint.h> |
6 #include <string> | 6 #include <string> |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
11 #include "base/files/scoped_temp_dir.h" | 11 #include "base/files/scoped_temp_dir.h" |
12 #include "base/format_macros.h" | 12 #include "base/format_macros.h" |
13 #include "base/location.h" | 13 #include "base/location.h" |
14 #include "base/memory/scoped_vector.h" | 14 #include "base/memory/scoped_vector.h" |
15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
16 #include "base/run_loop.h" | 16 #include "base/run_loop.h" |
| 17 #include "base/single_thread_task_runner.h" |
17 #include "base/strings/string_piece.h" | 18 #include "base/strings/string_piece.h" |
18 #include "base/strings/utf_string_conversions.h" | 19 #include "base/strings/utf_string_conversions.h" |
19 #include "base/threading/thread_task_runner_handle.h" | 20 #include "base/threading/thread_task_runner_handle.h" |
20 #include "build/build_config.h" | 21 #include "build/build_config.h" |
21 #include "content/public/test/mock_special_storage_policy.h" | 22 #include "content/public/test/mock_special_storage_policy.h" |
22 #include "content/public/test/test_file_system_backend.h" | 23 #include "content/public/test/test_file_system_backend.h" |
23 #include "content/public/test/test_file_system_context.h" | 24 #include "content/public/test/test_file_system_context.h" |
24 #include "net/base/net_errors.h" | 25 #include "net/base/net_errors.h" |
25 #include "net/base/request_priority.h" | 26 #include "net/base/request_priority.h" |
26 #include "net/http/http_request_headers.h" | 27 #include "net/http/http_request_headers.h" |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 TestRequest(CreateFileSystemURL("somedir/")); | 362 TestRequest(CreateFileSystemURL("somedir/")); |
362 ASSERT_FALSE(request_->is_pending()); | 363 ASSERT_FALSE(request_->is_pending()); |
363 ASSERT_FALSE(request_->status().is_success()); | 364 ASSERT_FALSE(request_->status().is_success()); |
364 EXPECT_EQ(net::ERR_FILE_NOT_FOUND, request_->status().error()); | 365 EXPECT_EQ(net::ERR_FILE_NOT_FOUND, request_->status().error()); |
365 } | 366 } |
366 | 367 |
367 TEST_F(FileSystemDirURLRequestJobTest, Cancel) { | 368 TEST_F(FileSystemDirURLRequestJobTest, Cancel) { |
368 CreateDirectory("foo"); | 369 CreateDirectory("foo"); |
369 TestRequestNoRun(CreateFileSystemURL("foo/")); | 370 TestRequestNoRun(CreateFileSystemURL("foo/")); |
370 // Run StartAsync() and only StartAsync(). | 371 // Run StartAsync() and only StartAsync(). |
371 base::MessageLoop::current()->DeleteSoon(FROM_HERE, request_.release()); | 372 base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, |
| 373 request_.release()); |
372 base::RunLoop().RunUntilIdle(); | 374 base::RunLoop().RunUntilIdle(); |
373 // If we get here, success! we didn't crash! | 375 // If we get here, success! we didn't crash! |
374 } | 376 } |
375 | 377 |
376 TEST_F(FileSystemDirURLRequestJobTest, Incognito) { | 378 TEST_F(FileSystemDirURLRequestJobTest, Incognito) { |
377 CreateDirectory("foo"); | 379 CreateDirectory("foo"); |
378 | 380 |
379 scoped_refptr<FileSystemContext> file_system_context = | 381 scoped_refptr<FileSystemContext> file_system_context = |
380 CreateIncognitoFileSystemContextForTesting(NULL, temp_dir_.path()); | 382 CreateIncognitoFileSystemContextForTesting(NULL, temp_dir_.path()); |
381 | 383 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 ASSERT_FALSE(request_->status().is_success()); | 455 ASSERT_FALSE(request_->status().is_success()); |
454 EXPECT_EQ(net::ERR_FILE_NOT_FOUND, request_->status().error()); | 456 EXPECT_EQ(net::ERR_FILE_NOT_FOUND, request_->status().error()); |
455 | 457 |
456 ASSERT_FALSE( | 458 ASSERT_FALSE( |
457 storage::ExternalMountPoints::GetSystemInstance()->RevokeFileSystem( | 459 storage::ExternalMountPoints::GetSystemInstance()->RevokeFileSystem( |
458 kValidExternalMountPoint)); | 460 kValidExternalMountPoint)); |
459 } | 461 } |
460 | 462 |
461 } // namespace | 463 } // namespace |
462 } // namespace content | 464 } // namespace content |
OLD | NEW |