Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Side by Side Diff: webkit/fileapi/local_file_system_cross_operation_unittest.cc

Issue 14096022: Make MountPointProvider pluggable from outside webkit/fileapi (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 <map> 5 #include <map>
6 #include <queue> 6 #include <queue>
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/files/scoped_temp_dir.h" 10 #include "base/files/scoped_temp_dir.h"
11 #include "base/message_loop.h" 11 #include "base/message_loop.h"
12 #include "base/run_loop.h" 12 #include "base/run_loop.h"
13 #include "base/stl_util.h" 13 #include "base/stl_util.h"
14 #include "testing/gtest/include/gtest/gtest.h" 14 #include "testing/gtest/include/gtest/gtest.h"
15 #include "webkit/fileapi/async_file_test_helper.h" 15 #include "webkit/fileapi/async_file_test_helper.h"
16 #include "webkit/fileapi/external_mount_points.h" 16 #include "webkit/fileapi/external_mount_points.h"
17 #include "webkit/fileapi/file_system_context.h" 17 #include "webkit/fileapi/file_system_context.h"
18 #include "webkit/fileapi/file_system_mount_point_provider.h" 18 #include "webkit/fileapi/file_system_mount_point_provider.h"
19 #include "webkit/fileapi/file_system_operation.h" 19 #include "webkit/fileapi/file_system_operation.h"
20 #include "webkit/fileapi/file_system_task_runners.h" 20 #include "webkit/fileapi/file_system_task_runners.h"
21 #include "webkit/fileapi/file_system_url.h" 21 #include "webkit/fileapi/file_system_url.h"
22 #include "webkit/fileapi/file_system_util.h" 22 #include "webkit/fileapi/file_system_util.h"
23 #include "webkit/fileapi/mock_file_system_options.h" 23 #include "webkit/fileapi/mock_file_system_options.h"
24 #include "webkit/fileapi/test_file_set.h" 24 #include "webkit/fileapi/test_file_set.h"
25 #include "webkit/quota/mock_quota_manager.h" 25 #include "webkit/quota/mock_quota_manager.h"
26 #include "webkit/quota/mock_special_storage_policy.h"
27 #include "webkit/quota/quota_manager.h" 26 #include "webkit/quota/quota_manager.h"
28 27
29 namespace fileapi { 28 namespace fileapi {
30 29
31 typedef FileSystemOperation::FileEntryList FileEntryList; 30 typedef FileSystemOperation::FileEntryList FileEntryList;
32 31
33 class CrossOperationTestHelper { 32 class CrossOperationTestHelper {
34 public: 33 public:
35 CrossOperationTestHelper( 34 CrossOperationTestHelper(
36 const GURL& origin, 35 const GURL& origin,
(...skipping 17 matching lines...) Expand all
54 quota_manager_ = new quota::MockQuotaManager( 53 quota_manager_ = new quota::MockQuotaManager(
55 false /* is_incognito */, base_dir, 54 false /* is_incognito */, base_dir,
56 base::MessageLoopProxy::current(), 55 base::MessageLoopProxy::current(),
57 base::MessageLoopProxy::current(), 56 base::MessageLoopProxy::current(),
58 NULL /* special storage policy */); 57 NULL /* special storage policy */);
59 quota_manager_proxy_ = new quota::MockQuotaManagerProxy( 58 quota_manager_proxy_ = new quota::MockQuotaManagerProxy(
60 quota_manager_, 59 quota_manager_,
61 base::MessageLoopProxy::current()); 60 base::MessageLoopProxy::current());
62 file_system_context_ = new FileSystemContext( 61 file_system_context_ = new FileSystemContext(
63 FileSystemTaskRunners::CreateMockTaskRunners(), 62 FileSystemTaskRunners::CreateMockTaskRunners(),
64 ExternalMountPoints::CreateRefCounted().get(),
65 make_scoped_refptr(new quota::MockSpecialStoragePolicy),
66 quota_manager_proxy_, 63 quota_manager_proxy_,
64 ScopedVector<FileSystemMountPointProvider>(),
65 std::vector<MountPoints*>(),
67 base_dir, 66 base_dir,
68 CreateAllowFileAccessOptions()); 67 CreateAllowFileAccessOptions());
69 68
70 // Prepare the origin's root directory. 69 // Prepare the origin's root directory.
71 FileSystemMountPointProvider* mount_point_provider = 70 FileSystemMountPointProvider* mount_point_provider =
72 file_system_context_->GetMountPointProvider(src_type_); 71 file_system_context_->GetMountPointProvider(src_type_);
73 mount_point_provider->GetFileSystemRootPathOnFileThread( 72 mount_point_provider->GetFileSystemRootPathOnFileThread(
74 SourceURL(std::string()), true /* create */); 73 SourceURL(std::string()), true /* create */);
75 mount_point_provider = 74 mount_point_provider =
76 file_system_context_->GetMountPointProvider(dest_type_); 75 file_system_context_->GetMountPointProvider(dest_type_);
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 test::kRegularTestCaseSize); 413 test::kRegularTestCaseSize);
415 414
416 int64 src_new_usage = helper.GetSourceUsage(); 415 int64 src_new_usage = helper.GetSourceUsage();
417 ASSERT_EQ(src_initial_usage, src_new_usage); 416 ASSERT_EQ(src_initial_usage, src_new_usage);
418 417
419 int64 dest_increase = helper.GetDestUsage() - dest_initial_usage; 418 int64 dest_increase = helper.GetDestUsage() - dest_initial_usage;
420 ASSERT_EQ(src_increase, dest_increase); 419 ASSERT_EQ(src_increase, dest_increase);
421 } 420 }
422 421
423 } // namespace fileapi 422 } // namespace fileapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698