Open Bug 442434 Opened 13 years ago Updated 13 years ago

Automate litmus test Testcase ID #4579 - New downloads appear at the top of the DM listing

Categories

(Toolkit :: Downloads API, defect)

defect
Not set
normal

Tracking

()

ASSIGNED

People

(Reporter: poonaatsoc, Assigned: poonaatsoc)

References

(Blocks 1 open bug, )

Details

Attachments

(1 file, 2 obsolete files)

Proposed type of test: chrome 

Proposed location of test: toolkit/mozapps/downloads/tests/chrome
Note: as long as we have a test that checks that double clicking performs the same action as enter (which we either do, or you are making one), you do not need to do that part of the test.

You'll also probably want to add downloads to the database in an already canceled state so you don't have to cancel them (we test canceling in the UI in another test as well).
I had named this bug wrongly.  I have updated the name of this bug to the right test.  Sorry for the inconvenience caused. 
Summary: Automate litmus test Testcase ID #4580 - Cancelled download - Retry → Automate litmus test Testcase ID #4579 - New downloads appear at the top of the DM listing
Attached patch v1.0 (obsolete) — Splinter Review
Attachment #328934 - Flags: review?(sdwilsh)
Attached patch v2.0 (obsolete) — Splinter Review
Attachment #328934 - Attachment is obsolete: true
Attachment #329202 - Flags: review?(sdwilsh)
Attachment #328934 - Flags: review?(sdwilsh)
Attached patch v3.0Splinter Review
I have added this test to test_basic_functionality.xul

The test works.  Have run and checked it.  The only issue is that the download completes before I can do the check.  We need to check how we can keep pumping data continuously till we do the check.

Also I have experience a strange thing.  I am not able to fathom the reason for the issue.  I have included utils.js in the file.  I have cleanUp() and addDownload() in utils.js.  But if I use the functions in utils.js the test hangs.  This is the reason I have included addDownload as an inner function in the test and have not called cleanUp()

To confirm that the test works, I have checked the parameters and the values of the downloads in the middle of running
Attachment #329202 - Attachment is obsolete: true
Attachment #329827 - Flags: review?(sdwilsh)
Attachment #329202 - Flags: review?(sdwilsh)
Comment on attachment 329827 [details] [diff] [review]
v3.0

I have a better idea on how to to test this, without needing to download anything.  Each test function will be able to get the window, so you need to just do something like:
aWin.gDownloadProgressListener.onStateChange(Ci.nsIDownloadManager.DOWNLOAD_QUEUED, { /* dummy data to represent an nsIDownload */ });
Attachment #329827 - Flags: review?(sdwilsh)
Product: Firefox → Toolkit
You need to log in before you can comment on or make changes to this bug.