B2G/gecko/toolkit/mozapps/extensions/test/xpcshell/test_blocklistchange.js
// Manually updates the test add-ons to the given version
Manually updates the test add-ons to the given version
Manually updates the test add - ons to the given version
function manual_update(aVersion, aCallback) {
  var installs = [];
  AddonManager.getInstallForURL("http://localhost:4444/addons/blocklist_soft1_" + aVersion + ".xpi",
                                function(aInstall) {
    installs.push(aInstall);
    AddonManager.getInstallForURL("http://localhost:4444/addons/blocklist_soft2_" + aVersion + ".xpi",
                                  function(aInstall) {
      installs.push(aInstall);
      AddonManager.getInstallForURL("http://localhost:4444/addons/blocklist_soft3_" + aVersion + ".xpi",
                                    function(aInstall) {
        installs.push(aInstall);
        AddonManager.getInstallForURL("http://localhost:4444/addons/blocklist_soft4_" + aVersion + ".xpi",
                                      function(aInstall) {
          installs.push(aInstall);
          AddonManager.getInstallForURL("http://localhost:4444/addons/blocklist_soft5_" + aVersion + ".xpi",
                                        function(aInstall) {
            installs.push(aInstall);
            AddonManager.getInstallForURL("http://localhost:4444/addons/blocklist_hard1_" + aVersion + ".xpi",
                                          function(aInstall) {
              installs.push(aInstall);
              AddonManager.getInstallForURL("http://localhost:4444/addons/blocklist_regexp1_" + aVersion + ".xpi",
                                            function(aInstall) {
                installs.push(aInstall);
                Services.obs.addObserver(function(aSubject, aTopic, aData) {
                  Services.obs.removeObserver(arguments.callee, "addon-install-blocked");
                  aSubject.QueryInterface(Ci.amIWebInstallInfo);
                  var installCount = aSubject.installs.length;
                  var listener = {
                    installComplete: function() {
                      installCount--;
                      if (installCount)
                        return;
                      do_execute_soon(aCallback);
                    },
                    onDownloadCancelled: function(aInstall) {
                      this.installComplete();
                    },
                    onInstallEnded: function(aInstall) {
                      this.installComplete();
                    }
                  };
                  aSubject.installs.forEach(function(aInstall) {
                    aInstall.addListener(listener);
                  });
                  aSubject.install();
                }, "addon-install-blocked", false);
                AddonManager.installAddonsFromWebpage("application/x-xpinstall", null,
                                                      NetUtil.newURI("http://localhost:4444/"),
                                                      installs);
              }, "application/x-xpinstall");
            }, "application/x-xpinstall");
          }, "application/x-xpinstall");
        }, "application/x-xpinstall");
      }, "application/x-xpinstall");
    }, "application/x-xpinstall");
  }, "application/x-xpinstall");
}
function manual_update ( aVersion , aCallback ) { var installs = [ ] ; AddonManager . getInstallForURL ( "http://localhost:4444/addons/blocklist_soft1_" + aVersion + ".xpi" , function ( aInstall ) { installs . push ( aInstall ) ; AddonManager . getInstallForURL ( "http://localhost:4444/addons/blocklist_soft2_" + aVersion + ".xpi" , function ( aInstall ) { installs . push ( aInstall ) ; AddonManager . getInstallForURL ( "http://localhost:4444/addons/blocklist_soft3_" + aVersion + ".xpi" , function ( aInstall ) { installs . push ( aInstall ) ; AddonManager . getInstallForURL ( "http://localhost:4444/addons/blocklist_soft4_" + aVersion + ".xpi" , function ( aInstall ) { installs . push ( aInstall ) ; AddonManager . getInstallForURL ( "http://localhost:4444/addons/blocklist_soft5_" + aVersion + ".xpi" , function ( aInstall ) { installs . push ( aInstall ) ; AddonManager . getInstallForURL ( "http://localhost:4444/addons/blocklist_hard1_" + aVersion + ".xpi" , function ( aInstall ) { installs . push ( aInstall ) ; AddonManager . getInstallForURL ( "http://localhost:4444/addons/blocklist_regexp1_" + aVersion + ".xpi" , function ( aInstall ) { installs . push ( aInstall ) ; Services . obs . addObserver ( function ( aSubject , aTopic , aData ) { Services . obs . removeObserver ( arguments . callee , "addon-install-blocked" ) ; aSubject . QueryInterface ( Ci . amIWebInstallInfo ) ; var installCount = aSubject . installs . length ; var listener = { installComplete : function ( ) { installCount -- ; if ( installCount ) return ; do_execute_soon ( aCallback ) ; } , onDownloadCancelled : function ( aInstall ) { this . installComplete ( ) ; } , onInstallEnded : function ( aInstall ) { this . installComplete ( ) ; } } ; aSubject . installs . forEach ( function ( aInstall ) { aInstall . addListener ( listener ) ; } ) ; aSubject . install ( ) ; } , "addon-install-blocked" , false ) ; AddonManager . installAddonsFromWebpage ( "application/x-xpinstall" , null , NetUtil . newURI ( "http://localhost:4444/" ) , installs ) ; } , "application/x-xpinstall" ) ; } , "application/x-xpinstall" ) ; } , "application/x-xpinstall" ) ; } , "application/x-xpinstall" ) ; } , "application/x-xpinstall" ) ; } , "application/x-xpinstall" ) ; } , "application/x-xpinstall" ) ; }
Manually updates the test add-ons to the given version
Manually updates the test add - ons to the given version