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
3 // found in the LICENSE file.
4 
5 #ifndef COMPONENTS_BROWSING_DATA_CONTENT_MOCK_APPCACHE_HELPER_H_
6 #define COMPONENTS_BROWSING_DATA_CONTENT_MOCK_APPCACHE_HELPER_H_
7 
8 #include <list>
9 
10 #include "base/callback_forward.h"
11 #include "base/macros.h"
12 #include "components/browsing_data/content/appcache_helper.h"
13 #include "url/origin.h"
14 
15 namespace content {
16 class BrowserContext;
17 }
18 
19 namespace browsing_data {
20 
21 class MockAppCacheHelper : public AppCacheHelper {
22  public:
23   explicit MockAppCacheHelper(content::BrowserContext* browser_context);
24 
25   void StartFetching(FetchCallback completion_callback) override;
26   void DeleteAppCaches(const url::Origin& origin) override;
27 
28   // Adds AppCache samples.
29   void AddAppCacheSamples();
30 
31   // Notifies the callback.
32   void Notify();
33 
34  private:
35   ~MockAppCacheHelper() override;
36 
37   FetchCallback completion_callback_;
38 
39   std::list<content::StorageUsageInfo> response_;
40 
41   DISALLOW_COPY_AND_ASSIGN(MockAppCacheHelper);
42 };
43 
44 }  // namespace browsing_data
45 
46 #endif  // COMPONENTS_BROWSING_DATA_CONTENT_MOCK_APPCACHE_HELPER_H_
47