| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/bind_helpers.h" | 6 #include "base/bind_helpers.h" |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "content/browser/appcache/appcache.h" | 9 #include "content/browser/appcache/appcache.h" |
| 10 #include "content/browser/appcache/appcache_backend_impl.h" | 10 #include "content/browser/appcache/appcache_backend_impl.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 } | 83 } |
| 84 | 84 |
| 85 int last_host_id_; | 85 int last_host_id_; |
| 86 int64 last_cache_id_; | 86 int64 last_cache_id_; |
| 87 AppCacheStatus last_status_; | 87 AppCacheStatus last_status_; |
| 88 AppCacheStatus last_status_changed_; | 88 AppCacheStatus last_status_changed_; |
| 89 AppCacheEventID last_event_id_; | 89 AppCacheEventID last_event_id_; |
| 90 bool content_blocked_; | 90 bool content_blocked_; |
| 91 }; | 91 }; |
| 92 | 92 |
| 93 class MockQuotaManagerProxy : public quota::QuotaManagerProxy { | 93 class MockQuotaManagerProxy : public storage::QuotaManagerProxy { |
| 94 public: | 94 public: |
| 95 MockQuotaManagerProxy() : QuotaManagerProxy(NULL, NULL) {} | 95 MockQuotaManagerProxy() : QuotaManagerProxy(NULL, NULL) {} |
| 96 | 96 |
| 97 // Not needed for our tests. | 97 // Not needed for our tests. |
| 98 virtual void RegisterClient(quota::QuotaClient* client) OVERRIDE {} | 98 virtual void RegisterClient(storage::QuotaClient* client) OVERRIDE {} |
| 99 virtual void NotifyStorageAccessed(quota::QuotaClient::ID client_id, | 99 virtual void NotifyStorageAccessed(storage::QuotaClient::ID client_id, |
| 100 const GURL& origin, | 100 const GURL& origin, |
| 101 quota::StorageType type) OVERRIDE {} | 101 storage::StorageType type) OVERRIDE {} |
| 102 virtual void NotifyStorageModified(quota::QuotaClient::ID client_id, | 102 virtual void NotifyStorageModified(storage::QuotaClient::ID client_id, |
| 103 const GURL& origin, | 103 const GURL& origin, |
| 104 quota::StorageType type, | 104 storage::StorageType type, |
| 105 int64 delta) OVERRIDE {} | 105 int64 delta) OVERRIDE {} |
| 106 virtual void SetUsageCacheEnabled(quota::QuotaClient::ID client_id, | 106 virtual void SetUsageCacheEnabled(storage::QuotaClient::ID client_id, |
| 107 const GURL& origin, | 107 const GURL& origin, |
| 108 quota::StorageType type, | 108 storage::StorageType type, |
| 109 bool enabled) OVERRIDE {} | 109 bool enabled) OVERRIDE {} |
| 110 virtual void GetUsageAndQuota( | 110 virtual void GetUsageAndQuota( |
| 111 base::SequencedTaskRunner* original_task_runner, | 111 base::SequencedTaskRunner* original_task_runner, |
| 112 const GURL& origin, | 112 const GURL& origin, |
| 113 quota::StorageType type, | 113 storage::StorageType type, |
| 114 const GetUsageAndQuotaCallback& callback) OVERRIDE {} | 114 const GetUsageAndQuotaCallback& callback) OVERRIDE {} |
| 115 | 115 |
| 116 virtual void NotifyOriginInUse(const GURL& origin) OVERRIDE { | 116 virtual void NotifyOriginInUse(const GURL& origin) OVERRIDE { |
| 117 inuse_[origin] += 1; | 117 inuse_[origin] += 1; |
| 118 } | 118 } |
| 119 | 119 |
| 120 virtual void NotifyOriginNoLongerInUse(const GURL& origin) OVERRIDE { | 120 virtual void NotifyOriginNoLongerInUse(const GURL& origin) OVERRIDE { |
| 121 inuse_[origin] -= 1; | 121 inuse_[origin] -= 1; |
| 122 } | 122 } |
| 123 | 123 |
| (...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 EXPECT_EQ(&mock_frontend_, host.frontend()); | 531 EXPECT_EQ(&mock_frontend_, host.frontend()); |
| 532 EXPECT_EQ(NULL, host.associated_cache()); | 532 EXPECT_EQ(NULL, host.associated_cache()); |
| 533 EXPECT_FALSE(host.is_selection_pending()); | 533 EXPECT_FALSE(host.is_selection_pending()); |
| 534 EXPECT_TRUE(host.preferred_manifest_url().is_empty()); | 534 EXPECT_TRUE(host.preferred_manifest_url().is_empty()); |
| 535 } | 535 } |
| 536 EXPECT_EQ(0, mock_quota_proxy->GetInUseCount(kDocAndOriginUrl)); | 536 EXPECT_EQ(0, mock_quota_proxy->GetInUseCount(kDocAndOriginUrl)); |
| 537 service_.set_quota_manager_proxy(NULL); | 537 service_.set_quota_manager_proxy(NULL); |
| 538 } | 538 } |
| 539 | 539 |
| 540 } // namespace content | 540 } // namespace content |
| OLD | NEW |