services/sync/tests/tps/test_addon_reconciling.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* Any copyright is dedicated to the Public Domain.
     2    http://creativecommons.org/publicdomain/zero/1.0/ */
     4 // This test verifies that record reconciling works as expected. It makes
     5 // similar changes to add-ons in separate profiles and does a sync to verify
     6 // the proper action is taken.
     7 EnableEngines(["addons"]);
     9 let phases = {
    10   "phase01": "profile1",
    11   "phase02": "profile2",
    12   "phase03": "profile1",
    13   "phase04": "profile2",
    14   "phase05": "profile1",
    15   "phase06": "profile2"
    16 };
    18 const id = "restartless-xpi@tests.mozilla.org";
    20 // Install the add-on in 2 profiles.
    21 Phase("phase01", [
    22   [Addons.verifyNot, [id]],
    23   [Addons.install, [id]],
    24   [Addons.verify, [id], STATE_ENABLED],
    25   [Sync]
    26 ]);
    27 Phase("phase02", [
    28   [Addons.verifyNot, [id]],
    29   [Sync],
    30   [Addons.verify, [id], STATE_ENABLED]
    31 ]);
    33 // Now we disable in one and uninstall in the other.
    34 Phase("phase03", [
    35   [Sync], // Get GUID updates, potentially.
    36   [Addons.setEnabled, [id], STATE_DISABLED],
    37 ]);
    38 Phase("phase04", [
    39   [EnsureTracking],
    40   [Addons.uninstall, [id]],
    41   [Sync]
    42 ]);
    44 // When we sync, the uninstall should take precedence because it was newer.
    45 Phase("phase05", [
    46   [Sync]
    47 ]);
    48 Phase("phase06", [
    49   [Sync],
    50   [Addons.verifyNot, [id]]
    51 ]);

mercurial