toolkit/mozapps/update/tests/unit_aus_update/cleanupDownloadingForOlderAppVersion.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/toolkit/mozapps/update/tests/unit_aus_update/cleanupDownloadingForOlderAppVersion.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,36 @@
     1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/.
     1.7 + */
     1.8 +
     1.9 +
    1.10 +function run_test() {
    1.11 +  setupTestCommon();
    1.12 +
    1.13 +  logTestInfo("testing cleanup of an update download in progress for an " +
    1.14 +              "older version of the application on startup (Bug 485624)");
    1.15 +
    1.16 +  var patches, updates;
    1.17 +
    1.18 +  patches = getLocalPatchString(null, null, null, null, null, null,
    1.19 +                                STATE_DOWNLOADING);
    1.20 +  updates = getLocalUpdateString(patches, null, null, "version 0.9", "0.9");
    1.21 +  writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true);
    1.22 +  writeStatusFile(STATE_DOWNLOADING);
    1.23 +
    1.24 +  writeUpdatesToXMLFile(getLocalUpdatesXMLString(""), false);
    1.25 +
    1.26 +  standardInit();
    1.27 +
    1.28 +  if (IS_TOOLKIT_GONK) {
    1.29 +    // Gonk doesn't resume downloads at boot time, so the update
    1.30 +    // will remain active until the user chooses a new one, at
    1.31 +    // which point, the old update will be removed.
    1.32 +    do_check_neq(gUpdateManager.activeUpdate, null);
    1.33 +  } else {
    1.34 +    do_check_eq(gUpdateManager.activeUpdate, null);
    1.35 +  }
    1.36 +  do_check_eq(gUpdateManager.updateCount, 0);
    1.37 +
    1.38 +  doTestFinish();
    1.39 +}

mercurial