summaryrefslogtreecommitdiffstats
path: root/content/browser/indexed_db/indexed_db_unittest.cc
diff options
context:
space:
mode:
authorxiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-25 15:52:21 +0000
committerxiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-25 15:52:21 +0000
commit45c56d58e1fa736d57fb8bc9deaed44123386ade (patch)
treee95daacf0a64e86b2e5e26eae3e93cc54f2b5d5a /content/browser/indexed_db/indexed_db_unittest.cc
parentfa9488c4e362d6e649df95bb55ce75b13a7f5fd6 (diff)
downloadchromium_src-45c56d58e1fa736d57fb8bc9deaed44123386ade.zip
chromium_src-45c56d58e1fa736d57fb8bc9deaed44123386ade.tar.gz
chromium_src-45c56d58e1fa736d57fb8bc9deaed44123386ade.tar.bz2
Revert 202215 "Migrate the IndexedDB backend from Blink to Chromium"
> 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 > > Review URL: https://codereview.chromium.org/15564008 TBR=jsbell@chromium.org Review URL: https://codereview.chromium.org/15870003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@202302 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.cc34
1 files changed, 21 insertions, 13 deletions
diff --git a/content/browser/indexed_db/indexed_db_unittest.cc b/content/browser/indexed_db/indexed_db_unittest.cc
index 93bd9f8..e45f4b4 100644
--- a/content/browser/indexed_db/indexed_db_unittest.cc
+++ b/content/browser/indexed_db/indexed_db_unittest.cc
@@ -55,9 +55,10 @@ 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;
@@ -98,9 +99,10 @@ 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;
@@ -126,16 +128,20 @@ 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;
}
@@ -145,6 +151,7 @@ class MockWebIDBDatabase : public WebKit::WebIDBDatabase {
bool force_close_called_;
};
+
TEST_F(IndexedDBTest, ForceCloseOpenDatabasesOnDelete) {
base::ScopedTempDir temp_dir;
ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
@@ -158,9 +165,10 @@ 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());