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_INDEXED_DB_HELPER_H_
6 #define CHROME_BROWSER_BROWSING_DATA_MOCK_BROWSING_DATA_INDEXED_DB_HELPER_H_
11 #include "base/callback.h"
12 #include "chrome/browser/browsing_data/browsing_data_indexed_db_helper.h"
16 // Mock for BrowsingDataIndexedDBHelper.
17 // Use AddIndexedDBSamples() or add directly to response_ list, then
19 class MockBrowsingDataIndexedDBHelper
20 : public BrowsingDataIndexedDBHelper
{
22 explicit MockBrowsingDataIndexedDBHelper(Profile
* profile
);
24 // Adds some IndexedDBInfo samples.
25 void AddIndexedDBSamples();
27 // Notifies the callback.
30 // Marks all indexed db files as existing.
33 // Returns true if all indexed db files were deleted since the last
34 // Reset() invokation.
37 // BrowsingDataIndexedDBHelper.
38 void StartFetching(const FetchCallback
& callback
) override
;
39 void DeleteIndexedDB(const GURL
& origin
) override
;
42 ~MockBrowsingDataIndexedDBHelper() override
;
44 FetchCallback callback_
;
45 std::map
<GURL
, bool> origins_
;
46 std::list
<content::IndexedDBInfo
> response_
;
48 DISALLOW_COPY_AND_ASSIGN(MockBrowsingDataIndexedDBHelper
);
51 #endif // CHROME_BROWSER_BROWSING_DATA_MOCK_BROWSING_DATA_INDEXED_DB_HELPER_H_