RESOLVED FIXED 30269
Waiting for iframe load should use onload, not setTimeout
https://bugs.webkit.org/show_bug.cgi?id=30269
Summary Waiting for iframe load should use onload, not setTimeout
Julie Parent
Reported 2009-10-09 18:42:25 PDT
Using setTimeout for iframe load leads to flaky tests, leads to unhappiness!
Attachments
Re-writes some editing tests to use iframe load events rather than setTimeout (7.73 KB, patch)
2009-10-12 14:11 PDT, Julie Parent
darin: review+
Updated to address Ojan's concern of iframe load happening before script is loaded. (10.10 KB, patch)
2009-10-13 16:10 PDT, Julie Parent
adele: review+
commit-queue: commit-queue-
Added rebaselines for editing/selection/5136696. Moving the script tag removed an empty text node from the render tree. (12.79 KB, patch)
2009-10-13 18:00 PDT, Julie Parent
darin: review+
Julie Parent
Comment 1 2009-10-12 14:11:22 PDT
Created attachment 41058 [details] Re-writes some editing tests to use iframe load events rather than setTimeout
Darin Adler
Comment 2 2009-10-12 14:23:52 PDT
Comment on attachment 41058 [details] Re-writes some editing tests to use iframe load events rather than setTimeout Assuming these tests all still pass, r=me
Ojan Vafai
Comment 3 2009-10-12 15:02:14 PDT
> =================================================================== > --- LayoutTests/editing/execCommand/paste-1.html (revision 49408) > +++ LayoutTests/editing/execCommand/paste-1.html (working copy) > @@ -3,7 +3,7 @@ if (window.layoutTestController) > layoutTestController.dumpEditingCallbacks(); > </script> > <p>This tests cut/paste inside an editable iframe. You should see 'foo bar baz' below.</p> > -<iframe src="../resources/contenteditable-iframe-src.html"></iframe> > +<iframe src="../resources/contenteditable-iframe-src.html" onload="foo();"></iframe> > > <script> > function foo() { > @@ -21,5 +21,4 @@ function foo() { > } > if (window.layoutTestController) > window.layoutTestController.waitUntilDone(); > -window.setTimeout(foo, 100); There's still theoretically a race condition here (and in the other tests), right? If the iframe loads before foo is defined or waitUntilDone is called? It's easy enough to fix by moving the iframe after the script tag right?
Julie Parent
Comment 4 2009-10-13 16:10:20 PDT
Created attachment 41135 [details] Updated to address Ojan's concern of iframe load happening before script is loaded.
Ojan Vafai
Comment 5 2009-10-13 16:41:07 PDT
Yup. That's what I was asking for. I don't think it was a very likely race condition, but while you're fixing this up, may as well fix it.
WebKit Commit Bot
Comment 6 2009-10-13 17:05:40 PDT
Comment on attachment 41135 [details] Updated to address Ojan's concern of iframe load happening before script is loaded. Rejecting patch 41135 from commit-queue. Failed to run "['WebKitTools/Scripts/run-webkit-tests', '--no-launch-safari', '--quiet', '--exit-after-n-failures=1']" exit_code: 1 Running build-dumprendertree Running tests from /Users/eseidel/Projects/CommitQueue/LayoutTests Testing 11430 test cases. editing/selection/5136696.html -> failed Exiting early after 1 failures. 4127 tests run. 66.95s total testing time 4126 test cases (99%) succeeded 1 test case (<1%) had incorrect layout 1 test case (<1%) had stderr output
Julie Parent
Comment 7 2009-10-13 18:00:50 PDT
Created attachment 41143 [details] Added rebaselines for editing/selection/5136696. Moving the script tag removed an empty text node from the render tree. Failed commit queue because of a whitespace change (removed a script tag with newline, now there is no empty text node in the render tree). Rebaselined the test to remove the empty text node.
Julie Parent
Comment 8 2009-10-14 15:42:39 PDT
Note You need to log in before you can comment on or make changes to this bug.