toolkit/mozapps/update/tests/unit_service_updater/bootstrapSvc.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/toolkit/mozapps/update/tests/unit_service_updater/bootstrapSvc.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,33 @@
     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 +/* Bootstrap the tests using the service by installing our own version of the service */
     1.9 +
    1.10 +function run_test() {
    1.11 +  if (!shouldRunServiceTest(true)) {
    1.12 +    return;
    1.13 +  }
    1.14 +
    1.15 +  setupTestCommon();
    1.16 +  // We don't actually care if the MAR has any data, we only care about the
    1.17 +  // application return code and update.status result.
    1.18 +  gTestFiles = gTestFilesCommon;
    1.19 +  gTestDirs = [];
    1.20 +  setupUpdaterTest(FILE_COMPLETE_MAR, false, false);
    1.21 +
    1.22 +  setupAppFilesAsync();
    1.23 +}
    1.24 +
    1.25 +function setupAppFilesFinished() {
    1.26 +  runUpdateUsingService(STATE_PENDING_SVC, STATE_SUCCEEDED, false);
    1.27 +}
    1.28 +
    1.29 +function checkUpdateFinished() {
    1.30 +  checkFilesAfterUpdateSuccess();
    1.31 +
    1.32 +  // We need to check the service log even though this is a bootstrap
    1.33 +  // because the app bin could be in use by this test by the time the next
    1.34 +  // test runs.
    1.35 +  checkCallbackServiceLog();
    1.36 +}

mercurial