This test has had only mixed success on the Chromium builders. http://src.chromium.org/viewvc/chrome/trunk/src/webkit/tools/layout_tests/flakiness_dashboard.html#tests=LayoutTests%2Fediting%2Fselection%2Feditable-html-element.html The symptom when it fails is that runTest() is not defined. I haven't been able to reproduce the failure locally, but the JS experts suggest that perhaps these floating <script> tags are creating the body element too early.
Created attachment 41521 [details] guess at a fix for the test
The test in question, for those following at home http://trac.webkit.org/browser/trunk/LayoutTests/editing/selection/editable-html-element.html
I think it's almost impossible for this patch to affect the outcome of the test. <script> inside <html> will create an implicit <head>, and <body> will implicitly close the <head>.
Comment on attachment 41521 [details] guess at a fix for the test maciej looked at this on IRC and suggested some other ideas. removing review bits.
Chrome-side bug: http://code.google.com/p/chromium/issues/detail?id=25355
Created attachment 41571 [details] results when the test fails
I got those results by going to: http://src.chromium.org/viewvc/chrome/trunk/src/webkit/tools/layout_tests/flakiness_dashboard.html#tests=LayoutTests%2Fediting%2Fselection%2Feditable-html-element.html and clicking on one of the red bars and downloading the layout-test-results.zip
It looks like the only difference in results is the extra "runTest() is not defined". See the mac results: http://trac.webkit.org/browser/trunk/LayoutTests/platform/mac/editing/selection/editable-html-element-expected.txt?format=txt I wonder if this could be some sort of v8 bug where it's logging an non-sensical error.
Could the runTest() not defined log be coming from a previous test?
Wow, I fail. Eric is implicitly noting that runTest is clearly still running because the rest of the test output is still ok. There's just the extra line.
I'm not sure if the output is "still OK", but it does look identical. I did a quick visual-inspection diff, I did not run "diff" against the two output files to confirm that they're exactly the same besides that line.
Another data point: LayoutTests/editing/selection/drag-to-contenteditable-iframe.html is doing the same thing. It fails with the extra runTest is not defined message, but clearly it is running properly since the rest of the output is ok.
I had diffed the fail/pass tests before, and that (In reply to comment #11) > I'm not sure if the output is "still OK", but it does look identical. I did a > quick visual-inspection diff, I did not run "diff" against the two output files > to confirm that they're exactly the same besides that line. Yes, it's identical (I had run diff before when trying to figure out what was going wrong) other than the extra line.
There seems to be two bugs here. 1. Errors that occur after a notifyDone call get output to the next test run in TestShell. Will fix this in TestShell. 2. There's a race between document teardown and an images onload handler. Namely, the image's onload handler is called after the runTest function has be destroyed. It's not clear to me whether this is a V8 or a WebCore bug. Here's what's going on: LayoutTests/editing/selection/drag-to-contenteditable-iframe.html drags an image with onload="runTest()" into a contentEditable region, creating a new image element with it's own onload handler. There's a race between the document teardown and the load event of the dragged in image. The reason LayoutTests/editing/selection/editable-html-element.html is involved is that it happens to run after drag-to-contenteditable-iframe.html. Since the racy onload handler fires after we've called notifyDone, the logged error gets inserted into editable-html-element.html's results.
OK. Nevermind. There's just the TestShell bug. runTest is undefined because it's run in the context of the iframe.