Title: [117123] trunk/LayoutTests
Revision
117123
Author
[email protected]
Date
2012-05-15 12:51:45 -0700 (Tue, 15 May 2012)

Log Message

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

Patch by Mike West <[email protected]> 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:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (117122 => 117123)


--- trunk/LayoutTests/ChangeLog	2012-05-15 19:50:03 UTC (rev 117122)
+++ trunk/LayoutTests/ChangeLog	2012-05-15 19:51:45 UTC (rev 117123)
@@ -1,3 +1,14 @@
+2012-05-15  Mike West  <[email protected]>
+
+        Fixing the flaky 'script-src-redirect.html' test.
+        https://bugs.webkit.org/show_bug.cgi?id=86433
+
+        Reviewed by Adam Barth.
+
+        * http/tests/security/contentSecurityPolicy/resources/source-list-parsing-base.js:
+        (test):
+        * http/tests/security/contentSecurityPolicy/script-src-redirect.html:
+
 2012-05-15  Dan Bernstein  <[email protected]>
 
         Ruby annotation is incorrectly identified as a paragraph boundary

Modified: trunk/LayoutTests/http/tests/security/contentSecurityPolicy/resources/source-list-parsing-base.js (117122 => 117123)


--- trunk/LayoutTests/http/tests/security/contentSecurityPolicy/resources/source-list-parsing-base.js	2012-05-15 19:50:03 UTC (rev 117122)
+++ trunk/LayoutTests/http/tests/security/contentSecurityPolicy/resources/source-list-parsing-base.js	2012-05-15 19:51:45 UTC (rev 117123)
@@ -8,10 +8,13 @@
     if (tests.length === 0)
         return finishTesting();
 
+    var defaultScript = 'http://127.0.0.1:8000/security/contentSecurityPolicy/resources/script.js'
     var current = tests.shift();
     var iframe = document.createElement('iframe');
-    iframe.src = "" + current[0] +
-                 "&q=http://127.0.0.1:8000/security/contentSecurityPolicy/resources/script.js&csp=" + escape(current[1]);
+    iframe.src = "" +
+                 "should_run=" + escape(current[0]) +
+                 "&csp=" + escape(current[1]) +
+                 "&q=" + escape(current[2] ? current[2] : defaultScript);
     iframe._onload_ = test;
     document.body.appendChild(iframe);
 }

Modified: trunk/LayoutTests/http/tests/security/contentSecurityPolicy/script-src-redirect.html (117122 => 117123)


--- trunk/LayoutTests/http/tests/security/contentSecurityPolicy/script-src-redirect.html	2012-05-15 19:50:03 UTC (rev 117122)
+++ trunk/LayoutTests/http/tests/security/contentSecurityPolicy/script-src-redirect.html	2012-05-15 19:51:45 UTC (rev 117123)
@@ -1,18 +1,17 @@
 <!DOCTYPE html>
 <html>
 <head>
+<script src=""
 <script>
-if (window.layoutTestController) {
-  layoutTestController.dumpAsText();
-  layoutTestController.dumpChildFramesAsText();
-}
+var tests = [
+  ['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'],
+  ['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']
+];
 </script>
 </head>
-<body>
+<body _onload_='test()'>
   <p>
     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.
   </p>
-  <iframe src=""
-  <iframe src=""
 </body>
 </html>
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to