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.
5 #ifndef CHROME_BROWSER_BROWSING_DATA_MOCK_BROWSING_DATA_LOCAL_STORAGE_HELPER_H_
6 #define CHROME_BROWSER_BROWSING_DATA_MOCK_BROWSING_DATA_LOCAL_STORAGE_HELPER_H_
11 #include "base/callback.h"
12 #include "chrome/browser/browsing_data/browsing_data_local_storage_helper.h"
14 // Mock for BrowsingDataLocalStorageHelper.
15 // Use AddLocalStorageSamples() or add directly to response_ list, then
17 class MockBrowsingDataLocalStorageHelper
18 : public BrowsingDataLocalStorageHelper
{
20 explicit MockBrowsingDataLocalStorageHelper(Profile
* profile
);
22 // BrowsingDataLocalStorageHelper implementation.
23 void StartFetching(const FetchCallback
& callback
) override
;
24 void DeleteOrigin(const GURL
& origin
) override
;
26 // Adds some LocalStorageInfo samples.
27 void AddLocalStorageSamples();
29 // Notifies the callback.
32 // Marks all local storage files as existing.
35 // Returns true if all local storage files were deleted since the last Reset()
39 GURL last_deleted_origin_
;
42 ~MockBrowsingDataLocalStorageHelper() override
;
44 FetchCallback callback_
;
46 std::map
<const GURL
, bool> origins_
;
48 std::list
<LocalStorageInfo
> response_
;
50 DISALLOW_COPY_AND_ASSIGN(MockBrowsingDataLocalStorageHelper
);
53 #endif // CHROME_BROWSER_BROWSING_DATA_MOCK_BROWSING_DATA_LOCAL_STORAGE_HELPER_H_