Closed
Bug 847863
Opened 12 years ago
Closed 12 years ago
Use the JavaScript API instead of nsIDownloadManager as the back-end for the panel
Categories
(Firefox :: Downloads Panel, defect)
Firefox
Downloads Panel
Tracking
()
RESOLVED
FIXED
Firefox 26
People
(Reporter: Paolo, Assigned: Paolo)
References
(Depends on 2 open bugs, Blocks 2 open bugs)
Details
Attachments
(9 files, 3 obsolete files)
12.42 KB,
patch
|
Details | Diff | Splinter Review | |
18.20 KB,
patch
|
enndeakin
:
review+
|
Details | Diff | Splinter Review |
3.09 KB,
patch
|
enndeakin
:
review+
|
Details | Diff | Splinter Review |
3.97 KB,
patch
|
enndeakin
:
review+
|
Details | Diff | Splinter Review |
2.01 KB,
patch
|
enndeakin
:
review+
|
Details | Diff | Splinter Review |
2.00 KB,
patch
|
enndeakin
:
review+
|
Details | Diff | Splinter Review |
18.30 KB,
patch
|
enndeakin
:
review+
|
Details | Diff | Splinter Review |
1.23 KB,
patch
|
enndeakin
:
review+
|
Details | Diff | Splinter Review |
60.62 KB,
patch
|
Details | Diff | Splinter Review |
When the API implemented in bug 825588 is ready, the Downloads Panel should
use it instead of the nsIDownloadManager interface to display and control
current downloads.
Assignee | ||
Comment 1•12 years ago
|
||
This patch makes the Panel display downloads started using the JavaScript API,
as a demonstration only because many features are not available yet.
Assignee: nobody → paolo.mozmail
Status: NEW → ASSIGNED
Assignee | ||
Updated•12 years ago
|
Blocks: jsdownloads
Comment 2•12 years ago
|
||
How will users do downloads if they have been advised to disable JavaScript because of a security vulnerability? It might be necessary to download a patch or new version of a Mozilla application to eliminate that vulnerability.
Comment 3•12 years ago
|
||
That only disables JS in content websites. Firefox's UI runs on JS, so that won't be disabled.
Assignee | ||
Updated•12 years ago
|
Attachment #725407 -
Attachment is obsolete: true
Comment 4•12 years ago
|
||
Comment 5•12 years ago
|
||
Assignee | ||
Comment 6•12 years ago
|
||
Attachment #792091 -
Flags: review?(enndeakin)
Assignee | ||
Comment 7•12 years ago
|
||
Attachment #792092 -
Flags: review?(enndeakin)
Assignee | ||
Comment 8•12 years ago
|
||
Attachment #792093 -
Flags: review?(enndeakin)
Assignee | ||
Comment 9•12 years ago
|
||
Attachment #792094 -
Flags: review?(enndeakin)
Assignee | ||
Comment 10•12 years ago
|
||
Attachment #792095 -
Flags: review?(enndeakin)
Assignee | ||
Comment 11•12 years ago
|
||
Attachment #790221 -
Attachment is obsolete: true
Attachment #792096 -
Flags: review+
Assignee | ||
Comment 12•12 years ago
|
||
Attachment #792097 -
Flags: review?(enndeakin)
Assignee | ||
Comment 13•12 years ago
|
||
Attachment #792098 -
Flags: review?(enndeakin)
Assignee | ||
Comment 14•12 years ago
|
||
This set of patches implements the changes required to enable the JavaScript
API for downloads on Firefox for Desktop. The approach followed for disabling
tests is designed to have minimal impact on other products:
- Toolkit tests for nsDownloadManager.cpp and the old Download Manager UI are
now disabled on Desktop builds (part 1, 2, and 3). Most of them have a
matching test in the new API, some other may be implemented in the future.
Note that some independent tests in "components/downloads" (like the one for
Application Reputation) are still enabled.
- The DownloadTaskbarProgress module is disabled (part 4). After the API lands,
we should port some of its code and implement a new DownloadTaskbar module
(bug 906620), that client products will use in place of the old one. Nightly
builds will stay without the taskbar indicator for a short time.
- One test is converted to use either the old or the new API depending on their
availability (part 5). The test just waits for the completion of one download,
so the conversion is straightforward.
- Front-end tests that are run on Desktop only are all converted to the new API
at the same time as the preference is enabled (part 6, 7, and 8).
- The "forget about this site" tests didn't require to be changed yet, as they
are still run with the old nsDownloadManager.cpp for now.
Patches are split for easy review, and to allow individual backout in case of
issues with specific test frameworks. Part 6, 7, and 8 should still be kept
together.
Comment 15•12 years ago
|
||
(In reply to Paolo Amadini [:paolo] from comment #14)
> - The "forget about this site" tests didn't require to be changed yet, as
> they
> are still run with the old nsDownloadManager.cpp for now.
>
Since 899125 has been checked in, they should be using the new download manager though.
Can you make a list of the tests (or file bugs) that still need new equivalents?
Assignee | ||
Comment 16•12 years ago
|
||
(In reply to Neil Deakin from comment #15)
> Can you make a list of the tests (or file bugs) that still need new
> equivalents?
Yes, I'll file new bugs for all the tests to be ported. They'll block the
decommissioning of nsIDownloadManager.
Comment 17•12 years ago
|
||
I'm a bit confused why we want to enable the new download manager yet disable many of the tests.
Updated•12 years ago
|
Attachment #792091 -
Flags: review?(enndeakin) → review+
Updated•12 years ago
|
Attachment #792092 -
Flags: review?(enndeakin) → review+
Updated•12 years ago
|
Attachment #792093 -
Flags: review?(enndeakin) → review+
Comment 18•12 years ago
|
||
Comment on attachment 792094 [details] [diff] [review]
Part 4 of 8 - Selectively disable the DownloadTaskbarProgress module.
> const Cc = Components.classes;
> const Ci = Components.interfaces;
>+const Cu = Components.utils;
>+const Cr = Components.results;
You don't use Cr.
Attachment #792094 -
Flags: review?(enndeakin) → review+
Updated•12 years ago
|
Attachment #792095 -
Flags: review?(enndeakin) → review+
Assignee | ||
Comment 19•12 years ago
|
||
(In reply to Neil Deakin from comment #18)
> > const Cc = Components.classes;
> > const Ci = Components.interfaces;
> >+const Cu = Components.utils;
> >+const Cr = Components.results;
>
> You don't use Cr.
I wanted a "standard" header (there are other instances where we declare C?
variables without using them), but I can remove it if you prefer.
Comment 20•12 years ago
|
||
Comment on attachment 792097 [details] [diff] [review]
Part 7 of 8 - Convert Downloads Panel tests.
> // Open the user interface and wait for data to be fully loaded.
> - for (let yy in gen_openPanel(DownloadsCommon.getData(window))) yield undefined;
> + yield task_openPanel(DownloadsCommon.getData(window));
task_openPanel doesn't take an argument.
>+ let originalOnPopupShown = DownloadsPanel.onPopupShown;
>+ DownloadsPanel.onPopupShown = function () {
>+ DownloadsPanel.onPopupShown = originalOnPopupShown;
>+ originalOnPopupShown.apply(this, arguments);
>+ setTimeout(deferred.resolve, 0);
>+ };
Why is a timeout needed here?
Assignee | ||
Comment 21•12 years ago
|
||
(In reply to Neil Deakin from comment #20)
> >+ let originalOnPopupShown = DownloadsPanel.onPopupShown;
> >+ DownloadsPanel.onPopupShown = function () {
> >+ DownloadsPanel.onPopupShown = originalOnPopupShown;
> >+ originalOnPopupShown.apply(this, arguments);
> >+ setTimeout(deferred.resolve, 0);
> >+ };
>
> Why is a timeout needed here?
It's a way to spin the event loop so that we don't continue processing during
the DOM event handler. This has a chance of making the test more robust.
Comment 22•12 years ago
|
||
// Test item data and count. This also tests the ordering of the display.
let richlistbox = document.getElementById("downloadsListBox");
/* disabled for failing intermittently (bug 767828)
is(richlistbox.children.length, DownloadData.length,
"There is the correct number of richlistitems");
*/
Is this disabled part of the test something that can now be enabled, or at least investigated?
> It's a way to spin the event loop so that we don't continue processing during
> the DOM event handler. This has a chance of making the test more robust.
OK, I'm not sure what concern you're thinking of here. popupshown already fires asynchronously after the popup is visible. At least add a comment here explaining the concern.
Updated•12 years ago
|
Attachment #792097 -
Flags: review?(enndeakin) → review+
Updated•12 years ago
|
Attachment #792098 -
Flags: review?(enndeakin) → review+
Assignee | ||
Comment 23•12 years ago
|
||
(In reply to Neil Deakin from comment #22)
> // Test item data and count. This also tests the ordering of the
> display.
> let richlistbox = document.getElementById("downloadsListBox");
> /* disabled for failing intermittently (bug 767828)
> is(richlistbox.children.length, DownloadData.length,
> "There is the correct number of richlistitems");
> */
>
> Is this disabled part of the test something that can now be enabled, or at
> least investigated?
Since this is a front-end issue, our modifications didn't change the situation
here. Bug 767828 is still open in case someone wants to investigate the issue.
Assignee | ||
Comment 24•12 years ago
|
||
Landed part 1 through 5:
https://hg.mozilla.org/integration/fx-team/rev/5b2e0df01a1f
https://hg.mozilla.org/integration/fx-team/rev/257a3ee7fe72
https://hg.mozilla.org/integration/fx-team/rev/3831481da4ce
https://hg.mozilla.org/integration/fx-team/rev/cd67318a6423
https://hg.mozilla.org/integration/fx-team/rev/7d3631d1c8cf
Assignee | ||
Comment 25•12 years ago
|
||
The new Downloads Panel tests may have introduced an intermittent failure, but
it seems infrequent across all platforms:
https://tbpl.mozilla.org/?tree=Try&rev=73816f985eec
I'll land the change and see if the failure can be handled in a new bug, we can
always back out the patch if the intermittent rate is more than expected.
Comment 26•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/5b2e0df01a1f
https://hg.mozilla.org/mozilla-central/rev/257a3ee7fe72
https://hg.mozilla.org/mozilla-central/rev/3831481da4ce
https://hg.mozilla.org/mozilla-central/rev/cd67318a6423
https://hg.mozilla.org/mozilla-central/rev/7d3631d1c8cf
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → Firefox 26
Assignee | ||
Comment 27•12 years ago
|
||
Assignee | ||
Comment 28•12 years ago
|
||
Per comment 25, we should determine the impact of the "TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/browser/components/downloads/test/browser/browser_basic_functionality.js | Test timed out" intermittent failure, and see if we can address that in another bug or disable the test.
Comment 29•12 years ago
|
||
If you're only partially landing a bug, be sure to put [leave open] on the whiteboard so that our merge scripts don't resolve the bug prematurely.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Target Milestone: Firefox 26 → ---
Comment 30•12 years ago
|
||
(In reply to Paolo Amadini [:paolo] from comment #27)
> https://hg.mozilla.org/integration/fx-team/rev/7e8ff4c464f9
> https://hg.mozilla.org/integration/fx-team/rev/36c994d08d1b
> https://hg.mozilla.org/integration/fx-team/rev/c2b4444ad9fd
Parts 6-8 backed out for permaorange browser_sanitize-timespans.js (not sure why it didn't show up until now):
https://tbpl.mozilla.org/php/getParsedLog.php?id=26762434&tree=Mozilla-Central
https://tbpl.mozilla.org/php/getParsedLog.php?id=26761767&tree=Mozilla-Central
https://hg.mozilla.org/mozilla-central/rev/363a8fb2e153
https://hg.mozilla.org/mozilla-central/rev/0620357b639d
https://hg.mozilla.org/mozilla-central/rev/1d6bf2bd4003
Assignee | ||
Comment 31•12 years ago
|
||
(In reply to Ed Morley [:edmorley UTC+1] from comment #30)
> (not sure why it didn't show up until now):
It turns out this test was dependent on the time of the day, and there was an
issue for which we waited for the removal of a download that had been already
removed before. There was also an issue with microseconds conversion.
Thanks a lot to Gijs for the right idea here!
Attachment #792096 -
Attachment is obsolete: true
Assignee | ||
Comment 32•12 years ago
|
||
Tryserver build with slightly updated patch:
https://tbpl.mozilla.org/?tree=Try&rev=810b5f25c7b2
Assignee | ||
Comment 33•12 years ago
|
||
Comment 34•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/e7e8421a738e
https://hg.mozilla.org/mozilla-central/rev/a63da361fb7a
https://hg.mozilla.org/mozilla-central/rev/49873ded6736
Status: REOPENED → RESOLVED
Closed: 12 years ago → 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 26
Comment 35•12 years ago
|
||
As a result of this, the legacy download manager window now no longer shows downloads. Is this expected?
Assignee | ||
Comment 36•12 years ago
|
||
(In reply to IU from comment #35)
> As a result of this, the legacy download manager window now no longer shows
> downloads. Is this expected?
Yes, the old window will not be supported anymore. This will also affect add-ons
interacting with downloads, and we're already working with add-on authors to
ensure we implement the best way forward. For more complete information on
what's happening in Firefox 26, see the announcement here:
https://groups.google.com/d/msg/mozilla.dev.extensions/ltOB3MzVwcI/K8DwIKkkUR0J
Comment 37•12 years ago
|
||
(In reply to Paolo Amadini [:paolo] from comment #36)
> (In reply to IU from comment #35)
> > As a result of this, the legacy download manager window now no longer shows
> > downloads. Is this expected?
>
> Yes, the old window will not be supported anymore. This will also affect
> add-ons
> interacting with downloads, and we're already working with add-on authors to
> ensure we implement the best way forward. For more complete information on
> what's happening in Firefox 26, see the announcement here:
>
> https://groups.google.com/d/msg/mozilla.dev.extensions/ltOB3MzVwcI/
> K8DwIKkkUR0J
Is the legacy window still supported for other xul applications (Thunderbird, the webapp runtime, etc.)?
Assignee | ||
Comment 38•12 years ago
|
||
(In reply to Marco Castelluccio [:marco] from comment #37)
> Is the legacy window still supported for other xul applications
> (Thunderbird, the webapp runtime, etc.)?
Bugs for the possible conversion to Downloads.jsm in individual products are
filed as dependencies of bug 851471 (see for example bug 907732 for Thunderbird).
I don't know how the distribution of the Webapp Runtime works, if you think a new
bug is required, feel free to file it with the appropriate details!
Updated•12 years ago
|
Comment 39•12 years ago
|
||
(In reply to :Paolo Amadini from comment #36)
> (In reply to IU from comment #35)
> > As a result of this, the legacy download manager window now no longer shows
> > downloads. Is this expected?
>
> Yes, the old window will not be supported anymore. This will also affect
> add-ons
> interacting with downloads, and we're already working with add-on authors to
> ensure we implement the best way forward. For more complete information on
> what's happening in Firefox 26, see the announcement here:
>
> https://groups.google.com/d/msg/mozilla.dev.extensions/ltOB3MzVwcI/K8DwIKkkUR0J
WoW O_O... ;_; took me a while to find this *sighs*
I see... There is one FF-Ext I(and a lot of other people like too ^:_^) use called:
Download Manager Tweak :: Add-ons for Firefox
https://addons.mozilla.org/en-US/firefox/addon/download-manager-tweak/
Download Manager Tweak (mozdev.org - Home)
http://dmextension.mozdev.org/
the changes made with this update to FF26 of course made it non functional... in the back end atleast...
the GUI/form still appears when activated.. but no downloads were being displayed/saved to the list...
and I noticed that after FF20 or was it FF21.... when the new download experience went into effect... integrating the Download window into the "library" window... even when I would clear all downloads from DMT's own window... they were NOT being cleared from the Library-->Downloads window.... :( lol.
Is there anyone that could take over FF-Ext DMT? as the dev(s) for it are MIA/retired(again)(loi)...
or at least maybe update it (loi ;_; I know I am asking allot. *_*)
You need to log in
before you can comment on or make changes to this bug.
Description
•