diff options
author | alecflett@chromium.org <alecflett@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-31 18:33:10 +0000 |
---|---|---|
committer | alecflett@chromium.org <alecflett@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-31 18:33:10 +0000 |
commit | 72a4183d70318e68f3733ff68c52c119c0aa367f (patch) | |
tree | d035d1309cfb228f9e45d712de4dc1165fad326e /content/browser/indexed_db/indexed_db_unittest.cc | |
parent | e886333604b9eedf2d011b33673c82dc4a20575a (diff) | |
download | chromium_src-72a4183d70318e68f3733ff68c52c119c0aa367f.zip chromium_src-72a4183d70318e68f3733ff68c52c119c0aa367f.tar.gz chromium_src-72a4183d70318e68f3733ff68c52c119c0aa367f.tar.bz2 |
Migrate the IndexedDB backend from Blink to Chromium
To get the IDB backend off the (deprecated) WebKit thread, remove
intermediate proxying, and let us take advantage of base utilities,
we're moving the code from Blink to Chromium.
This patch is basically a glorified copy/paste of the Blink IDB
backend code, with Chromium coding style applied, WTF dependencies
replaced with STL and base/, redundant classes removed, etc. It
introduces some new temporary proxy classes
(content/browser/webidb*_impl.*) to allow us build both the old and
new backends.
The new backend is currently disabled by default. It can be enabled
using a new (and temporary) command line switch: --new-indexeddb Once
we've done some further cleanup and are confident that the new backend
is stable, and the bots have moved from DumpRenderTree to
content_shell, we'll switch to the new backend by default. Once that
has survived through a dev channel release, we'll delete the Blink
code and eliminate unnecessary proxy classes.
BUG=234278
R=alecflett@chromium.org, dgrogan@chromium.org, piman@chromium.org
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=202215
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=202604
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=203164
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=203257
Review URL: https://codereview.chromium.org/15564008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@203443 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/indexed_db/indexed_db_unittest.cc')
-rw-r--r-- | content/browser/indexed_db/indexed_db_unittest.cc | 34 |
1 files changed, 13 insertions, 21 deletions
diff --git a/content/browser/indexed_db/indexed_db_unittest.cc b/content/browser/indexed_db/indexed_db_unittest.cc index d4a9fb9..9e90b8a 100644 --- a/content/browser/indexed_db/indexed_db_unittest.cc +++ b/content/browser/indexed_db/indexed_db_unittest.cc @@ -55,10 +55,9 @@ TEST_F(IndexedDBTest, ClearSessionOnlyDatabases) { // Create some indexedDB paths. // With the levelDB backend, these are directories. - IndexedDBContextImpl* idb_context = - static_cast<IndexedDBContextImpl*>( - BrowserContext::GetDefaultStoragePartition(&browser_context)-> - GetIndexedDBContext()); + IndexedDBContextImpl* idb_context = static_cast<IndexedDBContextImpl*>( + BrowserContext::GetDefaultStoragePartition(&browser_context) + ->GetIndexedDBContext()); // Override the storage policy with our own. idb_context->special_storage_policy_ = special_storage_policy; @@ -99,10 +98,9 @@ TEST_F(IndexedDBTest, SetForceKeepSessionState) { // Create some indexedDB paths. // With the levelDB backend, these are directories. - IndexedDBContextImpl* idb_context = - static_cast<IndexedDBContextImpl*>( - BrowserContext::GetDefaultStoragePartition(&browser_context)-> - GetIndexedDBContext()); + IndexedDBContextImpl* idb_context = static_cast<IndexedDBContextImpl*>( + BrowserContext::GetDefaultStoragePartition(&browser_context) + ->GetIndexedDBContext()); // Override the storage policy with our own. idb_context->special_storage_policy_ = special_storage_policy; @@ -128,20 +126,16 @@ TEST_F(IndexedDBTest, SetForceKeepSessionState) { EXPECT_TRUE(file_util::DirectoryExists(session_only_path)); } -class MockWebIDBDatabase : public WebKit::WebIDBDatabase -{ +class MockWebIDBDatabase : public WebKit::WebIDBDatabase { public: MockWebIDBDatabase(bool expect_force_close) - : expect_force_close_(expect_force_close), - force_close_called_(false) {} + : expect_force_close_(expect_force_close), force_close_called_(false) {} - virtual ~MockWebIDBDatabase() - { + virtual ~MockWebIDBDatabase() { EXPECT_TRUE(force_close_called_ == expect_force_close_); } - virtual void forceClose() - { + virtual void forceClose() { ASSERT_TRUE(expect_force_close_); force_close_called_ = true; } @@ -151,7 +145,6 @@ class MockWebIDBDatabase : public WebKit::WebIDBDatabase bool force_close_called_; }; - TEST_F(IndexedDBTest, ForceCloseOpenDatabasesOnDelete) { base::ScopedTempDir temp_dir; ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); @@ -165,10 +158,9 @@ TEST_F(IndexedDBTest, ForceCloseOpenDatabasesOnDelete) { const GURL kTestOrigin("http://test/"); - IndexedDBContextImpl* idb_context = - static_cast<IndexedDBContextImpl*>( - BrowserContext::GetDefaultStoragePartition(&browser_context)-> - GetIndexedDBContext()); + IndexedDBContextImpl* idb_context = static_cast<IndexedDBContextImpl*>( + BrowserContext::GetDefaultStoragePartition(&browser_context) + ->GetIndexedDBContext()); idb_context->quota_manager_proxy_ = NULL; idb_context->set_data_path_for_testing(temp_dir.path()); |