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 e87f2a55ab283dd31b9b3c193cf2130db3dade54..2570f9de758bf655644e944b43f7f15b6e4e2db7 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,8 +85,9 @@ 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(); |
type_ = quota::kStorageTypeTemporary; |
client->GetOriginsForType( |
@@ -97,14 +98,14 @@ 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(); |
type_ = quota::kStorageTypeTemporary; |
client->GetOriginsForHost( |
- type, |
- host, |
+ type, host, |
base::Bind(&IndexedDBQuotaClientTest::OnGetOriginsComplete, |
weak_factory_.GetWeakPtr())); |
base::MessageLoop::current()->RunUntilIdle(); |
@@ -115,8 +116,7 @@ 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(); |
@@ -143,10 +143,12 @@ 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, |
- quota::StorageType type) { |
+ quota::StorageType type) { |
origins_ = origins; |
type_ = type; |
} |
@@ -172,7 +174,9 @@ 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); |
@@ -189,7 +193,9 @@ 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()); |
@@ -213,7 +219,9 @@ 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()); |
@@ -227,7 +235,9 @@ 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); |