services/sync/tests/tps/test_bug531489.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/services/sync/tests/tps/test_bug531489.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,62 @@
     1.4 +/* Any copyright is dedicated to the Public Domain.
     1.5 +   http://creativecommons.org/publicdomain/zero/1.0/ */
     1.6 +
     1.7 +/*
     1.8 + * The list of phases mapped to their corresponding profiles.  The object
     1.9 + * here must be in strict JSON format, as it will get parsed by the Python
    1.10 + * testrunner (no single quotes, extra comma's, etc).
    1.11 + */
    1.12 +EnableEngines(["bookmarks"]);
    1.13 +
    1.14 +var phases = { "phase1": "profile1",
    1.15 +               "phase2": "profile2",
    1.16 +               "phase3": "profile1"};
    1.17 +
    1.18 +/*
    1.19 + * Bookmark asset lists: these define bookmarks that are used during the test
    1.20 + */
    1.21 +
    1.22 +// the initial list of bookmarks to add to the browser
    1.23 +var bookmarks_initial = {
    1.24 +  "menu": [
    1.25 +    { folder: "foldera" },
    1.26 +    { uri: "http://www.google.com",
    1.27 +      title: "Google"
    1.28 +    }
    1.29 +  ],
    1.30 +  "menu/foldera": [
    1.31 +    { uri: "http://www.google.com",
    1.32 +      title: "Google"
    1.33 +    }
    1.34 +  ],
    1.35 +  "toolbar": [
    1.36 +    { uri: "http://www.google.com",
    1.37 +      title: "Google"
    1.38 +    }
    1.39 +  ]
    1.40 +};
    1.41 +
    1.42 +/*
    1.43 + * Test phases
    1.44 + */
    1.45 +
    1.46 +// Add three bookmarks with the same url to different locations and sync.
    1.47 +Phase('phase1', [
    1.48 +  [Bookmarks.add, bookmarks_initial],
    1.49 +  [Bookmarks.verify, bookmarks_initial],
    1.50 +  [Sync]
    1.51 +]);
    1.52 +
    1.53 +// Sync to profile2 and verify that all three bookmarks are present
    1.54 +Phase('phase2', [
    1.55 +  [Sync],
    1.56 +  [Bookmarks.verify, bookmarks_initial]
    1.57 +]);
    1.58 +
    1.59 +// Sync again to profile1 and verify that all three bookmarks are still
    1.60 +// present.
    1.61 +Phase('phase3', [
    1.62 +  [Sync],
    1.63 +  [Bookmarks.verify, bookmarks_initial]
    1.64 +]);
    1.65 +

mercurial