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: "phase3": "profile1", michael@0: "phase4": "profile2" }; michael@0: michael@0: /* michael@0: * History lists michael@0: */ michael@0: michael@0: // the initial list of history 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: ] 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.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: // the history to delete michael@0: var history_to_delete = [ michael@0: { uri: "http://www.cnn.com/", michael@0: title: "CNN" michael@0: }, michael@0: { begin: -36, michael@0: end: -1 michael@0: } michael@0: ]; michael@0: michael@0: var history_not = [ 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: ]; michael@0: michael@0: var history_after_delete = [ 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: ] 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: ] michael@0: } michael@0: ]; michael@0: michael@0: /* michael@0: * Test phases 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: [History.add, history1], michael@0: [Sync, SYNC_WIPE_REMOTE] michael@0: ]); michael@0: michael@0: Phase('phase3', [ michael@0: [Sync], michael@0: [History.verify, history1], michael@0: [History.delete, history_to_delete], michael@0: [History.verify, history_after_delete], michael@0: [History.verifyNot, history_not], michael@0: [Sync] michael@0: ]); michael@0: michael@0: Phase('phase4', [ michael@0: [Sync], michael@0: [History.verify, history_after_delete], michael@0: [History.verifyNot, history_not] michael@0: ]); michael@0: