diff options
author | pilgrim@chromium.org <pilgrim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-09 00:21:41 +0000 |
---|---|---|
committer | pilgrim@chromium.org <pilgrim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-09 00:21:41 +0000 |
commit | 4cc6b457e5cdebb448603410054fe4d9164ce18b (patch) | |
tree | 4f21df370f1d004008a00ef090f08945051fec95 | |
parent | f6824cadc9cd083edd146120622e8e6184d105ef (diff) | |
download | chromium_src-4cc6b457e5cdebb448603410054fe4d9164ce18b.zip chromium_src-4cc6b457e5cdebb448603410054fe4d9164ce18b.tar.gz chromium_src-4cc6b457e5cdebb448603410054fe4d9164ce18b.tar.bz2 |
Move mock_quota_manager and friends from webkit/ to content/
BUG=338338
TBR=darin@chromium.org
Review URL: https://codereview.chromium.org/214233005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@262569 0039d316-1c4b-4281-b951-d872f2087c98
16 files changed, 104 insertions, 73 deletions
diff --git a/chrome/chrome_tests_unit.gypi b/chrome/chrome_tests_unit.gypi index 18cbd2bd..8b69e9c 100644 --- a/chrome/chrome_tests_unit.gypi +++ b/chrome/chrome_tests_unit.gypi @@ -282,10 +282,6 @@ 'test/ppapi/ppapi_test.h', '../ui/gfx/image/image_unittest_util.cc', '../ui/gfx/image/image_unittest_util.h', - '../webkit/browser/quota/mock_quota_manager.cc', - '../webkit/browser/quota/mock_quota_manager.h', - '../webkit/browser/quota/mock_quota_manager_proxy.cc', - '../webkit/browser/quota/mock_quota_manager_proxy.h', '../webkit/browser/quota/mock_special_storage_policy.cc', '../webkit/browser/quota/mock_special_storage_policy.h', ], diff --git a/webkit/browser/appcache/appcache_storage_unittest.cc b/content/browser/appcache/appcache_storage_unittest.cc index 8145f13..f1b7d14 100644 --- a/webkit/browser/appcache/appcache_storage_unittest.cc +++ b/content/browser/appcache/appcache_storage_unittest.cc @@ -1,17 +1,24 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "base/message_loop/message_loop.h" +#include "content/browser/quota/mock_quota_manager_proxy.h" #include "testing/gtest/include/gtest/gtest.h" #include "webkit/browser/appcache/appcache.h" #include "webkit/browser/appcache/appcache_group.h" #include "webkit/browser/appcache/appcache_response.h" #include "webkit/browser/appcache/appcache_storage.h" #include "webkit/browser/appcache/mock_appcache_service.h" -#include "webkit/browser/quota/mock_quota_manager_proxy.h" -namespace appcache { +using appcache::AppCache; +using appcache::AppCacheGroup; +using appcache::AppCacheResponseInfo; +using appcache::AppCacheStorage; +using appcache::kUnkownResponseDataSize; +using appcache::MockAppCacheService; + +namespace content { namespace { const quota::StorageType kTemp = quota::kStorageTypeTemporary; @@ -118,8 +125,8 @@ TEST_F(AppCacheStorageTest, UsageMap) { const GURL kOrigin2("http://origin2/"); MockAppCacheService service; - scoped_refptr<quota::MockQuotaManagerProxy> mock_proxy( - new quota::MockQuotaManagerProxy(NULL, NULL)); + scoped_refptr<MockQuotaManagerProxy> mock_proxy( + new MockQuotaManagerProxy(NULL, NULL)); service.set_quota_manager_proxy(mock_proxy.get()); service.storage()->UpdateUsageMapAndNotify(kOrigin, 0); @@ -162,4 +169,4 @@ TEST_F(AppCacheStorageTest, UsageMap) { EXPECT_TRUE(service.storage()->usage_map_.empty()); } -} // namespace appcache +} // namespace content diff --git a/content/browser/fileapi/copy_or_move_operation_delegate_unittest.cc b/content/browser/fileapi/copy_or_move_operation_delegate_unittest.cc index d5192a8..1ddb05b 100644 --- a/content/browser/fileapi/copy_or_move_operation_delegate_unittest.cc +++ b/content/browser/fileapi/copy_or_move_operation_delegate_unittest.cc @@ -12,6 +12,8 @@ #include "base/message_loop/message_loop.h" #include "base/run_loop.h" #include "base/stl_util.h" +#include "content/browser/quota/mock_quota_manager.h" +#include "content/browser/quota/mock_quota_manager_proxy.h" #include "content/public/test/async_file_test_helper.h" #include "content/public/test/test_file_system_backend.h" #include "content/public/test/test_file_system_context.h" @@ -25,8 +27,6 @@ #include "webkit/browser/fileapi/file_system_context.h" #include "webkit/browser/fileapi/file_system_operation.h" #include "webkit/browser/fileapi/file_system_url.h" -#include "webkit/browser/quota/mock_quota_manager.h" -#include "webkit/browser/quota/mock_quota_manager_proxy.h" #include "webkit/browser/quota/quota_manager.h" #include "webkit/common/fileapi/file_system_util.h" @@ -194,12 +194,12 @@ class CopyOrMoveOperationTestHelper { ASSERT_TRUE(base_.CreateUniqueTempDir()); base::FilePath base_dir = base_.path(); quota_manager_ = - new quota::MockQuotaManager(false /* is_incognito */, + new MockQuotaManager(false /* is_incognito */, base_dir, base::MessageLoopProxy::current().get(), base::MessageLoopProxy::current().get(), NULL /* special storage policy */); - quota_manager_proxy_ = new quota::MockQuotaManagerProxy( + quota_manager_proxy_ = new MockQuotaManagerProxy( quota_manager_.get(), base::MessageLoopProxy::current().get()); file_system_context_ = CreateFileSystemContextForTesting(quota_manager_proxy_.get(), base_dir); @@ -392,8 +392,8 @@ class CopyOrMoveOperationTestHelper { base::MessageLoopForIO message_loop_; scoped_refptr<fileapi::FileSystemContext> file_system_context_; - scoped_refptr<quota::MockQuotaManagerProxy> quota_manager_proxy_; - scoped_refptr<quota::MockQuotaManager> quota_manager_; + scoped_refptr<MockQuotaManagerProxy> quota_manager_proxy_; + scoped_refptr<MockQuotaManager> quota_manager_; DISALLOW_COPY_AND_ASSIGN(CopyOrMoveOperationTestHelper); }; diff --git a/content/browser/fileapi/file_system_context_unittest.cc b/content/browser/fileapi/file_system_context_unittest.cc index ad8997d..0e6d582 100644 --- a/content/browser/fileapi/file_system_context_unittest.cc +++ b/content/browser/fileapi/file_system_context_unittest.cc @@ -7,12 +7,12 @@ #include "base/files/scoped_temp_dir.h" #include "base/message_loop/message_loop.h" #include "base/strings/stringprintf.h" +#include "content/browser/quota/mock_quota_manager.h" #include "content/public/test/test_file_system_options.h" #include "testing/gtest/include/gtest/gtest.h" #include "webkit/browser/fileapi/external_mount_points.h" #include "webkit/browser/fileapi/file_system_backend.h" #include "webkit/browser/fileapi/isolated_context.h" -#include "webkit/browser/quota/mock_quota_manager.h" #include "webkit/browser/quota/mock_special_storage_policy.h" #define FPL(x) FILE_PATH_LITERAL(x) @@ -56,7 +56,7 @@ class FileSystemContextTest : public testing::Test { storage_policy_ = new quota::MockSpecialStoragePolicy(); mock_quota_manager_ = - new quota::MockQuotaManager(false /* is_incognito */, + new MockQuotaManager(false /* is_incognito */, data_dir_.path(), base::MessageLoopProxy::current().get(), base::MessageLoopProxy::current().get(), @@ -100,7 +100,7 @@ class FileSystemContextTest : public testing::Test { base::ScopedTempDir data_dir_; base::MessageLoop message_loop_; scoped_refptr<quota::SpecialStoragePolicy> storage_policy_; - scoped_refptr<quota::MockQuotaManager> mock_quota_manager_; + scoped_refptr<MockQuotaManager> mock_quota_manager_; }; // It is not valid to pass NULL ExternalMountPoints to FileSystemContext on diff --git a/content/browser/fileapi/file_system_operation_impl_unittest.cc b/content/browser/fileapi/file_system_operation_impl_unittest.cc index 89a06978..2f8e82e 100644 --- a/content/browser/fileapi/file_system_operation_impl_unittest.cc +++ b/content/browser/fileapi/file_system_operation_impl_unittest.cc @@ -13,6 +13,8 @@ #include "base/run_loop.h" #include "base/strings/stringprintf.h" #include "content/browser/fileapi/mock_file_change_observer.h" +#include "content/browser/quota/mock_quota_manager.h" +#include "content/browser/quota/mock_quota_manager_proxy.h" #include "content/public/test/async_file_test_helper.h" #include "content/public/test/sandbox_file_system_test_helper.h" #include "testing/gtest/include/gtest/gtest.h" @@ -22,8 +24,6 @@ #include "webkit/browser/fileapi/file_system_operation_context.h" #include "webkit/browser/fileapi/file_system_operation_runner.h" #include "webkit/browser/fileapi/sandbox_file_system_backend.h" -#include "webkit/browser/quota/mock_quota_manager.h" -#include "webkit/browser/quota/mock_quota_manager_proxy.h" #include "webkit/browser/quota/quota_manager.h" #include "webkit/browser/quota/quota_manager_proxy.h" #include "webkit/common/blob/shareable_file_reference.h" @@ -68,12 +68,12 @@ class FileSystemOperationImplTest base::FilePath base_dir = base_.path().AppendASCII("filesystem"); quota_manager_ = - new quota::MockQuotaManager(false /* is_incognito */, + new MockQuotaManager(false /* is_incognito */, base_dir, base::MessageLoopProxy::current().get(), base::MessageLoopProxy::current().get(), NULL /* special storage policy */); - quota_manager_proxy_ = new quota::MockQuotaManagerProxy( + quota_manager_proxy_ = new MockQuotaManagerProxy( quota_manager(), base::MessageLoopProxy::current().get()); sandbox_file_system_.SetUp(base_dir, quota_manager_proxy_.get()); sandbox_file_system_.AddFileChangeObserver(&change_observer_); @@ -102,12 +102,12 @@ class FileSystemOperationImplTest return shareable_file_ref_.get(); } - quota::MockQuotaManager* quota_manager() { - return static_cast<quota::MockQuotaManager*>(quota_manager_.get()); + MockQuotaManager* quota_manager() { + return static_cast<MockQuotaManager*>(quota_manager_.get()); } - quota::MockQuotaManagerProxy* quota_manager_proxy() { - return static_cast<quota::MockQuotaManagerProxy*>( + MockQuotaManagerProxy* quota_manager_proxy() { + return static_cast<MockQuotaManagerProxy*>( quota_manager_proxy_.get()); } diff --git a/content/browser/fileapi/file_system_operation_impl_write_unittest.cc b/content/browser/fileapi/file_system_operation_impl_write_unittest.cc index 3d27664..47b0e2d 100644 --- a/content/browser/fileapi/file_system_operation_impl_write_unittest.cc +++ b/content/browser/fileapi/file_system_operation_impl_write_unittest.cc @@ -10,6 +10,7 @@ #include "base/message_loop/message_loop_proxy.h" #include "base/run_loop.h" #include "content/browser/fileapi/mock_file_change_observer.h" +#include "content/browser/quota/mock_quota_manager.h" #include "content/public/test/mock_blob_url_request_context.h" #include "content/public/test/test_file_system_backend.h" #include "content/public/test/test_file_system_context.h" @@ -26,7 +27,6 @@ #include "webkit/browser/fileapi/file_system_operation_context.h" #include "webkit/browser/fileapi/file_system_operation_runner.h" #include "webkit/browser/fileapi/local_file_util.h" -#include "webkit/browser/quota/mock_quota_manager.h" #include "webkit/common/blob/blob_data.h" #include "webkit/common/fileapi/file_system_util.h" @@ -67,7 +67,7 @@ class FileSystemOperationImplWriteTest ASSERT_TRUE(dir_.CreateUniqueTempDir()); quota_manager_ = - new quota::MockQuotaManager(false /* is_incognito */, + new MockQuotaManager(false /* is_incognito */, dir_.path(), base::MessageLoopProxy::current().get(), base::MessageLoopProxy::current().get(), @@ -153,7 +153,7 @@ class FileSystemOperationImplWriteTest } scoped_refptr<fileapi::FileSystemContext> file_system_context_; - scoped_refptr<quota::MockQuotaManager> quota_manager_; + scoped_refptr<MockQuotaManager> quota_manager_; base::MessageLoopForIO loop_; diff --git a/content/browser/indexed_db/indexed_db_quota_client_unittest.cc b/content/browser/indexed_db/indexed_db_quota_client_unittest.cc index ad99bed..54ce775 100644 --- a/content/browser/indexed_db/indexed_db_quota_client_unittest.cc +++ b/content/browser/indexed_db/indexed_db_quota_client_unittest.cc @@ -14,11 +14,11 @@ #include "content/browser/browser_thread_impl.h" #include "content/browser/indexed_db/indexed_db_context_impl.h" #include "content/browser/indexed_db/indexed_db_quota_client.h" +#include "content/browser/quota/mock_quota_manager.h" #include "content/public/browser/storage_partition.h" #include "content/public/test/test_browser_context.h" #include "content/public/test/test_browser_thread_bundle.h" #include "testing/gtest/include/gtest/gtest.h" -#include "webkit/browser/quota/mock_quota_manager.h" #include "webkit/common/database/database_identifier.h" // Declared to shorten the line lengths. @@ -44,7 +44,7 @@ class IndexedDBQuotaClientTest : public testing::Test { browser_context_.reset(new TestBrowserContext()); scoped_refptr<quota::QuotaManager> quota_manager = - new quota::MockQuotaManager( + new MockQuotaManager( false /*in_memory*/, browser_context_->GetPath(), base::MessageLoop::current()->message_loop_proxy(), diff --git a/webkit/browser/quota/mock_quota_manager.cc b/content/browser/quota/mock_quota_manager.cc index 8f7798f..0343f39 100644 --- a/webkit/browser/quota/mock_quota_manager.cc +++ b/content/browser/quota/mock_quota_manager.cc @@ -1,8 +1,8 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/browser/quota/mock_quota_manager.h" +#include "content/browser/quota/mock_quota_manager.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" @@ -10,7 +10,9 @@ #include "base/single_thread_task_runner.h" #include "url/gurl.h" -namespace quota { +using quota::kQuotaStatusOk; + +namespace content { MockQuotaManager::OriginInfo::OriginInfo( const GURL& origin, @@ -142,4 +144,4 @@ void MockQuotaManager::DidDeleteOriginData( callback.Run(status); } -} // namespace quota +} // namespace content diff --git a/webkit/browser/quota/mock_quota_manager.h b/content/browser/quota/mock_quota_manager.h index 1750e94..4997e1a 100644 --- a/webkit/browser/quota/mock_quota_manager.h +++ b/content/browser/quota/mock_quota_manager.h @@ -1,9 +1,9 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_BROWSER_QUOTA_MOCK_QUOTA_MANAGER_H_ -#define WEBKIT_BROWSER_QUOTA_MOCK_QUOTA_MANAGER_H_ +#ifndef CONTENT_BROWSER_QUOTA_MOCK_QUOTA_MANAGER_H_ +#define CONTENT_BROWSER_QUOTA_MOCK_QUOTA_MANAGER_H_ #include <map> #include <set> @@ -17,7 +17,15 @@ #include "webkit/browser/quota/quota_task.h" #include "webkit/common/quota/quota_types.h" -namespace quota { +using quota::GetOriginsCallback; +using quota::QuotaClient; +using quota::QuotaManager; +using quota::QuotaStatusCode; +using quota::SpecialStoragePolicy; +using quota::StatusCallback; +using quota::StorageType; + +namespace content { // Mocks the pieces of QuotaManager's interface. // @@ -141,4 +149,4 @@ class MockQuotaManager : public QuotaManager { } // namespace quota -#endif // WEBKIT_BROWSER_QUOTA_MOCK_QUOTA_MANAGER_H_ +#endif // CONTENT_BROWSER_QUOTA_MOCK_QUOTA_MANAGER_H_ diff --git a/webkit/browser/quota/mock_quota_manager_proxy.cc b/content/browser/quota/mock_quota_manager_proxy.cc index 1317919..ddeef6a 100644 --- a/webkit/browser/quota/mock_quota_manager_proxy.cc +++ b/content/browser/quota/mock_quota_manager_proxy.cc @@ -2,13 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/browser/quota/mock_quota_manager_proxy.h" +#include "content/browser/quota/mock_quota_manager_proxy.h" #include "base/message_loop/message_loop.h" #include "base/single_thread_task_runner.h" #include "url/gurl.h" -namespace quota { +using quota::kStorageTypeUnknown; + +namespace content { MockQuotaManagerProxy::MockQuotaManagerProxy( MockQuotaManager* quota_manager, @@ -56,4 +58,4 @@ MockQuotaManagerProxy::~MockQuotaManagerProxy() { DCHECK(!registered_client_); } -} // namespace quota +} // namespace content diff --git a/webkit/browser/quota/mock_quota_manager_proxy.h b/content/browser/quota/mock_quota_manager_proxy.h index dfae52e..9e8835f 100644 --- a/webkit/browser/quota/mock_quota_manager_proxy.h +++ b/content/browser/quota/mock_quota_manager_proxy.h @@ -2,16 +2,18 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_BROWSER_QUOTA_MOCK_QUOTA_MANAGER_PROXY_H_ -#define WEBKIT_BROWSER_QUOTA_MOCK_QUOTA_MANAGER_PROXY_H_ +#ifndef CONTENT_BROWSER_QUOTA_MOCK_QUOTA_MANAGER_PROXY_H_ +#define CONTENT_BROWSER_QUOTA_MOCK_QUOTA_MANAGER_PROXY_H_ +#include "content/browser/quota/mock_quota_manager.h" #include "url/gurl.h" -#include "webkit/browser/quota/mock_quota_manager.h" #include "webkit/browser/quota/quota_client.h" #include "webkit/browser/quota/quota_manager_proxy.h" #include "webkit/common/quota/quota_types.h" -namespace quota { +using quota::QuotaManagerProxy; + +namespace content { class MockQuotaManager; @@ -80,6 +82,6 @@ class MockQuotaManagerProxy : public QuotaManagerProxy { DISALLOW_COPY_AND_ASSIGN(MockQuotaManagerProxy); }; -} // namespace quota +} // namespace content -#endif // WEBKIT_BROWSER_QUOTA_MOCK_QUOTA_MANAGER_PROXY_H_ +#endif // CONTENT_BROWSER_QUOTA_MOCK_QUOTA_MANAGER_PROXY_H_ diff --git a/webkit/browser/quota/mock_quota_manager_unittest.cc b/content/browser/quota/mock_quota_manager_unittest.cc index bb4db22..9deef8d 100644 --- a/webkit/browser/quota/mock_quota_manager_unittest.cc +++ b/content/browser/quota/mock_quota_manager_unittest.cc @@ -1,4 +1,4 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -10,12 +10,17 @@ #include "base/memory/scoped_ptr.h" #include "base/message_loop/message_loop_proxy.h" #include "base/run_loop.h" +#include "content/browser/quota/mock_quota_manager.h" #include "testing/gtest/include/gtest/gtest.h" -#include "webkit/browser/quota/mock_quota_manager.h" #include "webkit/browser/quota/mock_special_storage_policy.h" #include "webkit/browser/quota/mock_storage_client.h" -namespace quota { +using quota::kQuotaStatusOk; +using quota::kStorageTypePersistent; +using quota::kStorageTypeTemporary; +using quota::MockSpecialStoragePolicy; + +namespace content { const char kTestOrigin1[] = "http://host1:1/"; const char kTestOrigin2[] = "http://host2:1/"; @@ -76,7 +81,7 @@ class MockQuotaManagerTest : public testing::Test { void DeletedOriginData(QuotaStatusCode status) { ++deletion_callback_count_; - EXPECT_EQ(quota::kQuotaStatusOk, status); + EXPECT_EQ(kQuotaStatusOk, status); } int deletion_callback_count() const { @@ -219,4 +224,4 @@ TEST_F(MockQuotaManagerTest, ModifiedOrigins) { EXPECT_EQ(0UL, origins().count(kOrigin1)); EXPECT_EQ(1UL, origins().count(kOrigin2)); } -} // Namespace quota +} // Namespace content diff --git a/content/browser/storage_partition_impl_unittest.cc b/content/browser/storage_partition_impl_unittest.cc index bc2dca8..5a8eed7 100644 --- a/content/browser/storage_partition_impl_unittest.cc +++ b/content/browser/storage_partition_impl_unittest.cc @@ -8,6 +8,7 @@ #include "base/threading/thread.h" #include "content/browser/browser_thread_impl.h" #include "content/browser/gpu/shader_disk_cache.h" +#include "content/browser/quota/mock_quota_manager.h" #include "content/browser/storage_partition_impl.h" #include "content/public/browser/local_storage_usage_info.h" #include "content/public/browser/storage_partition.h" @@ -19,7 +20,6 @@ #include "net/url_request/url_request_context.h" #include "net/url_request/url_request_context_getter.h" #include "testing/gtest/include/gtest/gtest.h" -#include "webkit/browser/quota/mock_quota_manager.h" #include "webkit/browser/quota/mock_special_storage_policy.h" #include "webkit/browser/quota/quota_manager.h" @@ -331,9 +331,9 @@ class StoragePartitionImplTest : public testing::Test { browser_context_(new TestBrowserContext()) { } - quota::MockQuotaManager* GetMockManager() { + MockQuotaManager* GetMockManager() { if (!quota_manager_.get()) { - quota_manager_ = new quota::MockQuotaManager( + quota_manager_ = new MockQuotaManager( browser_context_->IsOffTheRecord(), browser_context_->GetPath(), BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO).get(), @@ -350,7 +350,7 @@ class StoragePartitionImplTest : public testing::Test { private: content::TestBrowserThreadBundle thread_bundle_; scoped_ptr<TestBrowserContext> browser_context_; - scoped_refptr<quota::MockQuotaManager> quota_manager_; + scoped_refptr<MockQuotaManager> quota_manager_; DISALLOW_COPY_AND_ASSIGN(StoragePartitionImplTest); }; @@ -439,7 +439,7 @@ TEST_F(StoragePartitionImplTest, QuotaClientMaskGeneration) { StoragePartition::REMOVE_DATA_MASK_INDEXEDDB)); } -void PopulateTestQuotaManagedPersistentData(quota::MockQuotaManager* manager) { +void PopulateTestQuotaManagedPersistentData(MockQuotaManager* manager) { manager->AddOrigin(kOrigin2, kPersistent, kClientFile, base::Time()); manager->AddOrigin(kOrigin3, kPersistent, kClientFile, base::Time::Now() - base::TimeDelta::FromDays(1)); @@ -449,7 +449,7 @@ void PopulateTestQuotaManagedPersistentData(quota::MockQuotaManager* manager) { EXPECT_TRUE(manager->OriginHasData(kOrigin3, kPersistent, kClientFile)); } -void PopulateTestQuotaManagedTemporaryData(quota::MockQuotaManager* manager) { +void PopulateTestQuotaManagedTemporaryData(MockQuotaManager* manager) { manager->AddOrigin(kOrigin1, kTemporary, kClientFile, base::Time::Now()); manager->AddOrigin(kOrigin3, kTemporary, kClientFile, base::Time::Now() - base::TimeDelta::FromDays(1)); @@ -459,7 +459,7 @@ void PopulateTestQuotaManagedTemporaryData(quota::MockQuotaManager* manager) { EXPECT_TRUE(manager->OriginHasData(kOrigin3, kTemporary, kClientFile)); } -void PopulateTestQuotaManagedData(quota::MockQuotaManager* manager) { +void PopulateTestQuotaManagedData(MockQuotaManager* manager) { // Set up kOrigin1 with a temporary quota, kOrigin2 with a persistent // quota, and kOrigin3 with both. kOrigin1 is modified now, kOrigin2 // is modified at the beginning of time, and kOrigin3 is modified one day @@ -468,7 +468,7 @@ void PopulateTestQuotaManagedData(quota::MockQuotaManager* manager) { PopulateTestQuotaManagedTemporaryData(manager); } -void PopulateTestQuotaManagedNonBrowsingData(quota::MockQuotaManager* manager) { +void PopulateTestQuotaManagedNonBrowsingData(MockQuotaManager* manager) { manager->AddOrigin(kOriginDevTools, kTemporary, kClientFile, base::Time()); manager->AddOrigin(kOriginDevTools, kPersistent, kClientFile, base::Time()); } diff --git a/content/content_tests.gypi b/content/content_tests.gypi index b8b962b..163bc80 100644 --- a/content/content_tests.gypi +++ b/content/content_tests.gypi @@ -353,6 +353,7 @@ 'browser/appcache/appcache_host_unittest.cc', 'browser/appcache/appcache_request_handler_unittest.cc', 'browser/appcache/appcache_storage_impl_unittest.cc', + 'browser/appcache/appcache_storage_unittest.cc', 'browser/appcache/chrome_appcache_service_unittest.cc', 'browser/appcache/mock_appcache_policy.cc', 'browser/appcache/mock_appcache_policy.h', @@ -456,6 +457,11 @@ 'browser/plugin_loader_posix_unittest.cc', 'browser/power_monitor_message_broadcaster_unittest.cc', 'browser/power_profiler/power_profiler_service_unittest.cc', + 'browser/quota/mock_quota_manager.cc', + 'browser/quota/mock_quota_manager.h', + 'browser/quota/mock_quota_manager_proxy.cc', + 'browser/quota/mock_quota_manager_proxy.h', + 'browser/quota/mock_quota_manager_unittest.cc', 'browser/renderer_host/compositing_iosurface_transformer_mac_unittest.cc', 'browser/renderer_host/gtk_key_bindings_handler_unittest.cc', 'browser/renderer_host/input/gesture_event_queue_unittest.cc', @@ -616,7 +622,6 @@ '../webkit/browser/appcache/appcache_quota_client_unittest.cc', '../webkit/browser/appcache/appcache_response_unittest.cc', '../webkit/browser/appcache/appcache_service_unittest.cc', - '../webkit/browser/appcache/appcache_storage_unittest.cc', '../webkit/browser/appcache/appcache_unittest.cc', '../webkit/browser/appcache/appcache_update_job_unittest.cc', '../webkit/browser/appcache/appcache_url_request_job_unittest.cc', @@ -652,11 +657,6 @@ '../webkit/common/database/database_connections_unittest.cc', '../webkit/common/database/database_identifier_unittest.cc', '../webkit/common/fileapi/file_system_util_unittest.cc', - '../webkit/browser/quota/mock_quota_manager.cc', - '../webkit/browser/quota/mock_quota_manager.h', - '../webkit/browser/quota/mock_quota_manager_proxy.cc', - '../webkit/browser/quota/mock_quota_manager_proxy.h', - '../webkit/browser/quota/mock_quota_manager_unittest.cc', '../webkit/browser/quota/mock_special_storage_policy.cc', '../webkit/browser/quota/mock_special_storage_policy.h', '../webkit/browser/quota/mock_storage_client.cc', diff --git a/webkit/browser/appcache/appcache_storage.h b/webkit/browser/appcache/appcache_storage.h index a6bdd0e..8114461 100644 --- a/webkit/browser/appcache/appcache_storage.h +++ b/webkit/browser/appcache/appcache_storage.h @@ -19,6 +19,12 @@ class GURL; +namespace content { +FORWARD_DECLARE_TEST(AppCacheStorageTest, DelegateReferences); +FORWARD_DECLARE_TEST(AppCacheStorageTest, UsageMap); +class AppCacheStorageTest; +} + namespace appcache { class AppCache; @@ -196,7 +202,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheStorage { protected: friend class AppCacheQuotaClientTest; friend class AppCacheResponseTest; - friend class AppCacheStorageTest; + friend class content::AppCacheStorageTest; // Helper to call a collection of delegates. #define FOR_EACH_DELEGATE(delegates, func_and_args) \ @@ -311,8 +317,8 @@ class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheStorage { // The set of last ids must be retrieved from storage prior to being used. static const int64 kUnitializedId; - FRIEND_TEST_ALL_PREFIXES(AppCacheStorageTest, DelegateReferences); - FRIEND_TEST_ALL_PREFIXES(AppCacheStorageTest, UsageMap); + FRIEND_TEST_ALL_PREFIXES(content::AppCacheStorageTest, DelegateReferences); + FRIEND_TEST_ALL_PREFIXES(content::AppCacheStorageTest, UsageMap); DISALLOW_COPY_AND_ASSIGN(AppCacheStorage); }; diff --git a/webkit/browser/quota/quota_manager.h b/webkit/browser/quota/quota_manager.h index 2240e50..12108ea 100644 --- a/webkit/browser/quota/quota_manager.h +++ b/webkit/browser/quota/quota_manager.h @@ -38,9 +38,12 @@ namespace quota_internals { class QuotaInternalsProxy; } +namespace content { +class MockQuotaManager; +} + namespace quota { -class MockQuotaManager; class QuotaDatabase; class QuotaManagerProxy; class QuotaTemporaryStorageEvictor; |