OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // NOTE: These tests are run as part of "unit_tests" (in chrome/test/unit) | 5 // NOTE: These tests are run as part of "unit_tests" (in chrome/test/unit) |
6 // rather than as part of test_shell_tests because they rely on being able | 6 // rather than as part of test_shell_tests because they rely on being able |
7 // to instantiate a MessageLoop of type TYPE_IO. test_shell_tests uses | 7 // to instantiate a MessageLoop of type TYPE_IO. test_shell_tests uses |
8 // TYPE_UI, which URLRequest doesn't allow. | 8 // TYPE_UI, which URLRequest doesn't allow. |
9 // | 9 // |
10 | 10 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 class FileSystemDirURLRequestJobTest : public testing::Test { | 61 class FileSystemDirURLRequestJobTest : public testing::Test { |
62 protected: | 62 protected: |
63 FileSystemDirURLRequestJobTest() | 63 FileSystemDirURLRequestJobTest() |
64 : message_loop_(MessageLoop::TYPE_IO), // simulate an IO thread | 64 : message_loop_(MessageLoop::TYPE_IO), // simulate an IO thread |
65 ALLOW_THIS_IN_INITIALIZER_LIST(callback_factory_(this)) { | 65 ALLOW_THIS_IN_INITIALIZER_LIST(callback_factory_(this)) { |
66 } | 66 } |
67 | 67 |
68 virtual void SetUp() { | 68 virtual void SetUp() { |
69 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 69 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
70 | 70 |
71 file_thread_proxy_ = base::MessageLoopProxy::CreateForCurrentThread(); | 71 file_thread_proxy_ = base::MessageLoopProxy::current(); |
72 | 72 |
73 special_storage_policy_ = new TestSpecialStoragePolicy(); | 73 special_storage_policy_ = new TestSpecialStoragePolicy(); |
74 file_system_context_ = | 74 file_system_context_ = |
75 new FileSystemContext( | 75 new FileSystemContext( |
76 base::MessageLoopProxy::CreateForCurrentThread(), | 76 base::MessageLoopProxy::current(), |
77 base::MessageLoopProxy::CreateForCurrentThread(), | 77 base::MessageLoopProxy::current(), |
78 special_storage_policy_, NULL, | 78 special_storage_policy_, NULL, |
79 FilePath(), false /* is_incognito */, | 79 FilePath(), false /* is_incognito */, |
80 false, true, | 80 false, true, |
81 new FileSystemPathManager( | 81 new FileSystemPathManager( |
82 file_thread_proxy_, temp_dir_.path(), | 82 file_thread_proxy_, temp_dir_.path(), |
83 NULL, false, false)); | 83 NULL, false, false)); |
84 | 84 |
85 file_system_context_->path_manager()->ValidateFileSystemRootAndGetURL( | 85 file_system_context_->path_manager()->ValidateFileSystemRootAndGetURL( |
86 GURL("http://remote/"), kFileSystemTypeTemporary, true, // create | 86 GURL("http://remote/"), kFileSystemTypeTemporary, true, // create |
87 callback_factory_.NewCallback( | 87 callback_factory_.NewCallback( |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 MessageLoop::current()->PostTask(FROM_HERE, new QuitNowTask); | 310 MessageLoop::current()->PostTask(FROM_HERE, new QuitNowTask); |
311 MessageLoop::current()->Run(); | 311 MessageLoop::current()->Run(); |
312 | 312 |
313 request_.reset(); | 313 request_.reset(); |
314 MessageLoop::current()->RunAllPending(); | 314 MessageLoop::current()->RunAllPending(); |
315 // If we get here, success! we didn't crash! | 315 // If we get here, success! we didn't crash! |
316 } | 316 } |
317 | 317 |
318 } // namespace (anonymous) | 318 } // namespace (anonymous) |
319 } // namespace fileapi | 319 } // namespace fileapi |
OLD | NEW |