services/sync/tests/tps/test_bug538298.js

Wed, 31 Dec 2014 07:53:36 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:53:36 +0100
branch
TOR_BUG_3246
changeset 5
4ab42b5ab56c
permissions
-rw-r--r--

Correct small whitespace inconsistency, lost while renaming variables.

     1 /* Any copyright is dedicated to the Public Domain.
     2    http://creativecommons.org/publicdomain/zero/1.0/ */
     4 /*
     5  * The list of phases mapped to their corresponding profiles.  The object
     6  * here must be in strict JSON format, as it will get parsed by the Python
     7  * testrunner (no single quotes, extra comma's, etc).
     8  */
     9 EnableEngines(["bookmarks"]);
    11 var phases = { "phase1": "profile1",
    12                "phase2": "profile2",
    13                "phase3": "profile1",
    14                "phase4": "profile2" };
    16 /*
    17  * Bookmark asset lists: these define bookmarks that are used during the test
    18  */
    20 // the initial list of bookmarks to add to the browser
    21 var bookmarks_initial = {
    22   "toolbar": [
    23     { uri: "http://www.google.com",
    24       title: "Google"
    25     },
    26     { uri: "http://www.cnn.com",
    27       title: "CNN",
    28       changes: {
    29         position: "Google"
    30       }
    31     },
    32     { uri: "http://www.mozilla.com",
    33       title: "Mozilla"
    34     },
    35     { uri: "http://www.firefox.com",
    36       title: "Firefox",
    37       changes: {
    38         position: "Mozilla"
    39       }
    40     }
    41   ]
    42 };
    44 var bookmarks_after_move = {
    45   "toolbar": [
    46     { uri: "http://www.cnn.com",
    47       title: "CNN"
    48     },
    49     { uri: "http://www.google.com",
    50       title: "Google"
    51     },
    52     { uri: "http://www.firefox.com",
    53       title: "Firefox"
    54     },
    55     { uri: "http://www.mozilla.com",
    56       title: "Mozilla"
    57     }
    58   ]
    59 };
    61 /*
    62  * Test phases
    63  */
    65 // Add four bookmarks to the toolbar and sync.
    66 Phase('phase1', [
    67   [Bookmarks.add, bookmarks_initial],
    68   [Bookmarks.verify, bookmarks_initial],
    69   [Sync]
    70 ]);
    72 // Sync to profile2 and verify that all four bookmarks are present.
    73 Phase('phase2', [
    74   [Sync],
    75   [Bookmarks.verify, bookmarks_initial]
    76 ]);
    78 // Change the order of the toolbar bookmarks, and sync.
    79 Phase('phase3', [
    80   [Sync],
    81   [Bookmarks.verify, bookmarks_initial],
    82   [Bookmarks.modify, bookmarks_initial],
    83   [Bookmarks.verify, bookmarks_after_move],
    84   [Sync],
    85 ]);
    87 // Go back to profile2, sync, and verify that the bookmarks are reordered
    88 // as expected.
    89 Phase('phase4', [
    90   [Sync],
    91   [Bookmarks.verify, bookmarks_after_move]
    92 ]);

mercurial