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

Side by Side Diff: webkit/browser/fileapi/copy_or_move_operation_delegate_unittest.cc

Issue 19092002: FileAPI: Change FileSystemBackend::OpenFileSystem signature (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 5 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"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 base::MessageLoopProxy::current().get(), 65 base::MessageLoopProxy::current().get(),
66 NULL /* special storage policy */); 66 NULL /* special storage policy */);
67 quota_manager_proxy_ = new quota::MockQuotaManagerProxy( 67 quota_manager_proxy_ = new quota::MockQuotaManagerProxy(
68 quota_manager_.get(), base::MessageLoopProxy::current().get()); 68 quota_manager_.get(), base::MessageLoopProxy::current().get());
69 file_system_context_ = 69 file_system_context_ =
70 CreateFileSystemContextForTesting(quota_manager_proxy_.get(), base_dir); 70 CreateFileSystemContextForTesting(quota_manager_proxy_.get(), base_dir);
71 71
72 // Prepare the origin's root directory. 72 // Prepare the origin's root directory.
73 FileSystemBackend* mount_point_provider = 73 FileSystemBackend* mount_point_provider =
74 file_system_context_->GetFileSystemBackend(src_type_); 74 file_system_context_->GetFileSystemBackend(src_type_);
75 mount_point_provider->OpenFileSystem( 75 mount_point_provider->InitializeFileSystem(
76 origin_, src_type_, 76 origin_, src_type_,
77 OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT, 77 OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT,
78 NULL /* context */,
78 base::Bind(&ExpectOk)); 79 base::Bind(&ExpectOk));
79 mount_point_provider = 80 mount_point_provider =
80 file_system_context_->GetFileSystemBackend(dest_type_); 81 file_system_context_->GetFileSystemBackend(dest_type_);
81 mount_point_provider->OpenFileSystem( 82 mount_point_provider->InitializeFileSystem(
82 origin_, dest_type_, 83 origin_, dest_type_,
83 OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT, 84 OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT,
85 NULL /* context */,
84 base::Bind(&ExpectOk)); 86 base::Bind(&ExpectOk));
85 base::MessageLoop::current()->RunUntilIdle(); 87 base::MessageLoop::current()->RunUntilIdle();
86 88
87 // Grant relatively big quota initially. 89 // Grant relatively big quota initially.
88 quota_manager_->SetQuota(origin_, 90 quota_manager_->SetQuota(origin_,
89 FileSystemTypeToQuotaStorageType(src_type_), 91 FileSystemTypeToQuotaStorageType(src_type_),
90 1024 * 1024); 92 1024 * 1024);
91 quota_manager_->SetQuota(origin_, 93 quota_manager_->SetQuota(origin_,
92 FileSystemTypeToQuotaStorageType(dest_type_), 94 FileSystemTypeToQuotaStorageType(dest_type_),
93 1024 * 1024); 95 1024 * 1024);
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 test::kRegularTestCaseSize); 424 test::kRegularTestCaseSize);
423 425
424 int64 src_new_usage = helper.GetSourceUsage(); 426 int64 src_new_usage = helper.GetSourceUsage();
425 ASSERT_EQ(src_initial_usage, src_new_usage); 427 ASSERT_EQ(src_initial_usage, src_new_usage);
426 428
427 int64 dest_increase = helper.GetDestUsage() - dest_initial_usage; 429 int64 dest_increase = helper.GetDestUsage() - dest_initial_usage;
428 ASSERT_EQ(src_increase, dest_increase); 430 ASSERT_EQ(src_increase, dest_increase);
429 } 431 }
430 432
431 } // namespace fileapi 433 } // namespace fileapi
OLDNEW
« no previous file with comments | « webkit/browser/fileapi/copy_or_move_file_validator_unittest.cc ('k') | webkit/browser/fileapi/file_system_backend.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698