| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <map> | 5 #include <map> |
| 6 #include <set> | 6 #include <set> |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/message_loop_proxy.h" | 10 #include "base/message_loop_proxy.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 | 28 |
| 29 AppCacheQuotaClientTest() | 29 AppCacheQuotaClientTest() |
| 30 : kOriginA("http://host"), | 30 : kOriginA("http://host"), |
| 31 kOriginB("http://host:8000"), | 31 kOriginB("http://host:8000"), |
| 32 kOriginOther("http://other"), | 32 kOriginOther("http://other"), |
| 33 usage_(0), | 33 usage_(0), |
| 34 delete_status_(quota::kQuotaStatusUnknown), | 34 delete_status_(quota::kQuotaStatusUnknown), |
| 35 num_get_origin_usage_completions_(0), | 35 num_get_origin_usage_completions_(0), |
| 36 num_get_origins_completions_(0), | 36 num_get_origins_completions_(0), |
| 37 num_delete_origins_completions_(0), | 37 num_delete_origins_completions_(0), |
| 38 weak_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { | 38 weak_factory_(this) { |
| 39 } | 39 } |
| 40 | 40 |
| 41 int64 GetOriginUsage( | 41 int64 GetOriginUsage( |
| 42 quota::QuotaClient* client, | 42 quota::QuotaClient* client, |
| 43 const GURL& origin, | 43 const GURL& origin, |
| 44 quota::StorageType type) { | 44 quota::StorageType type) { |
| 45 usage_ = -1; | 45 usage_ = -1; |
| 46 AsyncGetOriginUsage(client, origin, type); | 46 AsyncGetOriginUsage(client, origin, type); |
| 47 MessageLoop::current()->RunUntilIdle(); | 47 MessageLoop::current()->RunUntilIdle(); |
| 48 return usage_; | 48 return usage_; |
| (...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 // A real completion callback from the service should | 429 // A real completion callback from the service should |
| 430 // be dropped if it comes in after NotifyAppCacheDestroyed. | 430 // be dropped if it comes in after NotifyAppCacheDestroyed. |
| 431 MessageLoop::current()->RunUntilIdle(); | 431 MessageLoop::current()->RunUntilIdle(); |
| 432 EXPECT_EQ(1, num_delete_origins_completions_); | 432 EXPECT_EQ(1, num_delete_origins_completions_); |
| 433 EXPECT_EQ(quota::kQuotaErrorAbort, delete_status_); | 433 EXPECT_EQ(quota::kQuotaErrorAbort, delete_status_); |
| 434 | 434 |
| 435 Call_OnQuotaManagerDestroyed(client); | 435 Call_OnQuotaManagerDestroyed(client); |
| 436 } | 436 } |
| 437 | 437 |
| 438 } // namespace appcache | 438 } // namespace appcache |
| OLD | NEW |