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