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

Unified Diff: content/browser/indexed_db/indexed_db_quota_client_unittest.cc

Issue 15564008: Migrate the IndexedDB backend from Blink to Chromium (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update to ToT again Created 7 years, 7 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: content/browser/indexed_db/indexed_db_quota_client_unittest.cc
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 0d8628ac7128881c3fd649d4a247ea56e7a6efb3..bcd037af6c77cf07ccecf13dfe03394c3c19efde 100644
--- a/content/browser/indexed_db/indexed_db_quota_client_unittest.cc
+++ b/content/browser/indexed_db/indexed_db_quota_client_unittest.cc
@@ -48,15 +48,15 @@ class IndexedDBQuotaClientTest : public testing::Test {
io_thread_(BrowserThread::IO, &message_loop_) {
browser_context_.reset(new TestBrowserContext());
idb_context_ = static_cast<IndexedDBContextImpl*>(
- BrowserContext::GetDefaultStoragePartition(browser_context_.get())->
- GetIndexedDBContext());
+ BrowserContext::GetDefaultStoragePartition(browser_context_.get())
+ ->GetIndexedDBContext());
message_loop_.RunUntilIdle();
setup_temp_dir();
}
void setup_temp_dir() {
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
- base::FilePath indexeddb_dir = temp_dir_.path().Append(
- IndexedDBContextImpl::kIndexedDBDirectory);
+ base::FilePath indexeddb_dir =
+ temp_dir_.path().Append(IndexedDBContextImpl::kIndexedDBDirectory);
ASSERT_TRUE(file_util::CreateDirectory(indexeddb_dir));
idb_context()->set_data_path_for_testing(indexeddb_dir);
}
@@ -71,13 +71,13 @@ class IndexedDBQuotaClientTest : public testing::Test {
base::MessageLoop::current()->RunUntilIdle();
}
- int64 GetOriginUsage(
- quota::QuotaClient* client,
- const GURL& origin,
- quota::StorageType type) {
+ int64 GetOriginUsage(quota::QuotaClient* client,
+ const GURL& origin,
+ quota::StorageType type) {
usage_ = -1;
client->GetOriginUsage(
- origin, type,
+ origin,
+ type,
base::Bind(&IndexedDBQuotaClientTest::OnGetOriginUsageComplete,
weak_factory_.GetWeakPtr()));
base::MessageLoop::current()->RunUntilIdle();
@@ -85,9 +85,8 @@ class IndexedDBQuotaClientTest : public testing::Test {
return usage_;
}
- const std::set<GURL>& GetOriginsForType(
- quota::QuotaClient* client,
- quota::StorageType type) {
+ const std::set<GURL>& GetOriginsForType(quota::QuotaClient* client,
+ quota::StorageType type) {
origins_.clear();
client->GetOriginsForType(
type,
@@ -97,13 +96,13 @@ class IndexedDBQuotaClientTest : public testing::Test {
return origins_;
}
- const std::set<GURL>& GetOriginsForHost(
- quota::QuotaClient* client,
- quota::StorageType type,
- const std::string& host) {
+ const std::set<GURL>& GetOriginsForHost(quota::QuotaClient* client,
+ quota::StorageType type,
+ const std::string& host) {
origins_.clear();
client->GetOriginsForHost(
- type, host,
+ type,
+ host,
base::Bind(&IndexedDBQuotaClientTest::OnGetOriginsComplete,
weak_factory_.GetWeakPtr()));
base::MessageLoop::current()->RunUntilIdle();
@@ -114,7 +113,8 @@ class IndexedDBQuotaClientTest : public testing::Test {
const GURL& origin_url) {
delete_status_ = quota::kQuotaStatusUnknown;
client->DeleteOriginData(
- origin_url, kTemp,
+ origin_url,
+ kTemp,
base::Bind(&IndexedDBQuotaClientTest::OnDeleteOriginComplete,
weak_factory_.GetWeakPtr()));
base::MessageLoop::current()->RunUntilIdle();
@@ -141,9 +141,7 @@ class IndexedDBQuotaClientTest : public testing::Test {
}
private:
- void OnGetOriginUsageComplete(int64 usage) {
- usage_ = usage;
- }
+ void OnGetOriginUsageComplete(int64 usage) { usage_ = usage; }
void OnGetOriginsComplete(const std::set<GURL>& origins) {
origins_ = origins;
@@ -169,9 +167,7 @@ class IndexedDBQuotaClientTest : public testing::Test {
};
TEST_F(IndexedDBQuotaClientTest, GetOriginUsage) {
- IndexedDBQuotaClient client(
- base::MessageLoopProxy::current(),
- idb_context());
+ IndexedDBQuotaClient client(base::MessageLoopProxy::current(), idb_context());
AddFakeIndexedDB(kOriginA, 6);
AddFakeIndexedDB(kOriginB, 3);
@@ -188,9 +184,7 @@ TEST_F(IndexedDBQuotaClientTest, GetOriginUsage) {
}
TEST_F(IndexedDBQuotaClientTest, GetOriginsForHost) {
- IndexedDBQuotaClient client(
- base::MessageLoopProxy::current(),
- idb_context());
+ IndexedDBQuotaClient client(base::MessageLoopProxy::current(), idb_context());
EXPECT_EQ(kOriginA.host(), kOriginB.host());
EXPECT_NE(kOriginA.host(), kOriginOther.host());
@@ -214,9 +208,7 @@ TEST_F(IndexedDBQuotaClientTest, GetOriginsForHost) {
}
TEST_F(IndexedDBQuotaClientTest, GetOriginsForType) {
- IndexedDBQuotaClient client(
- base::MessageLoopProxy::current(),
- idb_context());
+ IndexedDBQuotaClient client(base::MessageLoopProxy::current(), idb_context());
EXPECT_TRUE(GetOriginsForType(&client, kTemp).empty());
EXPECT_TRUE(GetOriginsForType(&client, kPerm).empty());
@@ -230,9 +222,7 @@ TEST_F(IndexedDBQuotaClientTest, GetOriginsForType) {
}
TEST_F(IndexedDBQuotaClientTest, DeleteOrigin) {
- IndexedDBQuotaClient client(
- base::MessageLoopProxy::current(),
- idb_context());
+ IndexedDBQuotaClient client(base::MessageLoopProxy::current(), idb_context());
AddFakeIndexedDB(kOriginA, 1000);
AddFakeIndexedDB(kOriginB, 50);
« no previous file with comments | « content/browser/indexed_db/indexed_db_quota_client.cc ('k') | content/browser/indexed_db/indexed_db_tracing.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698