Changeset 66254 in webkit


Ignore:
Timestamp:
Aug 27, 2010 2:11:22 PM (14 years ago)
Author:
aestes@apple.com
Message:

Try to make some xssAuditor tests less flakey.
https://bugs.webkit.org/show_bug.cgi?id=44749

Reviewed by Simon Fraser.

Use 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 prevents the test from exiting before all the widgets have had a
chance to load, therefore ensuring that all relevant XSS Auditor
messages have been emitted.

  • http/tests/security/xssAuditor/object-embed-tag-control-char-expected.txt:
  • http/tests/security/xssAuditor/object-embed-tag-control-char.html:
  • http/tests/security/xssAuditor/object-embed-tag-expected.txt:
  • http/tests/security/xssAuditor/object-embed-tag-null-char-expected.txt:
  • http/tests/security/xssAuditor/object-embed-tag-null-char.html:
  • http/tests/security/xssAuditor/object-embed-tag.html:
  • http/tests/security/xssAuditor/object-src-inject.html:
  • http/tests/security/xssAuditor/object-tag-javascript-url.html:
  • http/tests/security/xssAuditor/object-tag.html:
  • http/tests/security/xssAuditor/resources/echo-intertag.pl:
  • http/tests/security/xssAuditor/resources/echo-object-src.pl:
  • http/tests/security/xssAuditor/resources/utilities.js:

(notifyDoneAfterReceivingBeforeloadFromIds):

  • platform/mac/Skipped:
Location:
trunk/LayoutTests
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r66251 r66254  
     12010-08-27  Andy Estes  <aestes@apple.com>
     2
     3        Reviewed by Simon Fraser.
     4
     5        Try to make some xssAuditor tests less flakey.
     6        https://bugs.webkit.org/show_bug.cgi?id=44749
     7       
     8        Use postMessage() to communicate to the top window each time a
     9        beforeload event fires in the iframe. When the top window has seen a
     10        beforeload event from each widget in the iframe, it calls notifyDone().
     11        This prevents the test from exiting before all the widgets have had a
     12        chance to load, therefore ensuring that all relevant XSS Auditor
     13        messages have been emitted.
     14
     15        * http/tests/security/xssAuditor/object-embed-tag-control-char-expected.txt:
     16        * http/tests/security/xssAuditor/object-embed-tag-control-char.html:
     17        * http/tests/security/xssAuditor/object-embed-tag-expected.txt:
     18        * http/tests/security/xssAuditor/object-embed-tag-null-char-expected.txt:
     19        * http/tests/security/xssAuditor/object-embed-tag-null-char.html:
     20        * http/tests/security/xssAuditor/object-embed-tag.html:
     21        * http/tests/security/xssAuditor/object-src-inject.html:
     22        * http/tests/security/xssAuditor/object-tag-javascript-url.html:
     23        * http/tests/security/xssAuditor/object-tag.html:
     24        * http/tests/security/xssAuditor/resources/echo-intertag.pl:
     25        * http/tests/security/xssAuditor/resources/echo-object-src.pl:
     26        * http/tests/security/xssAuditor/resources/utilities.js:
     27        (notifyDoneAfterReceivingBeforeloadFromIds):
     28        * platform/mac/Skipped:
     29
    1302010-08-09  Jer Noble  <jer.noble@apple.com>
    231
  • trunk/LayoutTests/http/tests/security/xssAuditor/object-embed-tag-control-char-expected.txt

    r51445 r66254  
     1CONSOLE MESSAGE: line 1: Refused to load an object. URL found within request: "http://127.0.0.1:8000/security/xssAuditor/resources/dummy.swf".
     2
    13CONSOLE MESSAGE: line 1: Refused to load an object. URL found within request: "http://127.0.0.1:8000/security/xssAuditor/resources/dummy.swf".
    24
  • trunk/LayoutTests/http/tests/security/xssAuditor/object-embed-tag-control-char.html

    r45639 r66254  
    22<html>
    33<head>
     4<script src='resources/utilities.js'></script>
    45<script>
    56if (window.layoutTestController) {
    67  layoutTestController.dumpAsText();
    78  layoutTestController.setXSSAuditorEnabled(true);
     9  layoutTestController.waitUntilDone();
     10  notifyDoneAfterReceivingBeforeloadFromIds(["object", "embed"]);
    811}
    912</script>
    1013</head>
    1114<body>
    12 <iframe src="http://localhost:8000/security/xssAuditor/resources/echo-intertag.pl?q=<object name='plugin' type='application/x-webkit-test-netscape'><param name='movie' value='http://127.0.0.1:8000/security/xssAuditor/resources/dummy.swf%05' /><embed name='plugin' type='application/x-webkit-test-netscape' src='http://127.0.0.1:8000/security/xssAuditor/resources/dummy.swf%05' /></object>">
     15<iframe src="http://localhost:8000/security/xssAuditor/resources/echo-intertag.pl?relay-target-ids-for-event=beforeload&q=<object id='object' name='plugin' type='application/x-webkit-test-netscape'><param name='movie' value='http://127.0.0.1:8000/security/xssAuditor/resources/dummy.swf%05' /><embed id='embed' name='plugin' type='application/x-webkit-test-netscape' src='http://127.0.0.1:8000/security/xssAuditor/resources/dummy.swf%05' /></object>">
    1316</iframe>
    1417</body>
  • trunk/LayoutTests/http/tests/security/xssAuditor/object-embed-tag-expected.txt

    r51445 r66254  
     1CONSOLE MESSAGE: line 1: Refused to load an object. URL found within request: "http://127.0.0.1:8000/security/xssAuditor/resources/dummy.swf".
     2
    13CONSOLE MESSAGE: line 1: Refused to load an object. URL found within request: "http://127.0.0.1:8000/security/xssAuditor/resources/dummy.swf".
    24
  • trunk/LayoutTests/http/tests/security/xssAuditor/object-embed-tag-null-char-expected.txt

    r61234 r66254  
     1CONSOLE MESSAGE: line 1: Refused to load an object. URL found within request: "http://127.0.0.1:8000/sec�urity/xssAuditor/resources/dummy.swf".
     2
    13CONSOLE MESSAGE: line 1: Refused to load an object. URL found within request: "http://127.0.0.1:8000/sec�urity/xssAuditor/resources/dummy.swf".
    24
  • trunk/LayoutTests/http/tests/security/xssAuditor/object-embed-tag-null-char.html

    r45639 r66254  
    22<html>
    33<head>
     4<script src="resources/utilities.js"></script>
    45<script>
    56if (window.layoutTestController) {
    67  layoutTestController.dumpAsText();
    78  layoutTestController.setXSSAuditorEnabled(true);
     9  layoutTestController.waitUntilDone();
     10  notifyDoneAfterReceivingBeforeloadFromIds(["object", "embed"]);
    811}
    912</script>
    1013</head>
    1114<body>
    12 <iframe src="http://localhost:8000/security/xssAuditor/resources/echo-intertag.pl?q=<object name='plugin' type='application/x-webkit-test-netscape'><param name='movie' value='http://127.0.0.1:8000/sec%00urity/xssAuditor/resources/dummy.swf' /><embed name='plugin' type='application/x-webkit-test-netscape' src='http://127.0.0.1:8000/sec%00urity/xssAuditor/resources/dummy.swf' /></object>">
     15<iframe src="http://localhost:8000/security/xssAuditor/resources/echo-intertag.pl?relay-target-ids-for-event=beforeload&q=<object id='object' name='plugin' type='application/x-webkit-test-netscape'><param name='movie' value='http://127.0.0.1:8000/sec%00urity/xssAuditor/resources/dummy.swf' /><embed id='embed' name='plugin' type='application/x-webkit-test-netscape' src='http://127.0.0.1:8000/sec%00urity/xssAuditor/resources/dummy.swf' /></object>">
    1316</iframe>
    1417</body>
  • trunk/LayoutTests/http/tests/security/xssAuditor/object-embed-tag.html

    r45639 r66254  
    22<html>
    33<head>
     4<script src="resources/utilities.js"></script>
    45<script>
    56if (window.layoutTestController) {
    67  layoutTestController.dumpAsText();
    78  layoutTestController.setXSSAuditorEnabled(true);
     9  layoutTestController.waitUntilDone();
     10  notifyDoneAfterReceivingBeforeloadFromIds(["object", "embed"]);
    811}
    912</script>
    1013</head>
    1114<body>
    12 <iframe src="http://localhost:8000/security/xssAuditor/resources/echo-intertag.pl?q=<object name='plugin' type='application/x-webkit-test-netscape'><param name='movie' value='http://127.0.0.1:8000/security/xssAuditor/resources/dummy.swf' /><embed name='plugin' type='application/x-webkit-test-netscape' src='http://127.0.0.1:8000/security/xssAuditor/resources/dummy.swf' /></object>">
     15<iframe src="http://localhost:8000/security/xssAuditor/resources/echo-intertag.pl?relay-target-ids-for-event=beforeload&q=<object id='object' name='plugin' type='application/x-webkit-test-netscape'><param name='movie' value='http://127.0.0.1:8000/security/xssAuditor/resources/dummy.swf' /><embed id='embed' name='plugin' type='application/x-webkit-test-netscape' src='http://127.0.0.1:8000/security/xssAuditor/resources/dummy.swf' /></object>">
    1316</iframe>
    1417</body>
  • trunk/LayoutTests/http/tests/security/xssAuditor/object-src-inject.html

    r50631 r66254  
    22<html>
    33<head>
     4<script src="resources/utilities.js"></script>
    45<script>
    56if (window.layoutTestController) {
    67  layoutTestController.dumpAsText();
    78  layoutTestController.setXSSAuditorEnabled(true);
     9  layoutTestController.waitUntilDone();
     10  notifyDoneAfterReceivingBeforeloadFromIds(["object"]);
    811}
    912</script>
    1013</head>
    1114<body>
    12 <iframe src="http://localhost:8000/security/xssAuditor/resources/echo-object-src.pl?q=http://127.0.0.1:8000/security/xssAuditor/resources/dummy.swf">
     15<iframe src="http://localhost:8000/security/xssAuditor/resources/echo-object-src.pl?relay-target-ids-for-event=beforeload&q=http://127.0.0.1:8000/security/xssAuditor/resources/dummy.swf">
    1316</iframe>
    1417</body>
  • trunk/LayoutTests/http/tests/security/xssAuditor/object-tag-javascript-url.html

    r48911 r66254  
    22<html>
    33<head>
     4<script src="resources/utilities.js"></script>
    45<script>
    56if (window.layoutTestController) {
    67  layoutTestController.dumpAsText();
    78  layoutTestController.setXSSAuditorEnabled(true);
     9  layoutTestController.waitUntilDone();
     10  notifyDoneAfterReceivingBeforeloadFromIds(["object"]);
    811}
    912</script>
    1013</head>
    1114<body>
    12 <iframe src="http://localhost:8000/security/xssAuditor/resources/echo-intertag.pl?q=<object data='javascript:alert(document.domain)'></object>">
     15<iframe src="http://localhost:8000/security/xssAuditor/resources/echo-intertag.pl?relay-target-ids-for-event=beforeload&q=<object id='object' data='javascript:alert(document.domain)'></object>">
    1316</iframe>
    1417</body>
  • trunk/LayoutTests/http/tests/security/xssAuditor/object-tag.html

    r45639 r66254  
    22<html>
    33<head>
     4<script src="resources/utilities.js"></script>
    45<script>
    56if (window.layoutTestController) {
    67  layoutTestController.dumpAsText();
    78  layoutTestController.setXSSAuditorEnabled(true);
     9  layoutTestController.waitUntilDone();
     10  notifyDoneAfterReceivingBeforeloadFromIds(["object"]);
    811}
    912</script>
    1013</head>
    1114<body>
    12 <iframe src="http://localhost:8000/security/xssAuditor/resources/echo-intertag.pl?q=<object name='plugin' type='application/x-webkit-test-netscape'><param name='movie' value='http://127.0.0.1:8000/security/xssAuditor/resources/dummy.swf' /></object>">
     15<iframe src="http://localhost:8000/security/xssAuditor/resources/echo-intertag.pl?relay-target-ids-for-event=beforeload&q=<object id='object' name='plugin' type='application/x-webkit-test-netscape'><param name='movie' value='http://127.0.0.1:8000/security/xssAuditor/resources/dummy.swf' /></object>">
    1316</iframe>
    1417</body>
  • trunk/LayoutTests/http/tests/security/xssAuditor/resources/echo-intertag.pl

    r56295 r66254  
    2121print "<!DOCTYPE html>\n";
    2222print "<html>\n";
     23if ($cgi->param('relay-target-ids-for-event')) {
     24    print "<script>\n";
     25    print "document.addEventListener('" . $cgi->param('relay-target-ids-for-event') . "', function(event) {\n";
     26    print "    window.parent.postMessage(event.target.id, '*');\n";
     27    print "}, true);\n";
     28    print "</script>\n";
     29}
    2330print "<body>\n";
    2431print $cgi->param('q');
  • trunk/LayoutTests/http/tests/security/xssAuditor/resources/echo-object-src.pl

    r50631 r66254  
    99print "<!DOCTYPE html>\n";
    1010print "<html>\n";
    11 print "<object name=\"plugin\" type=\"application/x-webkit-test-netscape\">\n";
     11if ($cgi->param('relay-target-ids-for-event')) {
     12    print "<script>\n";
     13    print "document.addEventListener('" . $cgi->param('relay-target-ids-for-event') . "', function(event) {\n";
     14    print "    window.parent.postMessage(event.target.id, '*');\n";
     15    print "}, true);\n";
     16    print "</script>\n";
     17}
     18print "<body>\n";
     19print "<object id=\"object\" name=\"plugin\" type=\"application/x-webkit-test-netscape\">\n";
    1220print "<param name=\"movie\" value=\"".$cgi->param('q')."\" />\n";
    1321print "</object>\n";
  • trunk/LayoutTests/http/tests/security/xssAuditor/resources/utilities.js

    r54202 r66254  
    3636    frameContent.getElementById('form').submit();
    3737}
     38
     39
     40function notifyDoneAfterReceivingBeforeloadFromIds(ids)
     41{
     42    var loadAttempted = 0;
     43    window.addEventListener("message", function(event) {
     44        var index = ids.indexOf(event.data);
     45        if (index == -1)
     46            return;
     47
     48        loadAttempted = loadAttempted | (1 << index);
     49        if (loadAttempted == (1 << ids.length) - 1)
     50            layoutTestController.notifyDone();
     51    }, false);
     52}
     53
  • trunk/LayoutTests/platform/mac/Skipped

    r66210 r66254  
    302302fast/events/tabindex-focus-blur-all.html
    303303
    304 # https://bugs.webkit.org/show_bug.cgi?id=44749
    305 # Skipping flakey xssAuditor tests, until the bug is resolved.
    306 http/tests/security/xssAuditor/object-embed-tag-null-char.html
    307 http/tests/security/xssAuditor/object-src-inject.html
Note: See TracChangeset for help on using the changeset viewer.