Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(534)

Side by Side Diff: webkit/appcache/mock_appcache_service.h

Issue 7031065: AppCache + Quota integration (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « webkit/appcache/appcache_storage_unittest.cc ('k') | webkit/appcache/mock_appcache_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 #ifndef WEBKIT_APPCACHE_MOCK_APPCACHE_SERVICE_H_ 5 #ifndef WEBKIT_APPCACHE_MOCK_APPCACHE_SERVICE_H_
6 #define WEBKIT_APPCACHE_MOCK_APPCACHE_SERVICE_H_ 6 #define WEBKIT_APPCACHE_MOCK_APPCACHE_SERVICE_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "webkit/appcache/appcache_service.h" 9 #include "webkit/appcache/appcache_service.h"
10 #include "webkit/appcache/mock_appcache_storage.h" 10 #include "webkit/appcache/mock_appcache_storage.h"
11 #include "webkit/quota/quota_manager.h" 11 #include "webkit/quota/quota_manager.h"
12 12
13 namespace appcache { 13 namespace appcache {
14 14
15 // For use by unit tests. 15 // For use by unit tests.
16 class MockAppCacheService : public AppCacheService { 16 class MockAppCacheService : public AppCacheService {
17 public: 17 public:
18 MockAppCacheService() : AppCacheService(NULL) { 18 MockAppCacheService()
19 : AppCacheService(NULL),
20 mock_delete_appcaches_for_origin_result_(net::OK),
21 delete_called_count_(0) {
19 storage_.reset(new MockAppCacheStorage(this)); 22 storage_.reset(new MockAppCacheStorage(this));
20 } 23 }
21 24
25 // Just returns a canned completion code without actually
26 // removing groups and caches in our mock storage instance.
27 virtual void DeleteAppCachesForOrigin(const GURL& origin,
28 net::CompletionCallback* callback);
29
22 void set_quota_manager_proxy(quota::QuotaManagerProxy* proxy) { 30 void set_quota_manager_proxy(quota::QuotaManagerProxy* proxy) {
23 quota_manager_proxy_ = proxy; 31 quota_manager_proxy_ = proxy;
24 } 32 }
33
34 void set_mock_delete_appcaches_for_origin_result(int rv) {
35 mock_delete_appcaches_for_origin_result_ = rv;
36 }
37
38 int delete_called_count() const { return delete_called_count_; }
39 private:
40 int mock_delete_appcaches_for_origin_result_;
41 int delete_called_count_;
25 }; 42 };
26 43
27 } // namespace appcache 44 } // namespace appcache
28 45
29 #endif // WEBKIT_APPCACHE_MOCK_APPCACHE_SERVICE_H_ 46 #endif // WEBKIT_APPCACHE_MOCK_APPCACHE_SERVICE_H_
OLDNEW
« no previous file with comments | « webkit/appcache/appcache_storage_unittest.cc ('k') | webkit/appcache/mock_appcache_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698