Closed
Bug 541404
Opened 15 years ago
Closed 14 years ago
browser_privatebrowsing_openlocation.js hangs when I run it on Ubuntu
Categories
(Firefox :: Private Browsing, defect)
Tracking
()
RESOLVED
FIXED
Firefox 3.7a5
People
(Reporter: ted, Assigned: ehsan.akhgari)
References
Details
Attachments
(4 files, 2 obsolete files)
1.60 KB,
patch
|
Details | Diff | Splinter Review | |
24.43 KB,
text/plain
|
Details | |
74.35 KB,
text/plain
|
Details | |
2.85 KB,
patch
|
Gavin
:
review+
|
Details | Diff | Splinter Review |
I've actually been seeing this for a while, but I forgot to file it. When I run browser-chrome tests, browser_privatebrowsing_openlocation.js hangs with the "Open Web Location" dialog just sitting there. It passes one test, then hangs. The output looks like: Waiting for window activation... Running chrome://mochikit/content/browser/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_openlocation.js... TEST-PASS | chrome://mochikit/content/browser/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_openlocation.js | The input field should be correctly auto-filled TEST-UNEXPECTED-FAIL | chrome://mochikit/content/browser/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_openlocation.js | Timed out Looking at the Error Console while the test is hung, I see: Error: input is null Source File: chrome://mochikit/content/browser/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_openlocation.js Line: 69
Assignee | ||
Comment 1•15 years ago
|
||
Do you always get this behavior? Does it happen the first time that the dialog is opened? (A full test should open it 5 times.) The input variable comes from here: <http://mxr.mozilla.org/mozilla-central/source/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_openlocation.js#68>, given the fact that the code is being executed from the load handler, I would expect the DOM tree to be initialized by then... I don't have a lot of ideas, really...
Assignee | ||
Comment 2•15 years ago
|
||
Another thing to try: Load chrome://browser/content/openLocation.xul, and type the following into the location bar: javascript:alert(document.getElementById("dialog.input"));
Reporter | ||
Comment 3•15 years ago
|
||
Yes, this happens 100% of the time for me, AFAICT. I only see one dialog, and then the test times out. If I load that in a tab and then the javascript URL, I get an [object XULElement], as expected. I'm on 64-bit Ubuntu, if it makes any difference.
Assignee | ||
Comment 4•15 years ago
|
||
Can you apply this patch and send back the results, so that we can get some insight on what's going on inside the DOM tree?
Reporter | ||
Comment 5•14 years ago
|
||
Sorry, forgot about this, building with this patch now.
Reporter | ||
Comment 6•14 years ago
|
||
Here's the output with that patch.
Assignee | ||
Comment 7•14 years ago
|
||
OK, this is fun! The first domwindowopened notification is observed for the error console, and the second one for a view source window! Do you actually see these windows opened? What happens if you run only this test? What happens if you only run private browsing tests?
Reporter | ||
Comment 8•14 years ago
|
||
Oh, I opened those manually. (Oops) I think if I don't open those, I don't actually get any output(?!) I was running this test standalone. Running just the private browsing tests gives the same result.
Assignee | ||
Comment 9•14 years ago
|
||
(In reply to comment #8) > Oh, I opened those manually. (Oops) I think if I don't open those, I don't > actually get any output(?!) I was running this test standalone. Running just > the private browsing tests gives the same result. Have you actually tried not opening any windows manually? Doesn't it generate any output? Something is very very wrong here. :-/
Reporter | ||
Comment 10•14 years ago
|
||
No, if I don't open the error console, I get no output. I guess that means the test isn't getting a domwindowopened notification? The "Open Web Location" dialog definitely shows up.
Assignee | ||
Comment 11•14 years ago
|
||
This is really difficult to debug remotely. Can you please experiment with adding some timeouts in different places to see if this is a timing issue. Oh, and another thing to try is running this test in 1.9.2 and 1.9.1 as well?
Updated•14 years ago
|
Blocks: fedora-oranges
Assignee | ||
Comment 13•14 years ago
|
||
We have a log from one of the Fedora unit test boxes. http://tinderbox.mozilla.org/showlog.cgi?log=Firefox/1270892665.1270893238.22014.gz
Blocks: 438871
Assignee | ||
Updated•14 years ago
|
Whiteboard: [orange]
I can reproduce the bug. This fixes the timeouts, but some of the time (2 out of 3 tries so far) I see other failures in the test instead of the timeouts -- and extra "Open Location" dialogs hanging around after the test has run.
Assignee | ||
Comment 15•14 years ago
|
||
(In reply to comment #14) > Created an attachment (id=438294) [details] > work in progress? > > I can reproduce the bug. This fixes the timeouts, but some of the time (2 out > of 3 tries so far) I see other failures in the test instead of the timeouts -- > and extra "Open Location" dialogs hanging around after the test has run. Hmm, this seems to be the correct thing to do here. What are the other failures? Do you have a log?
Assignee | ||
Comment 17•14 years ago
|
||
I _think_ this should solve the problem. dbaron, would you mind testing this please?
Assignee | ||
Comment 18•14 years ago
|
||
Comment on attachment 438403 [details] [diff] [review] Patch I finally managed to reproduce the problem in a Fedora 12 VM, and verified that this patch fixes the problem. Requesting Gavin for review.
Attachment #438403 -
Flags: review?(gavin.sharp)
Assignee | ||
Updated•14 years ago
|
Assignee: nobody → ehsan
Status: NEW → ASSIGNED
Comment 19•14 years ago
|
||
Comment on attachment 438403 [details] [diff] [review] Patch >diff --git a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_openlocation.js b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_openlocation.js > browser.addEventListener("load", function() { >+ SimpleTest.waitForFocus(callback); This waits for focus on the global |window|, right? What ensures that that happens?
Assignee | ||
Comment 20•14 years ago
|
||
(In reply to comment #19) > (From update of attachment 438403 [details] [diff] [review]) > >diff --git a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_openlocation.js b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_openlocation.js > > > browser.addEventListener("load", function() { > > >+ SimpleTest.waitForFocus(callback); > > This waits for focus on the global |window|, right? Yes. > What ensures that that happens? When the open location dialog is closed, the previous window should be focused. If that doesn't happen, (like in case where another window on the system was put to foreground right before the open location dialog was opened), I guess we want the test to time out, because we generally want to keep the test window focued, right?
Comment 21•14 years ago
|
||
(In reply to comment #20) > When the open location dialog is closed, the previous window should be focused. Can't that happen before the page load completes? This waitForFocus() call is inside the browser's load handler...
Assignee | ||
Comment 22•14 years ago
|
||
(In reply to comment #21) > (In reply to comment #20) > > When the open location dialog is closed, the previous window should be focused. > > Can't that happen before the page load completes? This waitForFocus() call is > inside the browser's load handler... Doesn't the load handler get invoked when the browser receives the load event from the page? If yes, then by that time the page load must have been completed.
Comment 23•14 years ago
|
||
My point was that we're potentially calling waitForFocus() after the window is already focused. What I'd forgotten is that it handles that case by just calling the callback immediately... the method name is kind of confusing since it doesn't necessarily "wait" for a focus event. Why do we care about focus in that case, though? I seems like it turns out to just be a roundabout way of calling executeSoon() like we did before, and so it seems better to just leave that part as-is for clarity. Same comment applies to the dialog case, I guess - I imagine it required the executeSoon() since the stuff it's testing depends on the dialog's onload(), which would potentially run after the test's handler?
Assignee | ||
Comment 24•14 years ago
|
||
(In reply to comment #23) > My point was that we're potentially calling waitForFocus() after the window is > already focused. What I'd forgotten is that it handles that case by just > calling the callback immediately... the method name is kind of confusing since > it doesn't necessarily "wait" for a focus event. Right. > Why do we care about focus in that case, though? I seems like it turns out to > just be a roundabout way of calling executeSoon() like we did before, and so it > seems better to just leave that part as-is for clarity. Yes, but executeSoon doesn't guarantee the window being focused. This actually doesn't seem to have much to do with this particular bug, but it will probably prevent future random oranges. > Same comment applies to the dialog case, I guess - I imagine it required the > executeSoon() since the stuff it's testing depends on the dialog's onload(), > which would potentially run after the test's handler? Yes, that's right.
Comment 25•14 years ago
|
||
Why does the window being focused matter, though? That doesn't seem relevant to any of the tests in the callbacks.
Assignee | ||
Comment 26•14 years ago
|
||
(In reply to comment #25) > Why does the window being focused matter, though? That doesn't seem relevant to > any of the tests in the callbacks. Because we're simulating key presses. http://enndeakin.wordpress.com/2009/09/08/how-to-fix-focus-related-problems-in-tests/
Comment 27•14 years ago
|
||
Oh, I see. That only applies to the dialog load callback though, right? I still don't see a reason to change the |executeSoon(callback);|.
Assignee | ||
Comment 28•14 years ago
|
||
(In reply to comment #27) > Oh, I see. That only applies to the dialog load callback though, right? I still > don't see a reason to change the |executeSoon(callback);|. After a closer look, I don't think what I said in comment 24 is true, so I took that waitForFocus call out. Indeed, the test passes without it.
Attachment #438403 -
Attachment is obsolete: true
Attachment #439138 -
Flags: review?(gavin.sharp)
Attachment #438403 -
Flags: review?(gavin.sharp)
Updated•14 years ago
|
Attachment #439138 -
Flags: review?(gavin.sharp) → review+
Updated•14 years ago
|
Attachment #438294 -
Attachment is obsolete: true
Assignee | ||
Comment 29•14 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/f0098a349b7a
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 3.7a5
Updated•14 years ago
|
status1.9.1:
--- → ?
status1.9.2:
--- → ?
Assignee | ||
Comment 30•14 years ago
|
||
This can't land on branches as waitForFocus is not available there.
status1.9.1:
? → ---
status1.9.2:
? → ---
You need to log in
before you can comment on or make changes to this bug.
Description
•