Closed
Bug 806743
Opened 12 years ago
Closed 11 years ago
See if toolkit/components/places/tests/unit/test_download_history.js makes sense in the new PB world
Categories
(Firefox :: Private Browsing, defect)
Tracking
()
RESOLVED
FIXED
Firefox 21
People
(Reporter: ehsan.akhgari, Assigned: andreshm)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 6 obsolete files)
7.15 KB,
patch
|
Details | Diff | Splinter Review |
No description provided.
Comment 1•12 years ago
|
||
I'm modifying the test in bug 723005 to pass.
Reporter | ||
Comment 2•12 years ago
|
||
(In reply to Josh Matthews [:jdm] from comment #1) > I'm modifying the test in bug 723005 to pass. Hmm, if I'm reading attachment 676400 [details] [diff] [review] correctly, that just removes the test, right?
Reporter | ||
Comment 3•12 years ago
|
||
Josh: ping?
Comment 4•12 years ago
|
||
Yes.
Reporter | ||
Comment 5•12 years ago
|
||
So should we close this bug then?
Comment 6•12 years ago
|
||
It would probably be good to write a browser-chrome test that initiated a download and checked that it didn't end up in the history and that we didn't receive a link visited notification for it.
Updated•12 years ago
|
Assignee: josh → nobody
Assignee | ||
Updated•12 years ago
|
Assignee: nobody → andres
Assignee | ||
Updated•12 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 7•12 years ago
|
||
Created a browser-chrome test as suggest in comment 6
Attachment #693586 -
Flags: review?(josh)
Comment 8•12 years ago
|
||
Comment on attachment 693586 [details] [diff] [review] Patch v1 Review of attachment 693586 [details] [diff] [review]: ----------------------------------------------------------------- Excellent! Thanks!
Attachment #693586 -
Flags: review?(josh) → review+
Comment 9•12 years ago
|
||
Comment on attachment 693586 [details] [diff] [review] Patch v1 Although the commit message could be more informative :)
Assignee | ||
Comment 10•12 years ago
|
||
Updated commit message
Attachment #693586 -
Attachment is obsolete: true
Assignee | ||
Updated•12 years ago
|
Keywords: checkin-needed
Comment 11•12 years ago
|
||
Please run this through try first. This may break on mobile.
Keywords: checkin-needed
Assignee | ||
Comment 12•12 years ago
|
||
Pushed to try: https://tbpl.mozilla.org/?tree=Try&rev=099eb4f32626
Assignee | ||
Comment 13•12 years ago
|
||
After looking at the logs. The test finished without errors, but after that there is an alert or the window loses focus, any idea what can it be? INFO TEST-END | chrome://mochitests/content/browser/toolkit/components/downloads/test/browser/browser_download_history.js | finished in 10475ms TEST-INFO | checking window state TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/toolkit/components/downloads/test/browser/browser_download_history.js | Found an unexpected alert:alert at the end of test run INFO TEST-END | chrome://mochitests/content/browser/toolkit/components/downloads/test/browser/browser_download_history.js | finished in 1003ms TEST-INFO | checking window state TEST-INFO | chrome://mochitests/content/browser/toolkit/components/downloads/test/browser/browser_download_history.js | must wait for focus
Comment 14•12 years ago
|
||
Hmm, I'm not sure about the alert problem. However, it occurs to me that this test isn't actually testing what I was thinking it was - instead of setting up the save and download process manually, I think it would be a more useful test to initiate a download from a link on in a private window, wait until it's complete and ensure that there was no link visited notification and no record in the history.
Assignee | ||
Comment 15•12 years ago
|
||
Updated patch to initialize download from a link.
Attachment #693886 -
Attachment is obsolete: true
Attachment #696075 -
Flags: review?(josh)
Comment 16•12 years ago
|
||
Comment on attachment 696075 [details] [diff] [review] Patch v3 Review of attachment 696075 [details] [diff] [review]: ----------------------------------------------------------------- Nice. Sorry about the lag on my end.
Attachment #696075 -
Flags: review?(josh) → review+
Reporter | ||
Comment 17•12 years ago
|
||
So is this ready to land?
Comment 18•12 years ago
|
||
Let's put it through try first. https://tbpl.mozilla.org/?tree=Try&rev=e48396fdf052
Assignee | ||
Comment 19•12 years ago
|
||
The test finished without errors, but after the test finishes there is a timeout, any idea? INFO TEST-END | chrome://mochitests/content/browser/toolkit/components/downloads/test/browser/browser_download_history.js | finished in 2157ms TEST-INFO | checking window state TEST-INFO | chrome://mochitests/content/browser/toolkit/components/downloads/test/browser/browser_download_history.js | must wait for focus TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/toolkit/components/downloads/test/browser/browser_download_history.js | application timed out after 330 seconds with no output
Comment 20•12 years ago
|
||
Maybe something in
> 2.123 + if (aDownload.targetFile.exists()) {
> 2.124 + aDownload.targetFile.remove(false);
> 2.125 + }
is throwing?
Assignee | ||
Comment 21•12 years ago
|
||
I tried using a try/catch block, but still it fails. But I'm sure now that is failing only on Windows. See: https://tbpl.mozilla.org/?tree=Try&rev=1d5c5394e902 I'll keep researching.
Reporter | ||
Comment 22•12 years ago
|
||
Any updates on this?
Reporter | ||
Comment 23•11 years ago
|
||
Over in bug 817477, I'm preparing to remove support for global private browsing altogether. This is one of the last remaining pieces that I would like us to fix before that bug lands...
Blocks: 817477
Comment 24•11 years ago
|
||
> > 2.123 + if (aDownload.targetFile.exists()) { > > 2.124 + aDownload.targetFile.remove(false); > > 2.125 + } I have investigated this and this part of code doesn't throw any errors as Andres mentioned in comment 21. I suspect that when the targetFile.remove(false) is executed, another UI (alert) appears so the last browser window loses the focus on Win. I have tried to invoke window.focus() in registerCleanupFunction() but without luck. Any thoughts?
Comment 25•11 years ago
|
||
Comment on attachment 696075 [details] [diff] [review] Patch v3 >+ // Wait for acceptDialog to execute. >+ function accept() { >+ if (dialog.acceptDialog) { >+ dialog.acceptDialog(); >+ executeSoon(accept); >+ } >+ } >+ executeSoon(accept); This doesn't look right to me. Shouldn't the executeSoon be outside of the if block, to ensure we wait until the acceptDialog method is available? Otherwise we just attempt to run the code over and over.
Comment 26•11 years ago
|
||
(In reply to Josh Matthews [:jdm] from comment #25) > Comment on attachment 696075 [details] [diff] [review] > Patch v3 > > >+ // Wait for acceptDialog to execute. > >+ function accept() { > >+ if (dialog.acceptDialog) { > >+ dialog.acceptDialog(); > >+ executeSoon(accept); > >+ } > >+ } > >+ executeSoon(accept); > > This doesn't look right to me. Shouldn't the executeSoon be outside of the > if block, to ensure we wait until the acceptDialog method is available? > Otherwise we just attempt to run the code over and over. Let me rewrite that part. ;-)
Comment 27•11 years ago
|
||
I have updated the patch based on comment 25 However, still getting issues on windows. https://tbpl.mozilla.org/?rev=86bb39abbaa8&tree=Try Any suggestions how to fix that?
Attachment #696075 -
Attachment is obsolete: true
Attachment #711376 -
Flags: review?(josh)
Comment 28•11 years ago
|
||
Aha! It's the completed downloads alert - on OS X and Linux, there's a platform system that handles it. On Windows, we pop open http://mxr.mozilla.org/mozilla-central/source/toolkit/components/alerts/resources/content/alert.xul, which is of type alert:alert (http://mxr.mozilla.org/mozilla-central/source/toolkit/components/alerts/nsAlertsService.cpp#116, for reference). You should set browser.download.manager.showAlertOnComplete to false when running this test, and clear it when cleaning up.
Comment 29•11 years ago
|
||
Thanks for the tip. Pushed to try and hope it passes Try. https://tbpl.mozilla.org/?tree=Try&rev=3f0a313a3828
Attachment #711393 -
Flags: review?(josh)
Updated•11 years ago
|
Attachment #711376 -
Attachment is obsolete: true
Attachment #711376 -
Flags: review?(josh)
Updated•11 years ago
|
Attachment #711393 -
Flags: review?(josh) → review+
Comment 30•11 years ago
|
||
The last patch still fails on Windows. I have updated it again and it passes try. https://tbpl.mozilla.org/?tree=Try&rev=9ce3e88e795c
Attachment #711393 -
Attachment is obsolete: true
Attachment #711922 -
Flags: review?(josh)
Updated•11 years ago
|
Attachment #711922 -
Flags: review?(josh) → review+
Comment 31•11 years ago
|
||
Attachment #711922 -
Attachment is obsolete: true
Updated•11 years ago
|
Keywords: checkin-needed
Comment 32•11 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/ddedb68b1cc6
Keywords: checkin-needed
Comment 33•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/ddedb68b1cc6
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → Firefox 21
You need to log in
before you can comment on or make changes to this bug.
Description
•