Title: [210113] trunk/LayoutTests
Revision
210113
Author
[email protected]
Date
2016-12-22 14:26:37 -0800 (Thu, 22 Dec 2016)

Log Message

Make http/tests/security/popup-blocked-from-{fake-event, window-open}.html actually test popup
blocker; run on WebKit2
https://bugs.webkit.org/show_bug.cgi?id=166403

Reviewed by Darin Adler.

The tests http/tests/security/popup-blocked-from-{fake-event, window-open}.html inadvertently
depended on the default behavior of DumpRenderTree to ignore the ChromeClient::createWindow()
callback when asked to create a new window instead of testing that the popup blocker blocked
opening windows. We should call testRunner.setCanOpenWindows() and testRunner.setPopupBlockingEnabled(true)
from both of these tests so that DumpRenderTree respects requests to open windows and enable
the popup blocker (it is disabled by default), respectively.

The default behavior of DumpRenderTree to disallow opening windows falls out from the purpose
and implementation of testRunner.setCanOpenWindows() to support writing tests where the embedding
client ignores requests to create a new window. We do not implement such a concept in WebKitTestRunner
(see <https://bugs.webkit.org/show_bug.cgi?id=166402>).

* http/tests/security/popup-blocked-from-fake-event.html:
* http/tests/security/popup-blocked-from-window-open.html:
* platform/wk2/TestExpectations: Unskip the above tests as they now pass.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (210112 => 210113)


--- trunk/LayoutTests/ChangeLog	2016-12-22 22:20:25 UTC (rev 210112)
+++ trunk/LayoutTests/ChangeLog	2016-12-22 22:26:37 UTC (rev 210113)
@@ -1,5 +1,29 @@
 2016-12-22  Daniel Bates  <[email protected]>
 
+        Make http/tests/security/popup-blocked-from-{fake-event, window-open}.html actually test popup
+        blocker; run on WebKit2
+        https://bugs.webkit.org/show_bug.cgi?id=166403
+
+        Reviewed by Darin Adler.
+
+        The tests http/tests/security/popup-blocked-from-{fake-event, window-open}.html inadvertently
+        depended on the default behavior of DumpRenderTree to ignore the ChromeClient::createWindow()
+        callback when asked to create a new window instead of testing that the popup blocker blocked
+        opening windows. We should call testRunner.setCanOpenWindows() and testRunner.setPopupBlockingEnabled(true)
+        from both of these tests so that DumpRenderTree respects requests to open windows and enable
+        the popup blocker (it is disabled by default), respectively.
+
+        The default behavior of DumpRenderTree to disallow opening windows falls out from the purpose
+        and implementation of testRunner.setCanOpenWindows() to support writing tests where the embedding
+        client ignores requests to create a new window. We do not implement such a concept in WebKitTestRunner
+        (see <https://bugs.webkit.org/show_bug.cgi?id=166402>).
+
+        * http/tests/security/popup-blocked-from-fake-event.html:
+        * http/tests/security/popup-blocked-from-window-open.html:
+        * platform/wk2/TestExpectations: Unskip the above tests as they now pass.
+
+2016-12-22  Daniel Bates  <[email protected]>
+
         Bypass pop-up blocker from cross-origin or sandboxed frame
         https://bugs.webkit.org/show_bug.cgi?id=166290
         <rdar://problem/29742039>

Modified: trunk/LayoutTests/http/tests/security/popup-blocked-from-fake-event.html (210112 => 210113)


--- trunk/LayoutTests/http/tests/security/popup-blocked-from-fake-event.html	2016-12-22 22:20:25 UTC (rev 210112)
+++ trunk/LayoutTests/http/tests/security/popup-blocked-from-fake-event.html	2016-12-22 22:26:37 UTC (rev 210113)
@@ -4,6 +4,8 @@
 <script> 
 if (window.testRunner) {
     testRunner.dumpAsText();
+    testRunner.setCanOpenWindows();
+    testRunner.setPopupBlockingEnabled(true);
     testRunner.setCloseRemainingWindowsWhenComplete(true);
 }
 

Modified: trunk/LayoutTests/http/tests/security/popup-blocked-from-window-open.html (210112 => 210113)


--- trunk/LayoutTests/http/tests/security/popup-blocked-from-window-open.html	2016-12-22 22:20:25 UTC (rev 210112)
+++ trunk/LayoutTests/http/tests/security/popup-blocked-from-window-open.html	2016-12-22 22:26:37 UTC (rev 210113)
@@ -3,6 +3,8 @@
 <script> 
 if (window.testRunner) {
     testRunner.dumpAsText();
+    testRunner.setCanOpenWindows();
+    testRunner.setPopupBlockingEnabled(true);
     testRunner.setCloseRemainingWindowsWhenComplete(true);
 }
 

Modified: trunk/LayoutTests/platform/wk2/TestExpectations (210112 => 210113)


--- trunk/LayoutTests/platform/wk2/TestExpectations	2016-12-22 22:20:25 UTC (rev 210112)
+++ trunk/LayoutTests/platform/wk2/TestExpectations	2016-12-22 22:26:37 UTC (rev 210113)
@@ -438,8 +438,6 @@
 http/tests/security/_javascript_URL/xss-ALLOWED-to-_javascript_-url-window-open.html
 http/tests/security/_javascript_URL/xss-DENIED-from-_javascript_-url-in-foreign-domain-window-open.html
 http/tests/security/_javascript_URL/xss-DENIED-to-_javascript_-url-in-foreign-domain-window-open.html
-http/tests/security/popup-blocked-from-fake-event.html
-http/tests/security/popup-blocked-from-window-open.html
 
 # Unexplained failures that were formerly in the "unsafe access" list.
 http/tests/security/cross-frame-access-enumeration.html
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to