OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "net/url_request/url_request.h" | 8 #include "net/url_request/url_request.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 #include "webkit/appcache/appcache.h" | 10 #include "webkit/appcache/appcache.h" |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 int GetInUseCount(const GURL& origin) { | 110 int GetInUseCount(const GURL& origin) { |
111 return inuse_[origin]; | 111 return inuse_[origin]; |
112 } | 112 } |
113 | 113 |
114 void reset() { | 114 void reset() { |
115 inuse_.clear(); | 115 inuse_.clear(); |
116 } | 116 } |
117 | 117 |
118 // Map from origin to count of inuse notifications. | 118 // Map from origin to count of inuse notifications. |
119 std::map<GURL, int> inuse_; | 119 std::map<GURL, int> inuse_; |
| 120 |
| 121 protected: |
| 122 virtual ~MockQuotaManagerProxy() {} |
120 }; | 123 }; |
121 | 124 |
122 void GetStatusCallback(Status status, void* param) { | 125 void GetStatusCallback(Status status, void* param) { |
123 last_status_result_ = status; | 126 last_status_result_ = status; |
124 last_callback_param_ = param; | 127 last_callback_param_ = param; |
125 } | 128 } |
126 | 129 |
127 void StartUpdateCallback(bool result, void* param) { | 130 void StartUpdateCallback(bool result, void* param) { |
128 last_start_result_ = result; | 131 last_start_result_ = result; |
129 last_callback_param_ = param; | 132 last_callback_param_ = param; |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
512 EXPECT_EQ(&mock_frontend_, host.frontend()); | 515 EXPECT_EQ(&mock_frontend_, host.frontend()); |
513 EXPECT_EQ(NULL, host.associated_cache()); | 516 EXPECT_EQ(NULL, host.associated_cache()); |
514 EXPECT_FALSE(host.is_selection_pending()); | 517 EXPECT_FALSE(host.is_selection_pending()); |
515 EXPECT_TRUE(host.preferred_manifest_url().is_empty()); | 518 EXPECT_TRUE(host.preferred_manifest_url().is_empty()); |
516 } | 519 } |
517 EXPECT_EQ(0, mock_quota_proxy->GetInUseCount(kDocAndOriginUrl)); | 520 EXPECT_EQ(0, mock_quota_proxy->GetInUseCount(kDocAndOriginUrl)); |
518 service_.set_quota_manager_proxy(NULL); | 521 service_.set_quota_manager_proxy(NULL); |
519 } | 522 } |
520 | 523 |
521 } // namespace appcache | 524 } // namespace appcache |
OLD | NEW |