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 "base/stl_util.h" | 5 #include "base/stl_util.h" |
6 #include "testing/gtest/include/gtest/gtest.h" | 6 #include "testing/gtest/include/gtest/gtest.h" |
7 #include "webkit/browser/fileapi/file_system_context.h" | 7 #include "webkit/browser/fileapi/file_system_context.h" |
8 #include "webkit/browser/fileapi/file_system_file_util.h" | 8 #include "webkit/browser/fileapi/file_system_file_util.h" |
9 #include "webkit/browser/fileapi/file_system_operation_context.h" | 9 #include "webkit/browser/fileapi/file_system_operation_context.h" |
10 #include "webkit/browser/fileapi/file_system_task_runners.h" | 10 #include "webkit/browser/fileapi/file_system_task_runners.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 : file_system_(GURL("http://example.com/"), "test", | 36 : file_system_(GURL("http://example.com/"), "test", |
37 base::MessageLoopProxy::current(), | 37 base::MessageLoopProxy::current(), |
38 base::MessageLoopProxy::current()), | 38 base::MessageLoopProxy::current()), |
39 weak_factory_(this) {} | 39 weak_factory_(this) {} |
40 | 40 |
41 virtual void SetUp() { | 41 virtual void SetUp() { |
42 file_system_.SetUp(); | 42 file_system_.SetUp(); |
43 | 43 |
44 sync_context_ = new LocalFileSyncContext(base::MessageLoopProxy::current(), | 44 sync_context_ = new LocalFileSyncContext(base::MessageLoopProxy::current(), |
45 base::MessageLoopProxy::current()); | 45 base::MessageLoopProxy::current()); |
46 ASSERT_EQ(sync_file_system::SYNC_STATUS_OK, | 46 ASSERT_EQ( |
47 file_system_.MaybeInitializeFileSystemContext(sync_context_)); | 47 sync_file_system::SYNC_STATUS_OK, |
| 48 file_system_.MaybeInitializeFileSystemContext(sync_context_.get())); |
48 } | 49 } |
49 | 50 |
50 virtual void TearDown() { | 51 virtual void TearDown() { |
51 if (sync_context_) | 52 if (sync_context_.get()) |
52 sync_context_->ShutdownOnUIThread(); | 53 sync_context_->ShutdownOnUIThread(); |
53 sync_context_ = NULL; | 54 sync_context_ = NULL; |
54 | 55 |
55 file_system_.TearDown(); | 56 file_system_.TearDown(); |
56 | 57 |
57 // Make sure we don't leave the external filesystem. | 58 // Make sure we don't leave the external filesystem. |
58 // (CannedSyncableFileSystem::TearDown does not do this as there may be | 59 // (CannedSyncableFileSystem::TearDown does not do this as there may be |
59 // multiple syncable file systems registered for the name) | 60 // multiple syncable file systems registered for the name) |
60 RevokeSyncableFileSystem("test"); | 61 RevokeSyncableFileSystem("test"); |
61 } | 62 } |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 | 276 |
276 // Now try copying the directory into the syncable file system, which should | 277 // Now try copying the directory into the syncable file system, which should |
277 // fail if directory operation is disabled. (http://crbug.com/161442) | 278 // fail if directory operation is disabled. (http://crbug.com/161442) |
278 EXPECT_NE(base::PLATFORM_FILE_OK, | 279 EXPECT_NE(base::PLATFORM_FILE_OK, |
279 file_system_.Copy(kSrcDir, URL("dest"))); | 280 file_system_.Copy(kSrcDir, URL("dest"))); |
280 | 281 |
281 other_file_system_.TearDown(); | 282 other_file_system_.TearDown(); |
282 } | 283 } |
283 | 284 |
284 } // namespace sync_file_system | 285 } // namespace sync_file_system |
OLD | NEW |