Closed Bug 945099 Opened 12 years ago Closed 12 years ago

[Download API] Enhance basic download API mochitest with attribute checks

Categories

(Firefox OS Graveyard :: General, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
1.3 C1/1.4 S1(20dec)

People

(Reporter: jsmith, Assigned: jsmith)

References

Details

Attachments

(1 file, 1 obsolete file)

Enhance the existing basic download API mochitest with more attribute checks.
Assignee: nobody → jsmith
Status: NEW → ASSIGNED
Attached patch Patch v1 (obsolete) — Splinter Review
Comment on attachment 8340873 [details] [diff] [review] Patch v1 Here's a first pass at enhancing the basic download API mochitest with more attribute checks. Some questions for feedback before I clean this up for review: 1. When I checked the value of download.path, I noticed that it matched serve_file.sjs, rather than the download attribute name of test.bin. Any ideas why? 2. Accessing startTime right at downloadStart apparently is firing NS_ERROR_UNEXPECTED. Any ideas why? 3. Accessing error right at downloadStart sometimes will also fire NS_ERROR_UNEXPECTED. Any ideas why? 4. The total bytes amount at download start is equal to zero, not 1024 bytes. Any ideas why?
Attachment #8340873 - Flags: feedback?(aus)
Depends on: 944682
(In reply to Jason Smith [:jsmith] from comment #2) > Comment on attachment 8340873 [details] [diff] [review] > Patch v1 > > Here's a first pass at enhancing the basic download API mochitest with more > attribute checks. > > Some questions for feedback before I clean this up for review: > > 1. When I checked the value of download.path, I noticed that it matched > serve_file.sjs, rather than the download attribute name of test.bin. Any > ideas why? Hm no, that should really do the right thing. > 2. Accessing startTime right at downloadStart apparently is firing > NS_ERROR_UNEXPECTED. Any ideas why? > > 3. Accessing error right at downloadStart sometimes will also fire > NS_ERROR_UNEXPECTED. Any ideas why? We probably fail to initialize these when creating the DOM download objects. Should be an easy fix. > 4. The total bytes amount at download start is equal to zero, not 1024 > bytes. Any ideas why? It seems that the backend sends us a downloadStarted event as soon as possible, including even before all the http headers are available. Note that in some cases we will never now the total bytes anyway, if the server doesn't set it.
Attachment #8340873 - Flags: feedback?(aus)
Depends on: 945323
Depends on: 945366
(In reply to Fabrice Desré [:fabrice] from comment #3) > (In reply to Jason Smith [:jsmith] from comment #2) > > Comment on attachment 8340873 [details] [diff] [review] > > Patch v1 > > > > Here's a first pass at enhancing the basic download API mochitest with more > > attribute checks. > > > > Some questions for feedback before I clean this up for review: > > > > 1. When I checked the value of download.path, I noticed that it matched > > serve_file.sjs, rather than the download attribute name of test.bin. Any > > ideas why? > > Hm no, that should really do the right thing. Okay. I filed bug 945323 to address that. > > > 2. Accessing startTime right at downloadStart apparently is firing > > NS_ERROR_UNEXPECTED. Any ideas why? > > > > 3. Accessing error right at downloadStart sometimes will also fire > > NS_ERROR_UNEXPECTED. Any ideas why? > > We probably fail to initialize these when creating the DOM download objects. > Should be an easy fix. Okay - bug 944682 & bug 945366 are filed for fixing that. > > > 4. The total bytes amount at download start is equal to zero, not 1024 > > bytes. Any ideas why? > > It seems that the backend sends us a downloadStarted event as soon as > possible, including even before all the http headers are available. Note > that in some cases we will never now the total bytes anyway, if the server > doesn't set it. Would we know the totalBytes by the time onstatechange fires (assuming the server sets it in the headers)?
What's existing here passed on try so far: https://tbpl.mozilla.org/?tree=Try&rev=59c1bd61e390
Depends on: 948287
No longer depends on: 944682
Attachment #8340873 - Attachment is obsolete: true
Attached patch Patch v2Splinter Review
Comment on attachment 8345152 [details] [diff] [review] Patch v2 Ready for review. Will kick off a try run shortly.
Attachment #8345152 - Flags: review?(aus)
(In reply to Jason Smith [:jsmith] from comment #8) > https://tbpl.mozilla.org/?tree=Try&rev=545f1ac4772e Try run is green.
Comment on attachment 8345152 [details] [diff] [review] Patch v2 Review of attachment 8345152 [details] [diff] [review]: ----------------------------------------------------------------- Looks like a good addition to the current tests. We can land this on it's own or as part of the first set of fixes for accessing attributes. Either/or is fine with me. :)
Attachment #8345152 - Flags: review?(aus) → review+
Keywords: checkin-needed
Flags: in-testsuite+
Keywords: checkin-needed
Whiteboard: [fixed-in-fx-team]
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → 1.3 C1/1.4 S1(20dec)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: