Skip to content

Commit

Permalink
Bug 1547216 - Make the browser chrome test app_update.sjs handle HEAD…
Browse files Browse the repository at this point in the history
… requests for BITS downloads. r=bytesized

Differential Revision: https://phabricator.services.mozilla.com/D28980

--HG--
extra : moz-landing-system : lando
  • Loading branch information
Robert Strong committed Apr 26, 2019
1 parent 90f6351 commit 1377222
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion toolkit/mozapps/update/tests/browser/app_update.sjs
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,17 @@ function handleRequest(aRequest, aResponse) {
// mar will be downloaded asynchronously which will allow the ui to load
// before the download completes.
if (params.slowDownloadMar) {
let retries = 0;
aResponse.processAsync();
aResponse.setHeader("Content-Type", "binary/octet-stream");
aResponse.setHeader("Content-Length", SIZE_SIMPLE_MAR);

// BITS will first make a HEAD request followed by a GET request.
if (aRequest.method == "HEAD") {
aResponse.finish();
return;
}

let retries = 0;
gSlowDownloadTimer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
gSlowDownloadTimer.initWithCallback(function(aTimer) {
let continueFile = getTestDataFile(CONTINUE_DOWNLOAD);
Expand Down

0 comments on commit 1377222

Please sign in to comment.