Revision control

1
/* This Source Code Form is subject to the terms of the Mozilla Public
2
* License, v. 2.0. If a copy of the MPL was not distributed with this
3
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
5
import Foundation
6
import Storage
7
import Shared
8
9
/*
10
* A class that adheres to all the requirements for a profile's history property
11
* with all of the methods set to fatalError. Use this class if you're looking to
12
* mock out parts of the history API
13
*/
14
class MockableHistory: BrowserHistory, SyncableHistory, ResettableSyncStorage {
15
func getFrecentHistory() -> FrecentHistory { fatalError() }
16
func getTopSitesWithLimit(_ limit: Int) -> Deferred<Maybe<Cursor<Site>>> { fatalError() }
17
func addLocalVisit(_ visit: SiteVisit) -> Success { fatalError() }
18
func clearHistory() -> Success { fatalError() }
19
func removeHistoryFromDate(_ date: Date) -> Success { fatalError() }
20
func removeHistoryForURL(_ url: String) -> Success { fatalError() }
21
func removeSiteFromTopSites(_ site: Site) -> Success { fatalError() }
22
func removeHostFromTopSites(_ host: String) -> Success { fatalError() }
23
func clearTopSitesCache() -> Success { fatalError() }
24
func removeFromPinnedTopSites(_ site: Site) -> Success { fatalError() }
25
func isPinnedTopSite(_ url: String) -> Deferred<Maybe<Bool>> { fatalError()}
26
func addPinnedTopSite(_ site: Site) -> Success { fatalError() }
27
func getPinnedTopSites() -> Deferred<Maybe<Cursor<Site>>> { fatalError() }
28
func getSitesByLastVisit(limit: Int, offset: Int) -> Deferred<Maybe<Cursor<Site>>> { fatalError() }
29
func setTopSitesNeedsInvalidation() { fatalError() }
30
func updateTopSitesCacheIfInvalidated() -> Deferred<Maybe<Bool>> { fatalError() }
31
func setTopSitesCacheSize(_ size: Int32) { fatalError() }
32
func onRemovedAccount() -> Success { fatalError() }
33
func ensurePlaceWithURL(_ url: String, hasGUID guid: GUID) -> Success { fatalError() }
34
func deleteByGUID(_ guid: GUID, deletedAt: Timestamp) -> Success { fatalError() }
35
func storeRemoteVisits(_ visits: [Visit], forGUID guid: GUID) -> Success { fatalError() }
36
func insertOrUpdatePlace(_ place: Place, modified: Timestamp) -> Deferred<Maybe<GUID>> { fatalError() }
37
func getModifiedHistoryToUpload() -> Deferred<Maybe<[(Place, [Visit])]>> { fatalError() }
38
func getDeletedHistoryToUpload() -> Deferred<Maybe<[GUID]>> { fatalError() }
39
func markAsSynchronized(_: [GUID], modified: Timestamp) -> Deferred<Maybe<Timestamp>> { fatalError() }
40
func markAsDeleted(_ guids: [GUID]) -> Success { fatalError() }
41
func doneApplyingRecordsAfterDownload() -> Success { fatalError() }
42
func doneUpdatingMetadataAfterUpload() -> Success { fatalError() }
43
func hasSyncedHistory() -> Deferred<Maybe<Bool>> { fatalError() }
44
func resetClient() -> Success { fatalError() }
45
}
46