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

Unified Diff: chrome/browser/browsing_data/browsing_data_file_system_helper_unittest.cc

Issue 10909182: Make FileSystemContext respect StoragePartitions. filesystem:// urls will be properly isolated (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch unittest fix from michael Created 8 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/browsing_data/browsing_data_file_system_helper_unittest.cc
diff --git a/chrome/browser/browsing_data/browsing_data_file_system_helper_unittest.cc b/chrome/browser/browsing_data/browsing_data_file_system_helper_unittest.cc
index d60e8f284df7a8a9593f52ae575b9cf26f82a759..94926b8969d67041abf19f630c5ed1d5a545334f 100644
--- a/chrome/browser/browsing_data/browsing_data_file_system_helper_unittest.cc
+++ b/chrome/browser/browsing_data/browsing_data_file_system_helper_unittest.cc
@@ -12,11 +12,15 @@
#include "base/utf_string_conversions.h"
#include "chrome/browser/browsing_data/browsing_data_file_system_helper.h"
#include "chrome/test/base/testing_profile.h"
+#include "content/public/browser/storage_partition.h"
#include "content/public/test/test_browser_thread.h"
#include "webkit/fileapi/file_system_context.h"
+#include "webkit/fileapi/file_system_task_runners.h"
#include "webkit/fileapi/file_system_types.h"
#include "webkit/fileapi/file_system_usage_cache.h"
+#include "webkit/fileapi/mock_file_system_options.h"
#include "webkit/fileapi/sandbox_mount_point_provider.h"
+#include "webkit/quota/mock_special_storage_policy.h"
using content::BrowserContext;
using content::BrowserThread;
@@ -69,7 +73,17 @@ class BrowsingDataFileSystemHelperTest : public testing::Test {
BrowserThread::FILE_USER_BLOCKING, &message_loop_),
io_thread_(BrowserThread::IO, &message_loop_) {
profile_.reset(new TestingProfile());
- helper_ = BrowsingDataFileSystemHelper::Create(profile_.get());
+
+ scoped_refptr<quota::MockSpecialStoragePolicy> special_storage_policy =
+ new quota::MockSpecialStoragePolicy();
+ file_system_context_ = new fileapi::FileSystemContext(
+ fileapi::FileSystemTaskRunners::CreateMockTaskRunners(),
+ special_storage_policy.get(),
+ NULL,
+ profile_->GetPath(),
+ fileapi::CreateAllowFileAccessOptions());
+
+ helper_ = BrowsingDataFileSystemHelper::Create(file_system_context_);
message_loop_.RunAllPending();
canned_helper_ = new CannedBrowsingDataFileSystemHelper(profile_.get());
}
@@ -148,8 +162,8 @@ class BrowsingDataFileSystemHelperTest : public testing::Test {
// Sets up kOrigin1 with a temporary file system, kOrigin2 with a persistent
// file system, and kOrigin3 with both.
virtual void PopulateTestFileSystemData() {
- sandbox_ = BrowserContext::GetFileSystemContext(profile_.get())->
- sandbox_provider();
+ sandbox_ = BrowserContext::GetDefaultStoragePartition(profile_.get())->
+ GetFileSystemContext()->sandbox_provider();
CreateDirectoryForOriginAndType(kOrigin1, kTemporary);
CreateDirectoryForOriginAndType(kOrigin2, kPersistent);
@@ -199,6 +213,7 @@ class BrowsingDataFileSystemHelperTest : public testing::Test {
content::TestBrowserThread file_user_blocking_thread_;
content::TestBrowserThread io_thread_;
scoped_ptr<TestingProfile> profile_;
+ scoped_refptr<fileapi::FileSystemContext> file_system_context_;
// We don't own this pointer: don't delete it.
fileapi::SandboxMountPointProvider* sandbox_;

Powered by Google App Engine
This is Rietveld 408576698