Closed Bug 786399 Opened 10 years ago Closed 10 years ago

error: TEST FAILED: test-xhr.testResponseHeaders (failure)


(Add-on SDK Graveyard :: General, defect, P1)



(Not tracked)



(Reporter: KWierso, Assigned: KWierso)




(1 file, 1 obsolete file)

Something in the private-browsing stuff that just landed today broke a test:

error: TEST FAILED: test-xhr.testResponseHeaders (failure)
error: fail: XHR's headers are valid ("Content-Type: text/plain\r\nContent-Length: 2697\r\n" != "Content-Type: text/plain\r\n")
info: Traceback (most recent call last):
  File "resource://1ac4ecd0-f3b6-4421-9a55-b2233f91bec4-at-jetpack/api-utils/lib/xhr.js", line 121, in null
    self._orsc.apply(self, arguments);
  File "resource://1ac4ecd0-f3b6-4421-9a55-b2233f91bec4-at-jetpack/api-utils/tests/test-xhr.js", line 67, in null
    "XHR's headers are valid");
  File "resource://1ac4ecd0-f3b6-4421-9a55-b2233f91bec4-at-jetpack/api-utils/lib/unit-test.js", line 164, in assertEqual;
  File "resource://1ac4ecd0-f3b6-4421-9a55-b2233f91bec4-at-jetpack/api-utils/lib/unit-test.js", line 71, in fail
Misread it again, this looks much more like bug 782342. 

With Content-Length now always being sent, the test just needs to be updated to account for that.

I should be able to get the test fixed in a few hours when I get in to the office today.
Assignee: nobody → kwierso
Blocks: 782342
No longer blocks: 783562
Attached patch Ignore Content-Length header (obsolete) — Splinter Review
So, this strips off the end of the received headers making the test ignore the newly added Content-Length header because calculating the file-size of the file the test ended up being horribly complicated.

I'm all for having a better fix than this, but this gets tests passing again for now.
Attachment #656398 - Flags: review?(dtownsend+bugmail)
So this is similar to my previous patch, but it applies the same technique for all versions of Firefox, reducing the length of the test.
Attachment #656398 - Attachment is obsolete: true
Attachment #656398 - Flags: review?(dtownsend+bugmail)
Attachment #656401 - Flags: review?(dtownsend+bugmail)
Attachment #656401 - Flags: review?(dtownsend+bugmail) → review+
Commit pushed to master at
Fix bug 786399 by ignoring the new mandatory Content-Length header
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.