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_BROWSER_APPCACHE_APPCACHE_TEST_HELPER_H_
6 #define WEBKIT_BROWSER_APPCACHE_APPCACHE_TEST_HELPER_H_
10 #include "webkit/browser/appcache/appcache_storage.h"
14 class AppCacheService
;
16 // Helper class for inserting data into a ChromeAppCacheService and reading it
18 class AppCacheTestHelper
: public appcache::AppCacheStorage::Delegate
{
21 virtual ~AppCacheTestHelper();
22 void AddGroupAndCache(AppCacheService
* appcache_service
,
23 const GURL
& manifest_url
);
25 void GetOriginsWithCaches(AppCacheService
* appcache_service
,
26 std::set
<GURL
>* origins
);
28 virtual void OnGroupAndNewestCacheStored(
29 appcache::AppCacheGroup
* group
,
30 appcache::AppCache
* newest_cache
,
32 bool would_exceed_quota
) OVERRIDE
;
33 void OnGotAppCacheInfo(int rv
);
38 scoped_refptr
<appcache::AppCacheInfoCollection
> appcache_info_
;
39 std::set
<GURL
>* origins_
; // not owned
41 DISALLOW_COPY_AND_ASSIGN(AppCacheTestHelper
);
44 } // namespace appcache
46 #endif // WEBKIT_BROWSER_APPCACHE_APPCACHE_TEST_HELPER_H_