toolkit/mozapps/update/tests/unit_base_updater/marWrongChannel.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/toolkit/mozapps/update/tests/unit_base_updater/marWrongChannel.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,30 @@
     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 +/* Test product/channel MAR security check */
    1.10 +
    1.11 +function run_test() {
    1.12 +  if (!IS_MAR_CHECKS_ENABLED) {
    1.13 +    return;
    1.14 +  }
    1.15 +
    1.16 +  setupTestCommon();
    1.17 +  // We don't actually care if the MAR has any data, we only care about the
    1.18 +  // application return code and update.status result.
    1.19 +  gTestFiles = gTestFilesCommon;
    1.20 +  gTestDirs = [];
    1.21 +  setupUpdaterTest(FILE_WRONG_CHANNEL_MAR, false, false);
    1.22 +
    1.23 +  // Apply the MAR
    1.24 +  // Note that if execv is used, the updater process will turn into the
    1.25 +  // callback process, so its return code will be that of the callback
    1.26 +  // app.
    1.27 +  runUpdate((USE_EXECV ? 0 : 1), STATE_FAILED_CHANNEL_MISMATCH_ERROR);
    1.28 +}
    1.29 +
    1.30 +function checkUpdateApplied() {
    1.31 +  checkFilesAfterUpdateSuccess();
    1.32 +  doTestFinish();
    1.33 +}

mercurial