Last Comment Bug 680275 - test_delay_load.html incorrectly appends a video to a new window before it has begun loading
: test_delay_load.html incorrectly appends a video to a new window before it ha...
Status: RESOLVED FIXED
[inbound]
:
Product: Core
Classification: Components
Component: Audio/Video (show other bugs)
: unspecified
: x86 Mac OS X
: -- normal (vote)
: mozilla11
Assigned To: Nobody; OK to take it and work on it
:
Mentors:
Depends on:
Blocks: 668283
  Show dependency treegraph
 
Reported: 2011-08-18 15:33 PDT by Josh Matthews [:jdm]
Modified: 2012-02-01 13:59 PST (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Ensure that the video load begins before adding the video to a new document. (15.22 KB, patch)
2011-08-18 15:35 PDT, Josh Matthews [:jdm]
no flags Details | Diff | Splinter Review
Ensure that the video load begins before adding the video to a new document. (1.74 KB, patch)
2011-08-18 15:38 PDT, Josh Matthews [:jdm]
roc: review+
Details | Diff | Splinter Review
fix test (2.19 KB, patch)
2011-11-21 18:20 PST, Robert O'Callahan (:roc) (Exited; email my personal email if necessary)
cajbir.bugzilla: review+
Details | Diff | Splinter Review

Description Josh Matthews [:jdm] 2011-08-18 15:33:07 PDT
This only passes in Firefox because we happen to return to the event loop and run the event that starts the load while opening the new window. In Fennec, this doesn't occur, and we don't start the load until after the video has been appended to the new window. This causes the load to fail, because it's a relative URL from about:blank.
Comment 1 Josh Matthews [:jdm] 2011-08-18 15:35:50 PDT
Created attachment 554230 [details] [diff] [review]
Ensure that the video load begins before adding the video to a new document.
Comment 2 Josh Matthews [:jdm] 2011-08-18 15:38:33 PDT
Created attachment 554231 [details] [diff] [review]
Ensure that the video load begins before adding the video to a new document.
Comment 4 Marco Bonardo [::mak] 2011-08-19 03:22:17 PDT
http://hg.mozilla.org/mozilla-central/rev/cd982d1f49d6
Comment 5 cajbir (:cajbir) 2011-08-24 22:37:03 PDT
The landing of this seems to have caused an issue when I run the content/media mochitests. The test_delay_load.html test now leaves a popup window open at the end of the tests. Reverting the patch in this bug fixes it for me.
Comment 6 Robert O'Callahan (:roc) (Exited; email my personal email if necessary) 2011-11-21 14:11:57 PST
The problem seems to be that onloadstart is never called for the element that gets put in the other window. At least the event handler never fires.
Comment 7 Robert O'Callahan (:roc) (Exited; email my personal email if necessary) 2011-11-21 18:15:24 PST
OK, so what happens is that v.onloadstart does window.open, which seems to spin the event loop so that the load event fires in there. Which means loaded() actually runs before we add the window to 'testWindows', so the window isn't closed.

For the test to work we really need to avoid our events firing during window.open. I'll try doing the window.open early, outside the event handler.
Comment 8 Robert O'Callahan (:roc) (Exited; email my personal email if necessary) 2011-11-21 18:20:06 PST
Created attachment 576056 [details] [diff] [review]
fix test
Comment 9 Robert O'Callahan (:roc) (Exited; email my personal email if necessary) 2011-11-23 15:06:49 PST
https://hg.mozilla.org/integration/mozilla-inbound/rev/10f58db28c81
Comment 10 Ed Morley [:emorley] 2011-11-24 08:17:29 PST
https://hg.mozilla.org/mozilla-central/rev/10f58db28c81

Note You need to log in before you can comment on or make changes to this bug.