| 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 "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.h" |
| 8 #include "net/url_request/url_request.h" | 9 #include "net/url_request/url_request.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| 10 #include "webkit/appcache/appcache.h" | 11 #include "webkit/appcache/appcache.h" |
| 11 #include "webkit/appcache/appcache_backend_impl.h" | 12 #include "webkit/appcache/appcache_backend_impl.h" |
| 12 #include "webkit/appcache/appcache_group.h" | 13 #include "webkit/appcache/appcache_group.h" |
| 13 #include "webkit/appcache/appcache_host.h" | 14 #include "webkit/appcache/appcache_host.h" |
| 14 #include "webkit/appcache/mock_appcache_policy.h" | 15 #include "webkit/appcache/mock_appcache_policy.h" |
| 15 #include "webkit/appcache/mock_appcache_service.h" | 16 #include "webkit/appcache/mock_appcache_service.h" |
| 16 #include "webkit/quota/quota_manager.h" | 17 #include "webkit/quota/quota_manager.h" |
| 17 | 18 |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 void StartUpdateCallback(bool result, void* param) { | 131 void StartUpdateCallback(bool result, void* param) { |
| 131 last_start_result_ = result; | 132 last_start_result_ = result; |
| 132 last_callback_param_ = param; | 133 last_callback_param_ = param; |
| 133 } | 134 } |
| 134 | 135 |
| 135 void SwapCacheCallback(bool result, void* param) { | 136 void SwapCacheCallback(bool result, void* param) { |
| 136 last_swap_result_ = result; | 137 last_swap_result_ = result; |
| 137 last_callback_param_ = param; | 138 last_callback_param_ = param; |
| 138 } | 139 } |
| 139 | 140 |
| 141 MessageLoop message_loop_; |
| 142 |
| 140 // Mock classes for the 'host' to work with | 143 // Mock classes for the 'host' to work with |
| 141 MockAppCacheService service_; | 144 MockAppCacheService service_; |
| 142 MockFrontend mock_frontend_; | 145 MockFrontend mock_frontend_; |
| 143 | 146 |
| 144 // Mock callbacks we expect to receive from the 'host' | 147 // Mock callbacks we expect to receive from the 'host' |
| 145 appcache::GetStatusCallback get_status_callback_; | 148 appcache::GetStatusCallback get_status_callback_; |
| 146 appcache::StartUpdateCallback start_update_callback_; | 149 appcache::StartUpdateCallback start_update_callback_; |
| 147 appcache::SwapCacheCallback swap_cache_callback_; | 150 appcache::SwapCacheCallback swap_cache_callback_; |
| 148 | 151 |
| 149 Status last_status_result_; | 152 Status last_status_result_; |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 515 EXPECT_EQ(&mock_frontend_, host.frontend()); | 518 EXPECT_EQ(&mock_frontend_, host.frontend()); |
| 516 EXPECT_EQ(NULL, host.associated_cache()); | 519 EXPECT_EQ(NULL, host.associated_cache()); |
| 517 EXPECT_FALSE(host.is_selection_pending()); | 520 EXPECT_FALSE(host.is_selection_pending()); |
| 518 EXPECT_TRUE(host.preferred_manifest_url().is_empty()); | 521 EXPECT_TRUE(host.preferred_manifest_url().is_empty()); |
| 519 } | 522 } |
| 520 EXPECT_EQ(0, mock_quota_proxy->GetInUseCount(kDocAndOriginUrl)); | 523 EXPECT_EQ(0, mock_quota_proxy->GetInUseCount(kDocAndOriginUrl)); |
| 521 service_.set_quota_manager_proxy(NULL); | 524 service_.set_quota_manager_proxy(NULL); |
| 522 } | 525 } |
| 523 | 526 |
| 524 } // namespace appcache | 527 } // namespace appcache |
| OLD | NEW |