Bug 44749 - Try to make some xssAuditor tests less flakey.
Summary: Try to make some xssAuditor tests less flakey.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other OS X 10.5
: P2 Normal
Assignee: Andy Estes
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-26 23:31 PDT by Andy Estes
Modified: 2011-05-11 12:49 PDT (History)
3 users (show)

See Also:


Attachments
Patch (4.86 KB, patch)
2010-08-26 23:55 PDT, Andy Estes
no flags Details | Formatted Diff | Diff
Patch (6.94 KB, patch)
2010-08-27 00:19 PDT, Andy Estes
no flags Details | Formatted Diff | Diff
Patch (14.38 KB, patch)
2010-08-27 03:38 PDT, Andy Estes
simon.fraser: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andy Estes 2010-08-26 23:31:28 PDT
Try to make some xssAuditor tests less flakey.
Comment 1 Andy Estes 2010-08-26 23:53:38 PDT
The following xssAuditor tests became flakey after http://trac.webkit.org/changeset/66156:

* http/tests/security/xssAuditor/object-embed-tag-control-char.html
* http/tests/security/xssAuditor/object-embed-tag-null-char.html
* http/tests/security/xssAuditor/object-embed-tag.html

r66156 changed how WebKit handles an <object> elements with a nested <embed>, such that the <embed> is rendered as fallback content if the <object> fails to load. Since the XSS Auditor prevents both the <object> and the <embed> from loading, there should be two lines of output in the expected results instead of one. However, since widgets sometimes begin loading on a post-layout timer, the test can finish before the timer fires.

Calling notifyDone() on a timer is an easy way to solve this, although there might be a more elegant solution.
Comment 2 Andy Estes 2010-08-26 23:55:45 PDT
Created attachment 65681 [details]
Patch
Comment 3 Andy Estes 2010-08-27 00:19:02 PDT
Created attachment 65683 [details]
Patch
Comment 4 Andy Estes 2010-08-27 03:38:59 PDT
Created attachment 65696 [details]
Patch
Comment 5 Andy Estes 2010-08-27 03:40:24 PDT
Okay, so instead of using a timer, I'm using postMessage() to communicate to the top window each time a beforeload event fires in the iframe. When the top window has seen a beforeload event from each widget in the iframe, it calls notifyDone(). This is more complicated but more reliable and less hacky.
Comment 6 Nikolas Zimmermann 2010-08-27 05:16:25 PDT
Skipped two tests, which always fail in r66210.
Comment 7 Andy Estes 2010-08-27 13:58:08 PDT
Simon, do you have any feedback on why this was r-'ed? Do I just need to update the Skipped list before landing, or are there more substantial issues?
Comment 8 Simon Fraser (smfr) 2010-08-27 14:00:28 PDT
Comment on attachment 65696 [details]
Patch

Sorry, mouse fumble. I meant to r+
Comment 9 Andy Estes 2010-08-27 14:04:49 PDT
(In reply to comment #8)
> (From update of attachment 65696 [details])
> Sorry, mouse fumble. I meant to r+

Thanks :)
Comment 10 Andy Estes 2010-08-27 14:12:15 PDT
Committed http://trac.webkit.org/changeset/66254.
Comment 11 Ademar Reis 2011-05-11 12:49:58 PDT
Revision r66254 cherry-picked into qtwebkit-2.1.x with commit 9d6baba <http://gitorious.org/webkit/qtwebkit/commit/9d6baba>