Changeset 117123 in webkit


Ignore:
Timestamp:
May 15, 2012 12:51:45 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

Fixing the flaky 'script-src-redirect.html' test.
https://bugs.webkit.org/show_bug.cgi?id=86433

Patch by Mike West <mkwst@chromium.org> on 2012-05-15
Reviewed by Adam Barth.

  • http/tests/security/contentSecurityPolicy/resources/source-list-parsing-base.js:

(test):

  • http/tests/security/contentSecurityPolicy/script-src-redirect.html:
Location:
trunk/LayoutTests
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r117116 r117123  
     12012-05-15  Mike West  <mkwst@chromium.org>
     2
     3        Fixing the flaky 'script-src-redirect.html' test.
     4        https://bugs.webkit.org/show_bug.cgi?id=86433
     5
     6        Reviewed by Adam Barth.
     7
     8        * http/tests/security/contentSecurityPolicy/resources/source-list-parsing-base.js:
     9        (test):
     10        * http/tests/security/contentSecurityPolicy/script-src-redirect.html:
     11
    1122012-05-15  Dan Bernstein  <mitz@apple.com>
    213
  • trunk/LayoutTests/http/tests/security/contentSecurityPolicy/resources/source-list-parsing-base.js

    r117006 r117123  
    99        return finishTesting();
    1010
     11    var defaultScript = 'http://127.0.0.1:8000/security/contentSecurityPolicy/resources/script.js'
    1112    var current = tests.shift();
    1213    var iframe = document.createElement('iframe');
    13     iframe.src = "http://127.0.0.1:8000/security/contentSecurityPolicy/resources/echo-script-src.pl?should_run=" + current[0] +
    14                  "&q=http://127.0.0.1:8000/security/contentSecurityPolicy/resources/script.js&csp=" + escape(current[1]);
     14    iframe.src = "http://127.0.0.1:8000/security/contentSecurityPolicy/resources/echo-script-src.pl?" +
     15                 "should_run=" + escape(current[0]) +
     16                 "&csp=" + escape(current[1]) +
     17                 "&q=" + escape(current[2] ? current[2] : defaultScript);
    1518    iframe.onload = test;
    1619    document.body.appendChild(iframe);
  • trunk/LayoutTests/http/tests/security/contentSecurityPolicy/script-src-redirect.html

    r82085 r117123  
    22<html>
    33<head>
     4<script src="resources/source-list-parsing-base.js"></script>
    45<script>
    5 if (window.layoutTestController) {
    6   layoutTestController.dumpAsText();
    7   layoutTestController.dumpChildFramesAsText();
    8 }
     6var tests = [
     7  ['no', 'script-src localhost', 'http://127.0.0.1:8000/security/contentSecurityPolicy/resources/echo-script-src.pl?should_run=no&csp=%20script-src%20localhost&q=http://127.0.0.1:8000/security/contentSecurityPolicy/resources/redir.php%3furl=http://localhost:8000/security/contentSecurityPolicy/resources/script.js'],
     8  ['no', 'script-src 127.0.0.1', 'http://127.0.0.1:8000/security/contentSecurityPolicy/resources/echo-script-src.pl?should_run=no&csp=%20script-src%20localhost&q=http://127.0.0.1:8000/security/contentSecurityPolicy/resources/redir.php%3furl=http://localhost:8000/security/contentSecurityPolicy/resources/script.js']
     9];
    910</script>
    1011</head>
    11 <body>
     12<body onload='test()'>
    1213  <p>
    1314    Loads an iframe which in turns tries to load an external script. The request for the script is redirected to 'localhost'. The iframe has a content security policy disabling external scripts from hosts other than 'localhost'. So the script should be allowed to run.
    1415  </p>
    15   <iframe src="http://127.0.0.1:8000/security/contentSecurityPolicy/resources/echo-script-src.pl?should_run=no&csp=%20script-src%20localhost&q=http://127.0.0.1:8000/security/contentSecurityPolicy/resources/redir.php%3furl=http://localhost:8000/security/contentSecurityPolicy/resources/script.js"></iframe>
    16   <iframe src="http://127.0.0.1:8000/security/contentSecurityPolicy/resources/echo-script-src.pl?should_run=no&csp=%20script-src%20127.0.0.1&q=http://127.0.0.1:8000/security/contentSecurityPolicy/resources/redir.php%3furl=http://localhost:8000/security/contentSecurityPolicy/resources/script.js"></iframe>
    1716</body>
    1817</html>
Note: See TracChangeset for help on using the changeset viewer.