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/message_loop/message_loop.h" | 5 #include "base/message_loop/message_loop.h" |
| 6 #include "content/browser/appcache/appcache.h" |
| 7 #include "content/browser/appcache/appcache_group.h" |
| 8 #include "content/browser/appcache/appcache_response.h" |
| 9 #include "content/browser/appcache/appcache_storage.h" |
6 #include "content/browser/appcache/mock_appcache_service.h" | 10 #include "content/browser/appcache/mock_appcache_service.h" |
7 #include "content/browser/quota/mock_quota_manager_proxy.h" | 11 #include "content/browser/quota/mock_quota_manager_proxy.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
9 #include "webkit/browser/appcache/appcache.h" | |
10 #include "webkit/browser/appcache/appcache_group.h" | |
11 #include "webkit/browser/appcache/appcache_response.h" | |
12 #include "webkit/browser/appcache/appcache_storage.h" | |
13 | |
14 using appcache::AppCache; | |
15 using appcache::AppCacheGroup; | |
16 using appcache::AppCacheResponseInfo; | |
17 using appcache::AppCacheStorage; | |
18 using appcache::kUnkownResponseDataSize; | |
19 | 13 |
20 namespace content { | 14 namespace content { |
21 | 15 |
22 namespace { | 16 namespace { |
23 const quota::StorageType kTemp = quota::kStorageTypeTemporary; | 17 const quota::StorageType kTemp = quota::kStorageTypeTemporary; |
24 } | 18 } |
25 | 19 |
26 class AppCacheStorageTest : public testing::Test { | 20 class AppCacheStorageTest : public testing::Test { |
27 public: | 21 public: |
28 class MockStorageDelegate : public AppCacheStorage::Delegate { | 22 class MockStorageDelegate : public AppCacheStorage::Delegate { |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 service.storage()->usage_map_[kOrigin] = 5000; | 156 service.storage()->usage_map_[kOrigin] = 5000; |
163 service.storage()->ClearUsageMapAndNotify(); | 157 service.storage()->ClearUsageMapAndNotify(); |
164 EXPECT_EQ(4, mock_proxy->notify_storage_modified_count()); | 158 EXPECT_EQ(4, mock_proxy->notify_storage_modified_count()); |
165 EXPECT_EQ(-5000, mock_proxy->last_notified_delta()); | 159 EXPECT_EQ(-5000, mock_proxy->last_notified_delta()); |
166 EXPECT_EQ(kOrigin, mock_proxy->last_notified_origin()); | 160 EXPECT_EQ(kOrigin, mock_proxy->last_notified_origin()); |
167 EXPECT_EQ(kTemp, mock_proxy->last_notified_type()); | 161 EXPECT_EQ(kTemp, mock_proxy->last_notified_type()); |
168 EXPECT_TRUE(service.storage()->usage_map_.empty()); | 162 EXPECT_TRUE(service.storage()->usage_map_.empty()); |
169 } | 163 } |
170 | 164 |
171 } // namespace content | 165 } // namespace content |
OLD | NEW |