When Retrier succeeds, record errors it encountered.
[chromium-blink-merge.git] / webkit / appcache / mock_appcache_service.h
blobcd51d11be6d5267720f1522af84b888946582166
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
3 // found in the LICENSE file.
5 #ifndef WEBKIT_APPCACHE_MOCK_APPCACHE_SERVICE_H_
6 #define WEBKIT_APPCACHE_MOCK_APPCACHE_SERVICE_H_
8 #include "base/compiler_specific.h"
9 #include "webkit/appcache/appcache_service.h"
10 #include "webkit/appcache/mock_appcache_storage.h"
11 #include "webkit/quota/quota_manager.h"
13 namespace appcache {
15 // For use by unit tests.
16 class MockAppCacheService : public AppCacheService {
17 public:
18 MockAppCacheService()
19 : AppCacheService(NULL),
20 mock_delete_appcaches_for_origin_result_(net::OK),
21 delete_called_count_(0) {
22 storage_.reset(new MockAppCacheStorage(this));
25 // Just returns a canned completion code without actually
26 // removing groups and caches in our mock storage instance.
27 virtual void DeleteAppCachesForOrigin(
28 const GURL& origin,
29 const net::CompletionCallback& callback) OVERRIDE;
31 void set_quota_manager_proxy(quota::QuotaManagerProxy* proxy) {
32 quota_manager_proxy_ = proxy;
35 void set_mock_delete_appcaches_for_origin_result(int rv) {
36 mock_delete_appcaches_for_origin_result_ = rv;
39 int delete_called_count() const { return delete_called_count_; }
41 private:
42 int mock_delete_appcaches_for_origin_result_;
43 int delete_called_count_;
46 } // namespace appcache
48 #endif // WEBKIT_APPCACHE_MOCK_APPCACHE_SERVICE_H_