Changeset 117123 in webkit
- Timestamp:
- May 15, 2012 12:51:45 PM (12 years ago)
- Location:
- trunk/LayoutTests
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r117116 r117123 1 2012-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 1 12 2012-05-15 Dan Bernstein <mitz@apple.com> 2 13 -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/resources/source-list-parsing-base.js
r117006 r117123 9 9 return finishTesting(); 10 10 11 var defaultScript = 'http://127.0.0.1:8000/security/contentSecurityPolicy/resources/script.js' 11 12 var current = tests.shift(); 12 13 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); 15 18 iframe.onload = test; 16 19 document.body.appendChild(iframe); -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/script-src-redirect.html
r82085 r117123 2 2 <html> 3 3 <head> 4 <script src="resources/source-list-parsing-base.js"></script> 4 5 <script> 5 if (window.layoutTestController) { 6 layoutTestController.dumpAsText();7 layoutTestController.dumpChildFramesAsText();8 } 6 var 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 ]; 9 10 </script> 10 11 </head> 11 <body >12 <body onload='test()'> 12 13 <p> 13 14 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. 14 15 </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>17 16 </body> 18 17 </html>
Note: See TracChangeset
for help on using the changeset viewer.