michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: /* michael@0: * The list of phases mapped to their corresponding profiles. The object michael@0: * here must be in strict JSON format, as it will get parsed by the Python michael@0: * testrunner (no single quotes, extra comma's, etc). michael@0: */ michael@0: EnableEngines(["history"]); michael@0: michael@0: var phases = { "phase1": "profile1", michael@0: "phase2": "profile2" }; michael@0: michael@0: /* michael@0: * History asset lists: these define history entries that are used during michael@0: * the test michael@0: */ michael@0: michael@0: // the initial list of history items to add to the browser michael@0: var history1 = [ michael@0: { uri: "http://www.google.com/", michael@0: title: "Google", michael@0: visits: [ michael@0: { type: 1, michael@0: date: 0 michael@0: }, michael@0: { type: 2, michael@0: date: -1 michael@0: } michael@0: ] michael@0: }, michael@0: { uri: "http://www.cnn.com/", michael@0: title: "CNN", michael@0: visits: [ michael@0: { type: 1, michael@0: date: -1 michael@0: }, michael@0: { type: 2, michael@0: date: -36 michael@0: } michael@0: ] michael@0: }, michael@0: { uri: "http://www.google.com/language_tools?hl=en", michael@0: title: "Language Tools", michael@0: visits: [ michael@0: { type: 1, michael@0: date: 0 michael@0: }, michael@0: { type: 2, michael@0: date: -40 michael@0: } michael@0: ] michael@0: }, michael@0: { uri: "http://www.mozilla.com/", michael@0: title: "Mozilla", michael@0: visits: [ michael@0: { type: 1, michael@0: date: 0 michael@0: }, michael@0: { type: 1, michael@0: date: -1 michael@0: }, michael@0: { type: 1, michael@0: date: -20 michael@0: }, michael@0: { type: 2, michael@0: date: -36 michael@0: } michael@0: ] michael@0: } michael@0: ]; michael@0: michael@0: // a list of items to delete from the history michael@0: var history_to_delete = [ michael@0: { uri: "http://www.cnn.com/" }, michael@0: { begin: -24, michael@0: end: -1 michael@0: }, michael@0: { host: "www.google.com" } michael@0: ]; michael@0: michael@0: // a list which reflects items that should be in the history after michael@0: // the above items are deleted michael@0: var history2 = [ michael@0: { uri: "http://www.mozilla.com/", michael@0: title: "Mozilla", michael@0: visits: [ michael@0: { type: 1, michael@0: date: 0 michael@0: }, michael@0: { type: 2, michael@0: date: -36 michael@0: } michael@0: ] michael@0: } michael@0: ]; michael@0: michael@0: // a list which includes history entries that should not be present michael@0: // after deletion of the history_to_delete entries michael@0: var history_not = [ michael@0: { uri: "http://www.google.com/", michael@0: title: "Google", michael@0: visits: [ michael@0: { type: 1, michael@0: date: 0 michael@0: }, michael@0: { type: 2, michael@0: date: -1 michael@0: } michael@0: ] michael@0: }, michael@0: { uri: "http://www.cnn.com/", michael@0: title: "CNN", michael@0: visits: [ michael@0: { type: 1, michael@0: date: -1 michael@0: }, michael@0: { type: 2, michael@0: date: -36 michael@0: } michael@0: ] michael@0: }, michael@0: { uri: "http://www.google.com/language_tools?hl=en", michael@0: title: "Language Tools", michael@0: visits: [ michael@0: { type: 1, michael@0: date: 0 michael@0: }, michael@0: { type: 2, michael@0: date: -40 michael@0: } michael@0: ] michael@0: }, michael@0: { uri: "http://www.mozilla.com/", michael@0: title: "Mozilla", michael@0: visits: [ michael@0: { type: 1, michael@0: date: -1 michael@0: }, michael@0: { type: 1, michael@0: date: -20 michael@0: } michael@0: ] michael@0: } michael@0: ]; michael@0: michael@0: /* michael@0: * Test phases michael@0: * Note: there is no test phase in which deleted history entries are michael@0: * synced to other clients. This functionality is not supported by michael@0: * Sync, see bug 446517. michael@0: */ michael@0: michael@0: Phase('phase1', [ michael@0: [History.add, history1], michael@0: [Sync], michael@0: ]); michael@0: michael@0: Phase('phase2', [ michael@0: [Sync], michael@0: [History.verify, history1], michael@0: [History.delete, history_to_delete], michael@0: [History.verify, history2], michael@0: [History.verifyNot, history_not], michael@0: [Sync] michael@0: ]); michael@0: