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 CHROME_BROWSER_MOCK_BROWSING_DATA_INDEXED_DB_HELPER_H_
6 #define CHROME_BROWSER_MOCK_BROWSING_DATA_INDEXED_DB_HELPER_H_
12 #include "base/callback.h"
13 #include "base/memory/scoped_ptr.h"
14 #include "chrome/browser/browsing_data_indexed_db_helper.h"
16 // Mock for BrowsingDataIndexedDBHelper.
17 // Use AddIndexedDBSamples() or add directly to response_ vector, 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 virtual void StartFetching(
39 Callback1
<const std::vector
<IndexedDBInfo
>& >::Type
* callback
);
40 virtual void CancelNotification();
41 virtual void DeleteIndexedDBFile(const FilePath
& file_path
);
43 FilePath last_deleted_file_
;
46 virtual ~MockBrowsingDataIndexedDBHelper();
50 scoped_ptr
<Callback1
<const std::vector
<IndexedDBInfo
>& >::Type
>
53 std::map
<const FilePath::StringType
, bool> files_
;
55 std::vector
<IndexedDBInfo
> response_
;
58 #endif // CHROME_BROWSER_MOCK_BROWSING_DATA_INDEXED_DB_HELPER_H_