michael@0: // -*- Mode: js2; tab-width: 2; indent-tabs-mode: nil; js2-basic-offset: 2; js2-skip-preprocessor-directives: t; -*- michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: "use strict"; michael@0: michael@0: var HistoryTestHelper = { michael@0: _originalNavHistoryService: null, michael@0: _startView: null, michael@0: MockNavHistoryService: { michael@0: getNewQueryOptions: function () { michael@0: return {}; michael@0: }, michael@0: getNewQuery: function () { michael@0: return { michael@0: setFolders: function(){} michael@0: }; michael@0: }, michael@0: executeQuery: function () { michael@0: return { michael@0: root: { michael@0: get childCount() { michael@0: return Object.keys(HistoryTestHelper._nodes).length; michael@0: }, michael@0: michael@0: getChild: function (aIndex) HistoryTestHelper._nodes[Object.keys(HistoryTestHelper._nodes)[aIndex]] michael@0: } michael@0: } michael@0: } michael@0: }, michael@0: michael@0: _originalHistoryService: null, michael@0: MockHistoryService: { michael@0: removePage: function (aURI) { michael@0: delete HistoryTestHelper._nodes[aURI.spec]; michael@0: michael@0: // Simulate observer notification michael@0: HistoryTestHelper._startView.onDeleteURI(aURI); michael@0: }, michael@0: }, michael@0: michael@0: Node: function (aTitle, aURISpec) { michael@0: this.title = aTitle; michael@0: this.uri = aURISpec; michael@0: this.pinned = true michael@0: }, michael@0: michael@0: _nodes: null, michael@0: createNodes: function (aMany) { michael@0: this._nodes = {}; michael@0: for (let i=0; i