Title: [208796] trunk/LayoutTests
Revision
208796
Author
[email protected]
Date
2016-11-16 10:07:25 -0800 (Wed, 16 Nov 2016)

Log Message

Make test sandbox-should-not-persist-on-navigation.html more representative of real-world scenario
https://bugs.webkit.org/show_bug.cgi?id=164752

Reviewed by Brent Fulgham.

Modify the test http-0.9/sandbox-should-not-persist-on-navigation.html so that it loads
a document on a default port using HTTP 0.9 to trigger the HTTP 0.9 sandbox as this
is more representative of a real-world scenario where we want a sandbox to be applied
and is the scenario that is currently covered by our HTTP 0.9 sandbox machinery.

Currently this test makes use of the pre r208549 behavior where the HTTP 0.9 sandbox
was applied to a document if one of its subresources loaded on a non-default port
using HTTP 0.9 in addition to the behavior where the sandbox is applied to a document
that loads on a default port using HTTP 0.9. Following r208549 we no longer apply the
sandbox to the document for the former case as this did not improve security much, if
any. The latter case is more representative of a real-world scenario where we want to
apply the sandbox policy and reflects our behavior following r208549.

* http/tests/security/http-0.9/resources/nph-sandbox-should-not-persist-on-navigation.pl: Added.
* http/tests/security/http-0.9/sandbox-should-not-persist-on-navigation-expected.txt:
* http/tests/security/http-0.9/sandbox-should-not-persist-on-navigation.html:
* platform/wk2/TestExpectations: Skip the HTTP-0.9 tests in WebKit2 as it uses internals.registerDefaultPortForProtocol().

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (208795 => 208796)


--- trunk/LayoutTests/ChangeLog	2016-11-16 18:00:03 UTC (rev 208795)
+++ trunk/LayoutTests/ChangeLog	2016-11-16 18:07:25 UTC (rev 208796)
@@ -1,3 +1,28 @@
+2016-11-16  Daniel Bates  <[email protected]>
+
+        Make test sandbox-should-not-persist-on-navigation.html more representative of real-world scenario
+        https://bugs.webkit.org/show_bug.cgi?id=164752
+
+        Reviewed by Brent Fulgham.
+
+        Modify the test http-0.9/sandbox-should-not-persist-on-navigation.html so that it loads
+        a document on a default port using HTTP 0.9 to trigger the HTTP 0.9 sandbox as this
+        is more representative of a real-world scenario where we want a sandbox to be applied
+        and is the scenario that is currently covered by our HTTP 0.9 sandbox machinery.
+
+        Currently this test makes use of the pre r208549 behavior where the HTTP 0.9 sandbox
+        was applied to a document if one of its subresources loaded on a non-default port
+        using HTTP 0.9 in addition to the behavior where the sandbox is applied to a document
+        that loads on a default port using HTTP 0.9. Following r208549 we no longer apply the
+        sandbox to the document for the former case as this did not improve security much, if
+        any. The latter case is more representative of a real-world scenario where we want to
+        apply the sandbox policy and reflects our behavior following r208549.
+
+        * http/tests/security/http-0.9/resources/nph-sandbox-should-not-persist-on-navigation.pl: Added.
+        * http/tests/security/http-0.9/sandbox-should-not-persist-on-navigation-expected.txt:
+        * http/tests/security/http-0.9/sandbox-should-not-persist-on-navigation.html:
+        * platform/wk2/TestExpectations: Skip the HTTP-0.9 tests in WebKit2 as it uses internals.registerDefaultPortForProtocol().
+
 2016-11-16  Ryan Haddad  <[email protected]>
 
         Unreviewed, rolling out r208770.

Added: trunk/LayoutTests/http/tests/security/http-0.9/resources/nph-sandbox-should-not-persist-on-navigation.pl (0 => 208796)


--- trunk/LayoutTests/http/tests/security/http-0.9/resources/nph-sandbox-should-not-persist-on-navigation.pl	                        (rev 0)
+++ trunk/LayoutTests/http/tests/security/http-0.9/resources/nph-sandbox-should-not-persist-on-navigation.pl	2016-11-16 18:07:25 UTC (rev 208796)
@@ -0,0 +1,11 @@
+#!/usr/bin/perl
+# This script relies on its nph- filename to invoke the CGI non-parsed-header facility.
+
+print <<'EOF';
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="refresh" content="0; url=""
+</head>
+</html>
+EOF
Property changes on: trunk/LayoutTests/http/tests/security/http-0.9/resources/nph-sandbox-should-not-persist-on-navigation.pl
___________________________________________________________________

Added: svn:executable

+* \ No newline at end of property

Modified: trunk/LayoutTests/http/tests/security/http-0.9/sandbox-should-not-persist-on-navigation-expected.txt (208795 => 208796)


--- trunk/LayoutTests/http/tests/security/http-0.9/sandbox-should-not-persist-on-navigation-expected.txt	2016-11-16 18:00:03 UTC (rev 208795)
+++ trunk/LayoutTests/http/tests/security/http-0.9/sandbox-should-not-persist-on-navigation-expected.txt	2016-11-16 18:07:25 UTC (rev 208796)
@@ -1 +1,7 @@
+CONSOLE MESSAGE: Sandboxing 'http://127.0.0.1:8000/security/http-0.9/resources/nph-sandbox-should-not-persist-on-navigation.pl' because it is using HTTP/0.9.
+
+
+--------
+Frame: '<!--framePath //<!--frame0-->-->'
+--------
 PASS

Modified: trunk/LayoutTests/http/tests/security/http-0.9/sandbox-should-not-persist-on-navigation.html (208795 => 208796)


--- trunk/LayoutTests/http/tests/security/http-0.9/sandbox-should-not-persist-on-navigation.html	2016-11-16 18:00:03 UTC (rev 208795)
+++ trunk/LayoutTests/http/tests/security/http-0.9/sandbox-should-not-persist-on-navigation.html	2016-11-16 18:07:25 UTC (rev 208796)
@@ -6,15 +6,12 @@
     testRunner.dumpAsText();
     testRunner.dumpChildFramesAsText();
     testRunner.waitUntilDone();
+    if (window.internals)
+        internals.registerDefaultPortForProtocol(8000, "http");
 }
-
-function runTest()
-{
-    window.location.href = ""
-}
 </script>
 </head>
 <body>
-<img src="" _onload_="runTest()" _onerror_="runTest()"> <!-- Apply sandbox -->
+<iframe src=""
 </body>
 </html>

Modified: trunk/LayoutTests/platform/wk2/TestExpectations (208795 => 208796)


--- trunk/LayoutTests/platform/wk2/TestExpectations	2016-11-16 18:00:03 UTC (rev 208795)
+++ trunk/LayoutTests/platform/wk2/TestExpectations	2016-11-16 18:07:25 UTC (rev 208796)
@@ -556,6 +556,7 @@
 http/tests/security/http-0.9/image-on-HTTP-0.9-default-port-page-allowed-ref-test.html
 http/tests/security/http-0.9/image-on-HTTP-0.9-default-port-page-allowed.html
 http/tests/security/http-0.9/image-on-HTTP-0.9-page-blocked.html
+http/tests/security/http-0.9/sandbox-should-not-persist-on-navigation.html
 
 # WebKitTestRunner doesn't have appleScriptController
 platform/mac/fast/AppleScript/001.html
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to