diff options
author | Andras Becsi <andras.becsi@digia.com> | 2013-12-11 21:33:03 +0100 |
---|---|---|
committer | Andras Becsi <andras.becsi@digia.com> | 2013-12-13 12:34:07 +0100 |
commit | f2a33ff9cbc6d19943f1c7fbddd1f23d23975577 (patch) | |
tree | 0586a32aa390ade8557dfd6b4897f43a07449578 /chromium/webkit/browser/quota/quota_manager_unittest.cc | |
parent | 5362912cdb5eea702b68ebe23702468d17c3017a (diff) | |
download | qtwebengine-chromium-f2a33ff9cbc6d19943f1c7fbddd1f23d23975577.tar.gz |
Update Chromium to branch 1650 (31.0.1650.63)
Change-Id: I57d8c832eaec1eb2364e0a8e7352a6dd354db99f
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Diffstat (limited to 'chromium/webkit/browser/quota/quota_manager_unittest.cc')
-rw-r--r-- | chromium/webkit/browser/quota/quota_manager_unittest.cc | 414 |
1 files changed, 207 insertions, 207 deletions
diff --git a/chromium/webkit/browser/quota/quota_manager_unittest.cc b/chromium/webkit/browser/quota/quota_manager_unittest.cc index 3b1d0680aa6..cb9ffea28e9 100644 --- a/chromium/webkit/browser/quota/quota_manager_unittest.cc +++ b/chromium/webkit/browser/quota/quota_manager_unittest.cc @@ -11,8 +11,8 @@ #include "base/files/scoped_temp_dir.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" -#include "base/message_loop/message_loop.h" #include "base/message_loop/message_loop_proxy.h" +#include "base/run_loop.h" #include "base/stl_util.h" #include "base/sys_info.h" #include "base/time/time.h" @@ -69,7 +69,7 @@ class QuotaManagerTest : public testing::Test { virtual void TearDown() { // Make sure the quota manager cleans up correctly. quota_manager_ = NULL; - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); } protected: @@ -456,7 +456,7 @@ TEST_F(QuotaManagerTest, GetUsageInfo) { QuotaClient::kDatabase)); GetUsageInfo(); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(4U, usage_info().size()); for (size_t i = 0; i < usage_info().size(); ++i) { @@ -485,20 +485,20 @@ TEST_F(QuotaManagerTest, GetUsageAndQuota_Simple) { QuotaClient::kFileSystem)); GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(80, usage()); EXPECT_EQ(0, quota()); GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(10, usage()); EXPECT_LE(0, quota()); int64 quota_returned_for_foo = quota(); GetUsageAndQuotaForWebApps(GURL("http://bar.com/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(0, usage()); EXPECT_EQ(quota_returned_for_foo, quota()); @@ -506,30 +506,30 @@ TEST_F(QuotaManagerTest, GetUsageAndQuota_Simple) { TEST_F(QuotaManagerTest, GetUsage_NoClient) { GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(0, usage()); GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(0, usage()); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(0, usage()); GetHostUsage("foo.com", kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(0, usage()); GetGlobalUsage(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(0, usage()); EXPECT_EQ(0, unlimited_usage()); GetGlobalUsage(kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(0, usage()); EXPECT_EQ(0, unlimited_usage()); } @@ -537,30 +537,30 @@ TEST_F(QuotaManagerTest, GetUsage_NoClient) { TEST_F(QuotaManagerTest, GetUsage_EmptyClient) { RegisterClient(CreateClient(NULL, 0, QuotaClient::kFileSystem)); GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(0, usage()); GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(0, usage()); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(0, usage()); GetHostUsage("foo.com", kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(0, usage()); GetGlobalUsage(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(0, usage()); EXPECT_EQ(0, unlimited_usage()); GetGlobalUsage(kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(0, usage()); EXPECT_EQ(0, unlimited_usage()); } @@ -579,12 +579,12 @@ TEST_F(QuotaManagerTest, GetTemporaryUsageAndQuota_MultiOrigins) { // This time explicitly sets a temporary global quota. SetTemporaryGlobalQuota(100); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(100, quota()); GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(10 + 20, usage()); @@ -595,7 +595,7 @@ TEST_F(QuotaManagerTest, GetTemporaryUsageAndQuota_MultiOrigins) { EXPECT_EQ(kPerHostQuota, quota()); GetUsageAndQuotaForWebApps(GURL("http://bar.com/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(5 + 7, usage()); EXPECT_EQ(kPerHostQuota, quota()); @@ -626,52 +626,52 @@ TEST_F(QuotaManagerTest, GetUsage_MultipleClients) { GetAvailableDiskSpaceForTest(base::FilePath()) / kPerHostTemporaryPortion; GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(1 + 128, usage()); GetUsageAndQuotaForWebApps(GURL("http://bar.com/"), kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(4, usage()); GetUsageAndQuotaForWebApps(GURL("http://unlimited/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(512, usage()); EXPECT_EQ(std::min(kAvailableSpaceForApp, kTempQuotaBase) + usage(), quota()); GetUsageAndQuotaForWebApps(GURL("http://unlimited/"), kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(8, usage()); EXPECT_EQ(kAvailableSpaceForApp + usage(), quota()); GetAvailableSpace(); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_LE(0, available_space()); GetUsageAndQuotaForWebApps(GURL("http://installed/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(1024, usage()); EXPECT_EQ(std::min(kAvailableSpaceForApp, kTempQuotaBase) + usage(), quota()); GetUsageAndQuotaForWebApps(GURL("http://installed/"), kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(16, usage()); EXPECT_EQ(usage(), quota()); // Over-budget case. GetGlobalUsage(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(1 + 2 + 128 + 512 + 1024, usage()); EXPECT_EQ(512, unlimited_usage()); GetGlobalUsage(kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(4 + 8 + 16 + 256, usage()); EXPECT_EQ(8, unlimited_usage()); @@ -687,7 +687,7 @@ void QuotaManagerTest::GetUsage_WithModifyTestBody(const StorageType type) { RegisterClient(client); GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), type); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(10 + 20, usage()); @@ -696,19 +696,19 @@ void QuotaManagerTest::GetUsage_WithModifyTestBody(const StorageType type) { client->AddOriginAndNotify(GURL("https://foo.com/"), type, 1); GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), type); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(10 + 20 + 30 - 5 + 1, usage()); int foo_usage = usage(); client->AddOriginAndNotify(GURL("http://bar.com/"), type, 40); GetUsageAndQuotaForWebApps(GURL("http://bar.com/"), type); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(40, usage()); GetGlobalUsage(type); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(foo_usage + 40, usage()); EXPECT_EQ(0, unlimited_usage()); } @@ -727,14 +727,14 @@ TEST_F(QuotaManagerTest, GetTemporaryUsageAndQuota_WithAdditionalTasks) { RegisterClient(CreateClient(kData, ARRAYSIZE_UNSAFE(kData), QuotaClient::kFileSystem)); SetTemporaryGlobalQuota(100); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); const int kPerHostQuota = 100 / QuotaManager::kPerHostTemporaryPortion; GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), kTemp); GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), kTemp); GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(10 + 20, usage()); EXPECT_EQ(kPerHostQuota, quota()); @@ -744,7 +744,7 @@ TEST_F(QuotaManagerTest, GetTemporaryUsageAndQuota_WithAdditionalTasks) { kTemp); GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), kTemp); RunAdditionalUsageAndQuotaTask(GURL("http://bar.com/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(10 + 20, usage()); EXPECT_EQ(kPerHostQuota, quota()); @@ -761,7 +761,7 @@ TEST_F(QuotaManagerTest, GetTemporaryUsageAndQuota_NukeManager) { RegisterClient(CreateClient(kData, ARRAYSIZE_UNSAFE(kData), QuotaClient::kFileSystem)); SetTemporaryGlobalQuota(100); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); set_additional_callback_count(0); GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), kTemp); @@ -775,7 +775,7 @@ TEST_F(QuotaManagerTest, GetTemporaryUsageAndQuota_NukeManager) { // Nuke before waiting for callbacks. set_quota_manager(NULL); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaErrorAbort, status()); } @@ -788,24 +788,24 @@ TEST_F(QuotaManagerTest, GetTemporaryUsageAndQuota_Overbudget) { RegisterClient(CreateClient(kData, ARRAYSIZE_UNSAFE(kData), QuotaClient::kFileSystem)); SetTemporaryGlobalQuota(100); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); const int kPerHostQuota = 100 / QuotaManager::kPerHostTemporaryPortion; GetUsageAndQuotaForWebApps(GURL("http://usage1/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(1, usage()); EXPECT_EQ(1, quota()); // should be clamped to our current usage GetUsageAndQuotaForWebApps(GURL("http://usage10/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(10, usage()); EXPECT_EQ(10, quota()); GetUsageAndQuotaForWebApps(GURL("http://usage200/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(200, usage()); EXPECT_EQ(kPerHostQuota, quota()); // should be clamped to the nominal quota @@ -824,10 +824,10 @@ TEST_F(QuotaManagerTest, GetTemporaryUsageAndQuota_Unlimited) { // Test when not overbugdet. SetTemporaryGlobalQuota(1000); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); GetGlobalUsage(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(10 + 50 + 4000, usage()); EXPECT_EQ(4000, unlimited_usage()); @@ -835,56 +835,56 @@ TEST_F(QuotaManagerTest, GetTemporaryUsageAndQuota_Unlimited) { 1000 / QuotaManager::kPerHostTemporaryPortion; GetUsageAndQuotaForWebApps(GURL("http://usage10/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(10, usage()); EXPECT_EQ(kPerHostQuotaFor1000, quota()); GetUsageAndQuotaForWebApps(GURL("http://usage50/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(50, usage()); EXPECT_EQ(kPerHostQuotaFor1000, quota()); GetUsageAndQuotaForWebApps(GURL("http://unlimited/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(4000, usage()); EXPECT_EQ(kAvailableSpaceForApp + usage(), quota()); GetUsageAndQuotaForStorageClient(GURL("http://unlimited/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(0, usage()); EXPECT_EQ(QuotaManager::kNoLimit, quota()); // Test when overbugdet. SetTemporaryGlobalQuota(100); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); const int kPerHostQuotaFor100 = 100 / QuotaManager::kPerHostTemporaryPortion; GetUsageAndQuotaForWebApps(GURL("http://usage10/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(10, usage()); EXPECT_EQ(kPerHostQuotaFor100, quota()); GetUsageAndQuotaForWebApps(GURL("http://usage50/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(50, usage()); EXPECT_EQ(kPerHostQuotaFor100, quota()); GetUsageAndQuotaForWebApps(GURL("http://unlimited/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(4000, usage()); EXPECT_EQ(kAvailableSpaceForApp + usage(), quota()); GetUsageAndQuotaForStorageClient(GURL("http://unlimited/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(0, usage()); EXPECT_EQ(QuotaManager::kNoLimit, quota()); @@ -894,30 +894,30 @@ TEST_F(QuotaManagerTest, GetTemporaryUsageAndQuota_Unlimited) { mock_special_storage_policy()->NotifyCleared(); GetGlobalUsage(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(10 + 50 + 4000, usage()); EXPECT_EQ(0, unlimited_usage()); GetUsageAndQuotaForWebApps(GURL("http://usage10/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(10, usage()); EXPECT_EQ(10, quota()); // should be clamped to our current usage GetUsageAndQuotaForWebApps(GURL("http://usage50/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(50, usage()); EXPECT_EQ(kPerHostQuotaFor100, quota()); GetUsageAndQuotaForWebApps(GURL("http://unlimited/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(4000, usage()); EXPECT_EQ(kPerHostQuotaFor100, quota()); GetUsageAndQuotaForStorageClient(GURL("http://unlimited/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(4000, usage()); EXPECT_EQ(kPerHostQuotaFor100, quota()); @@ -949,11 +949,11 @@ TEST_F(QuotaManagerTest, GetAndSetPerststentHostQuota) { RegisterClient(CreateClient(NULL, 0, QuotaClient::kFileSystem)); GetPersistentHostQuota("foo.com"); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(0, quota()); SetPersistentHostQuota("foo.com", 100); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(100, quota()); GetPersistentHostQuota("foo.com"); @@ -961,7 +961,7 @@ TEST_F(QuotaManagerTest, GetAndSetPerststentHostQuota) { GetPersistentHostQuota("foo.com"); SetPersistentHostQuota("foo.com", 300000000000ll); GetPersistentHostQuota("foo.com"); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(300000000000ll, quota()); } @@ -969,14 +969,14 @@ TEST_F(QuotaManagerTest, GetAndSetPersistentUsageAndQuota) { RegisterClient(CreateClient(NULL, 0, QuotaClient::kFileSystem)); GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(0, usage()); EXPECT_EQ(0, quota()); SetPersistentHostQuota("foo.com", 100); GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(0, usage()); EXPECT_EQ(100, quota()); @@ -985,19 +985,19 @@ TEST_F(QuotaManagerTest, GetAndSetPersistentUsageAndQuota) { mock_special_storage_policy()->GrantQueryDiskSize(GURL("http://installed/")); SetPersistentHostQuota("installed", kAvailableSpaceForApp + 100); GetUsageAndQuotaForWebApps(GURL("http://installed/"), kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kAvailableSpaceForApp, quota()); // Ditto for unlimited apps. mock_special_storage_policy()->AddUnlimited(GURL("http://unlimited/")); GetUsageAndQuotaForWebApps(GURL("http://unlimited/"), kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kAvailableSpaceForApp, quota()); // GetUsageAndQuotaForStorageClient should just return 0 usage and // kNoLimit quota. GetUsageAndQuotaForStorageClient(GURL("http://unlimited/"), kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(0, usage()); EXPECT_EQ(QuotaManager::kNoLimit, quota()); } @@ -1014,7 +1014,7 @@ TEST_F(QuotaManagerTest, GetSyncableQuota) { // kAvailableSpaceForApp as syncable quota (because of the pre-condition). mock_special_storage_policy()->GrantQueryDiskSize(GURL("http://installed/")); GetUsageAndQuotaForWebApps(GURL("http://installed/"), kSync); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(0, usage()); EXPECT_EQ(kAvailableSpaceForApp, quota()); @@ -1022,7 +1022,7 @@ TEST_F(QuotaManagerTest, GetSyncableQuota) { // If it's not installed (which shouldn't happen in real case) it // should just return the default host quota for syncable. GetUsageAndQuotaForWebApps(GURL("http://foo/"), kSync); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(0, usage()); EXPECT_EQ(QuotaManager::kSyncableStorageDefaultHostQuota, quota()); @@ -1044,7 +1044,7 @@ TEST_F(QuotaManagerTest, GetPersistentUsageAndQuota_MultiOrigins) { SetPersistentHostQuota("foo.com", 100); GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(10 + 20 + 13 + 19, usage()); EXPECT_EQ(100, quota()); @@ -1068,7 +1068,7 @@ TEST_F(QuotaManagerTest, GetPersistentUsageAndQuota_WithAdditionalTasks) { GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), kPerm); GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), kPerm); GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(10 + 20, usage()); EXPECT_EQ(100, quota()); @@ -1078,7 +1078,7 @@ TEST_F(QuotaManagerTest, GetPersistentUsageAndQuota_WithAdditionalTasks) { kPerm); GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), kPerm); RunAdditionalUsageAndQuotaTask(GURL("http://bar.com/"), kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(10 + 20, usage()); EXPECT_EQ(2, additional_callback_count()); @@ -1102,7 +1102,7 @@ TEST_F(QuotaManagerTest, GetPersistentUsageAndQuota_NukeManager) { // Nuke before waiting for callbacks. set_quota_manager(NULL); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaErrorAbort, status()); } @@ -1120,21 +1120,21 @@ TEST_F(QuotaManagerTest, GetUsage_Simple) { QuotaClient::kFileSystem)); GetGlobalUsage(kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(usage(), 1 + 20 + 600000); EXPECT_EQ(0, unlimited_usage()); GetGlobalUsage(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(usage(), 300 + 4000 + 50000 + 7000000); EXPECT_EQ(0, unlimited_usage()); GetHostUsage("foo.com", kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(usage(), 1 + 20); GetHostUsage("buz.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(usage(), 4000 + 50000); } @@ -1154,7 +1154,7 @@ TEST_F(QuotaManagerTest, GetUsage_WithModification) { RegisterClient(client); GetGlobalUsage(kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(usage(), 1 + 20 + 600000); EXPECT_EQ(0, unlimited_usage()); @@ -1162,12 +1162,12 @@ TEST_F(QuotaManagerTest, GetUsage_WithModification) { GURL("http://foo.com/"), kPerm, 80000000); GetGlobalUsage(kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(usage(), 1 + 20 + 600000 + 80000000); EXPECT_EQ(0, unlimited_usage()); GetGlobalUsage(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(usage(), 300 + 4000 + 50000 + 7000000); EXPECT_EQ(0, unlimited_usage()); @@ -1175,19 +1175,19 @@ TEST_F(QuotaManagerTest, GetUsage_WithModification) { GURL("http://foo.com/"), kTemp, 1); GetGlobalUsage(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(usage(), 300 + 4000 + 50000 + 7000000 + 1); EXPECT_EQ(0, unlimited_usage()); GetHostUsage("buz.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(usage(), 4000 + 50000); client->ModifyOriginAndNotify( GURL("http://buz.com/"), kTemp, 900000000); GetHostUsage("buz.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(usage(), 4000 + 50000 + 900000000); } @@ -1203,38 +1203,38 @@ TEST_F(QuotaManagerTest, GetUsage_WithDeleteOrigin) { RegisterClient(client); GetGlobalUsage(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); int64 predelete_global_tmp = usage(); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); int64 predelete_host_tmp = usage(); GetHostUsage("foo.com", kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); int64 predelete_host_pers = usage(); DeleteClientOriginData(client, GURL("http://foo.com/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); GetGlobalUsage(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_global_tmp - 1, usage()); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_host_tmp - 1, usage()); GetHostUsage("foo.com", kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_host_pers, usage()); } TEST_F(QuotaManagerTest, GetAvailableSpaceTest) { GetAvailableSpace(); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_LE(0, available_space()); } @@ -1261,15 +1261,15 @@ TEST_F(QuotaManagerTest, EvictOriginData) { RegisterClient(client2); GetGlobalUsage(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); int64 predelete_global_tmp = usage(); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); int64 predelete_host_tmp = usage(); GetHostUsage("foo.com", kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); int64 predelete_host_pers = usage(); for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kData1); ++i) @@ -1278,13 +1278,13 @@ TEST_F(QuotaManagerTest, EvictOriginData) { for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kData2); ++i) quota_manager()->NotifyStorageAccessed(QuotaClient::kUnknown, GURL(kData2[i].origin), kData2[i].type); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EvictOriginData(GURL("http://foo.com/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); DumpOriginInfoTable(); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); typedef OriginInfoTableEntries::const_iterator iterator; for (iterator itr(origin_info_entries().begin()), @@ -1295,15 +1295,15 @@ TEST_F(QuotaManagerTest, EvictOriginData) { } GetGlobalUsage(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_global_tmp - (1 + 50000), usage()); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_host_tmp - (1 + 50000), usage()); GetHostUsage("foo.com", kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_host_pers, usage()); } @@ -1320,20 +1320,20 @@ TEST_F(QuotaManagerTest, EvictOriginDataWithDeletionError) { RegisterClient(client); GetGlobalUsage(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); int64 predelete_global_tmp = usage(); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); int64 predelete_host_tmp = usage(); GetHostUsage("foo.com", kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); int64 predelete_host_pers = usage(); for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kData); ++i) NotifyStorageAccessed(client, GURL(kData[i].origin), kData[i].type); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); client->AddOriginToErrorSet(GURL("http://foo.com/"), kTemp); @@ -1341,12 +1341,12 @@ TEST_F(QuotaManagerTest, EvictOriginDataWithDeletionError) { i < QuotaManager::kThresholdOfErrorsToBeBlacklisted + 1; ++i) { EvictOriginData(GURL("http://foo.com/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaErrorInvalidModification, status()); } DumpOriginInfoTable(); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); bool found_origin_in_database = false; typedef OriginInfoTableEntries::const_iterator iterator; @@ -1364,31 +1364,31 @@ TEST_F(QuotaManagerTest, EvictOriginDataWithDeletionError) { for (size_t i = 0; i < kNumberOfTemporaryOrigins - 1; ++i) { GetLRUOrigin(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_FALSE(lru_origin().is_empty()); // The origin "http://foo.com/" should not be in the LRU list. EXPECT_NE(std::string("http://foo.com/"), lru_origin().spec()); DeleteOriginFromDatabase(lru_origin(), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); } // Now the LRU list must be empty. GetLRUOrigin(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_TRUE(lru_origin().is_empty()); // Deleting origins from the database should not affect the results of the // following checks. GetGlobalUsage(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_global_tmp, usage()); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_host_tmp, usage()); GetHostUsage("foo.com", kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_host_pers, usage()); } @@ -1406,10 +1406,10 @@ TEST_F(QuotaManagerTest, GetUsageAndQuotaForEviction) { RegisterClient(client); SetTemporaryGlobalQuota(10000000); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); GetUsageAndQuotaForEviction(); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(21, limited_usage()); EXPECT_EQ(10000000, quota()); @@ -1425,47 +1425,47 @@ TEST_F(QuotaManagerTest, DeleteHostDataSimple) { RegisterClient(client); GetGlobalUsage(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); const int64 predelete_global_tmp = usage(); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); int64 predelete_host_tmp = usage(); GetHostUsage("foo.com", kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); int64 predelete_host_pers = usage(); DeleteHostData(std::string(), kTemp, kAllClients); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); GetGlobalUsage(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_global_tmp, usage()); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_host_tmp, usage()); GetHostUsage("foo.com", kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_host_pers, usage()); DeleteHostData("foo.com", kTemp, kAllClients); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); GetGlobalUsage(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_global_tmp - 1, usage()); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_host_tmp - 1, usage()); GetHostUsage("foo.com", kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_host_pers, usage()); } @@ -1491,35 +1491,35 @@ TEST_F(QuotaManagerTest, DeleteHostDataMultiple) { RegisterClient(client2); GetGlobalUsage(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); const int64 predelete_global_tmp = usage(); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); const int64 predelete_foo_tmp = usage(); GetHostUsage("bar.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); const int64 predelete_bar_tmp = usage(); GetHostUsage("foo.com", kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); const int64 predelete_foo_pers = usage(); GetHostUsage("bar.com", kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); const int64 predelete_bar_pers = usage(); reset_status_callback_count(); DeleteHostData("foo.com", kTemp, kAllClients); DeleteHostData("bar.com", kTemp, kAllClients); DeleteHostData("foo.com", kTemp, kAllClients); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(3, status_callback_count()); DumpOriginInfoTable(); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); typedef OriginInfoTableEntries::const_iterator iterator; for (iterator itr(origin_info_entries().begin()), @@ -1534,24 +1534,24 @@ TEST_F(QuotaManagerTest, DeleteHostDataMultiple) { } GetGlobalUsage(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_global_tmp - (1 + 20 + 4000 + 50000 + 6000 + 80 + 9), usage()); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_foo_tmp - (1 + 20 + 50000 + 6000 + 80), usage()); GetHostUsage("bar.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_bar_tmp - (4000 + 9), usage()); GetHostUsage("foo.com", kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_foo_pers, usage()); GetHostUsage("bar.com", kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_bar_pers, usage()); } @@ -1579,23 +1579,23 @@ TEST_F(QuotaManagerTest, DeleteOriginDataMultiple) { RegisterClient(client2); GetGlobalUsage(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); const int64 predelete_global_tmp = usage(); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); const int64 predelete_foo_tmp = usage(); GetHostUsage("bar.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); const int64 predelete_bar_tmp = usage(); GetHostUsage("foo.com", kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); const int64 predelete_foo_pers = usage(); GetHostUsage("bar.com", kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); const int64 predelete_bar_pers = usage(); for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kData1); ++i) @@ -1604,18 +1604,18 @@ TEST_F(QuotaManagerTest, DeleteOriginDataMultiple) { for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kData2); ++i) quota_manager()->NotifyStorageAccessed(QuotaClient::kUnknown, GURL(kData2[i].origin), kData2[i].type); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); reset_status_callback_count(); DeleteOriginData(GURL("http://foo.com/"), kTemp, kAllClients); DeleteOriginData(GURL("http://bar.com/"), kTemp, kAllClients); DeleteOriginData(GURL("http://foo.com/"), kTemp, kAllClients); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(3, status_callback_count()); DumpOriginInfoTable(); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); typedef OriginInfoTableEntries::const_iterator iterator; for (iterator itr(origin_info_entries().begin()), @@ -1628,23 +1628,23 @@ TEST_F(QuotaManagerTest, DeleteOriginDataMultiple) { } GetGlobalUsage(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_global_tmp - (1 + 4000 + 50000 + 9), usage()); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_foo_tmp - (1 + 50000), usage()); GetHostUsage("bar.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_bar_tmp - (4000 + 9), usage()); GetHostUsage("foo.com", kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_foo_pers, usage()); GetHostUsage("bar.com", kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_bar_pers, usage()); } @@ -1668,12 +1668,12 @@ TEST_F(QuotaManagerTest, GetCachedOrigins) { // No matter how we make queries the quota manager tries to cache all // the origins at startup. GetHostUsage("a.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); GetCachedOrigins(kTemp, &origins); EXPECT_EQ(3U, origins.size()); GetHostUsage("b.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); GetCachedOrigins(kTemp, &origins); EXPECT_EQ(3U, origins.size()); @@ -1681,7 +1681,7 @@ TEST_F(QuotaManagerTest, GetCachedOrigins) { EXPECT_TRUE(origins.empty()); GetGlobalUsage(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); GetCachedOrigins(kTemp, &origins); EXPECT_EQ(3U, origins.size()); @@ -1705,29 +1705,29 @@ TEST_F(QuotaManagerTest, NotifyAndLRUOrigin) { GURL origin; GetLRUOrigin(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_TRUE(lru_origin().is_empty()); NotifyStorageAccessed(client, GURL("http://a.com/"), kTemp); GetLRUOrigin(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ("http://a.com/", lru_origin().spec()); NotifyStorageAccessed(client, GURL("http://b.com/"), kPerm); NotifyStorageAccessed(client, GURL("https://a.com/"), kTemp); NotifyStorageAccessed(client, GURL("http://c.com/"), kTemp); GetLRUOrigin(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ("http://a.com/", lru_origin().spec()); DeleteOriginFromDatabase(lru_origin(), kTemp); GetLRUOrigin(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ("https://a.com/", lru_origin().spec()); DeleteOriginFromDatabase(lru_origin(), kTemp); GetLRUOrigin(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ("http://c.com/", lru_origin().spec()); } @@ -1745,7 +1745,7 @@ TEST_F(QuotaManagerTest, GetLRUOriginWithOriginInUse) { GURL origin; GetLRUOrigin(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_TRUE(lru_origin().is_empty()); NotifyStorageAccessed(client, GURL("http://a.com/"), kTemp); @@ -1754,19 +1754,19 @@ TEST_F(QuotaManagerTest, GetLRUOriginWithOriginInUse) { NotifyStorageAccessed(client, GURL("http://c.com/"), kTemp); GetLRUOrigin(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ("http://a.com/", lru_origin().spec()); // Notify origin http://a.com is in use. NotifyOriginInUse(GURL("http://a.com/")); GetLRUOrigin(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ("https://a.com/", lru_origin().spec()); // Notify origin https://a.com is in use while GetLRUOrigin is running. GetLRUOrigin(kTemp); NotifyOriginInUse(GURL("https://a.com/")); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); // Post-filtering must have excluded the returned origin, so we will // see empty result here. EXPECT_TRUE(lru_origin().is_empty()); @@ -1774,7 +1774,7 @@ TEST_F(QuotaManagerTest, GetLRUOriginWithOriginInUse) { // Notify access for http://c.com while GetLRUOrigin is running. GetLRUOrigin(kTemp); NotifyStorageAccessed(client, GURL("http://c.com/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); // Post-filtering must have excluded the returned origin, so we will // see empty result here. EXPECT_TRUE(lru_origin().is_empty()); @@ -1782,7 +1782,7 @@ TEST_F(QuotaManagerTest, GetLRUOriginWithOriginInUse) { NotifyOriginNoLongerInUse(GURL("http://a.com/")); NotifyOriginNoLongerInUse(GURL("https://a.com/")); GetLRUOrigin(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ("http://a.com/", lru_origin().spec()); } @@ -1799,7 +1799,7 @@ TEST_F(QuotaManagerTest, GetOriginsModifiedSince) { RegisterClient(client); GetOriginsModifiedSince(kTemp, base::Time()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_TRUE(modified_origins().empty()); EXPECT_EQ(modified_origins_type(), kTemp); @@ -1813,7 +1813,7 @@ TEST_F(QuotaManagerTest, GetOriginsModifiedSince) { base::Time time3 = client->IncrementMockTime(); GetOriginsModifiedSince(kTemp, time1); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(4U, modified_origins().size()); EXPECT_EQ(modified_origins_type(), kTemp); for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kData); ++i) { @@ -1822,18 +1822,18 @@ TEST_F(QuotaManagerTest, GetOriginsModifiedSince) { } GetOriginsModifiedSince(kTemp, time2); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(2U, modified_origins().size()); GetOriginsModifiedSince(kTemp, time3); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_TRUE(modified_origins().empty()); EXPECT_EQ(modified_origins_type(), kTemp); client->ModifyOriginAndNotify(GURL("http://a.com/"), kTemp, 10); GetOriginsModifiedSince(kTemp, time3); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(1U, modified_origins().size()); EXPECT_EQ(1U, modified_origins().count(GURL("http://a.com/"))); EXPECT_EQ(modified_origins_type(), kTemp); @@ -1843,10 +1843,10 @@ TEST_F(QuotaManagerTest, DumpQuotaTable) { SetPersistentHostQuota("example1.com", 1); SetPersistentHostQuota("example2.com", 20); SetPersistentHostQuota("example3.com", 300); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); DumpQuotaTable(); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); const QuotaTableEntry kEntries[] = { QuotaTableEntry("example1.com", kPerm, 1), @@ -1882,10 +1882,10 @@ TEST_F(QuotaManagerTest, DumpOriginInfoTable) { QuotaClient::kUnknown, GURL("http://example.com/"), kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); DumpOriginInfoTable(); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); typedef std::pair<GURL, StorageType> TypedOrigin; typedef std::pair<TypedOrigin, int> Entry; @@ -1913,12 +1913,12 @@ TEST_F(QuotaManagerTest, DumpOriginInfoTable) { TEST_F(QuotaManagerTest, QuotaForEmptyHost) { GetPersistentHostQuota(std::string()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(0, quota()); SetPersistentHostQuota(std::string(), 10); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaErrorNotSupported, status()); } @@ -1949,32 +1949,32 @@ TEST_F(QuotaManagerTest, DeleteSpecificClientTypeSingleOrigin) { RegisterClient(client4); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); const int64 predelete_foo_tmp = usage(); DeleteOriginData(GURL("http://foo.com/"), kTemp, QuotaClient::kFileSystem); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_foo_tmp - 1, usage()); DeleteOriginData(GURL("http://foo.com/"), kTemp, QuotaClient::kAppcache); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_foo_tmp - 2 - 1, usage()); DeleteOriginData(GURL("http://foo.com/"), kTemp, QuotaClient::kDatabase); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_foo_tmp - 4 - 2 - 1, usage()); DeleteOriginData(GURL("http://foo.com/"), kTemp, QuotaClient::kIndexedDatabase); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_foo_tmp - 8 - 4 - 2 - 1, usage()); } @@ -2005,31 +2005,31 @@ TEST_F(QuotaManagerTest, DeleteSpecificClientTypeSingleHost) { RegisterClient(client4); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); const int64 predelete_foo_tmp = usage(); DeleteHostData("foo.com", kTemp, QuotaClient::kFileSystem); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_foo_tmp - 1, usage()); DeleteHostData("foo.com", kTemp, QuotaClient::kAppcache); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_foo_tmp - 2 - 1, usage()); DeleteHostData("foo.com", kTemp, QuotaClient::kDatabase); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_foo_tmp - 4 - 2 - 1, usage()); DeleteHostData("foo.com", kTemp, QuotaClient::kIndexedDatabase); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_foo_tmp - 8 - 4 - 2 - 1, usage()); } @@ -2060,21 +2060,21 @@ TEST_F(QuotaManagerTest, DeleteMultipleClientTypesSingleOrigin) { RegisterClient(client4); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); const int64 predelete_foo_tmp = usage(); DeleteOriginData(GURL("http://foo.com/"), kTemp, QuotaClient::kFileSystem | QuotaClient::kDatabase); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_foo_tmp - 4 - 1, usage()); DeleteOriginData(GURL("http://foo.com/"), kTemp, QuotaClient::kAppcache | QuotaClient::kIndexedDatabase); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_foo_tmp - 8 - 4 - 2 - 1, usage()); } @@ -2105,21 +2105,21 @@ TEST_F(QuotaManagerTest, DeleteMultipleClientTypesSingleHost) { RegisterClient(client4); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); const int64 predelete_foo_tmp = usage(); DeleteHostData("foo.com", kTemp, QuotaClient::kFileSystem | QuotaClient::kAppcache); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_foo_tmp - 2 - 1, usage()); DeleteHostData("foo.com", kTemp, QuotaClient::kDatabase | QuotaClient::kIndexedDatabase); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_foo_tmp - 8 - 4 - 2 - 1, usage()); } @@ -2134,14 +2134,14 @@ TEST_F(QuotaManagerTest, GetUsageAndQuota_Incognito) { QuotaClient::kFileSystem)); GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(80, usage()); EXPECT_EQ(0, quota()); SetTemporaryGlobalQuota(100); GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(10, usage()); EXPECT_LE(std::min(static_cast<int64>(100 / kPerHostTemporaryPortion), @@ -2149,13 +2149,13 @@ TEST_F(QuotaManagerTest, GetUsageAndQuota_Incognito) { mock_special_storage_policy()->AddUnlimited(GURL("http://foo.com/")); GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(80, usage()); EXPECT_EQ(QuotaManager::kIncognitoDefaultQuotaLimit, quota()); GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(10, usage()); EXPECT_EQ(QuotaManager::kIncognitoDefaultQuotaLimit, quota()); |