[WK2] WebKitTestRunner needs layoutTestController.setPopupBlockingEnabled
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Jan 2012 17:21:33 +0000 (17:21 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Jan 2012 17:21:33 +0000 (17:21 +0000)
https://bugs.webkit.org/show_bug.cgi?id=63458

Patch by Nándor Huszka <huszka.nandor@stud.u-szeged.hu> on 2012-01-25
Reviewed by Adam Roben.

Source/WebKit2:

Implement the setPopupBlockingEnabled method.

* WebProcess/InjectedBundle/API/c/WKBundle.cpp:
(WKBundleSetPrivateBrowsingEnabled):
(WKBundleSetPopupBlockingEnabled):
* WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::setPopupBlockingEnabled):
* WebProcess/InjectedBundle/InjectedBundle.h:

Tools:

Implement the setPopupBlockingEnabled method.

* WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl:
* WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
(WTR::LayoutTestController::setPopupBlockingEnabled):
* WebKitTestRunner/InjectedBundle/LayoutTestController.h:

LayoutTests:

Unskip tests which do not fail now.

* platform/wk2/Skipped:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@105884 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/platform/wk2/Skipped
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h
Tools/ChangeLog
Tools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl
Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp
Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.h

index 8bd564c..7589c88 100644 (file)
@@ -1,3 +1,14 @@
+2012-01-25  Nándor Huszka  <huszka.nandor@stud.u-szeged.hu>
+
+        [WK2] WebKitTestRunner needs layoutTestController.setPopupBlockingEnabled
+        https://bugs.webkit.org/show_bug.cgi?id=63458
+
+        Reviewed by Adam Roben.
+
+        Unskip tests which do not fail now.
+
+        * platform/wk2/Skipped:
+
 2012-01-25  Philippe Normand  <pnormand@igalia.com>
 
         Unreviewed, GTK rebaseline and skipping 2 new test failures.
index ecf15b2..2c2d735 100644 (file)
@@ -874,24 +874,6 @@ http/tests/security/contentSecurityPolicy/report-uri-from-child-frame.html
 # https://bugs.webkit.org/show_bug.cgi?id=71896
 http/tests/security/contentSecurityPolicy/block-mixed-content-hides-warning.html
 
-# WebKitTestRunner needs layoutTestController.setPopupBlockingEnabled
-# https://bugs.webkit.org/show_bug.cgi?id=63458
-fast/events/popup-blocked-from-untrusted-click-event-on-anchor.html
-fast/events/popup-blocked-from-iframe-src.html
-fast/events/popup-allowed-from-gesture-initiated-event.html
-fast/events/popup-allowed-from-gesture-initiated-form-submit.html
-fast/events/popup-blocked-from-fake-button-click.html
-fast/events/popup-blocked-from-fake-focus.html
-fast/events/popup-blocked-from-fake-user-gesture.html
-fast/events/popup-blocked-from-history-reload.html
-fast/events/popup-blocked-from-iframe-script.html
-fast/events/popup-blocked-from-mousemove.html
-fast/events/popup-blocked-from-untrusted-mouse-click.html
-fast/events/popup-blocked-from-window-open.html
-fast/events/popup-blocked-to-post-blank.html
-fast/events/popup-blocking-timers.html
-plugins/plugin-initiate-popup-window.html
-
 # WebKitTestRunner needs an implementation of allowRoundingHacks
 # http://webkit.org/b/63477
 platform/mac/fast/text/rounding-hacks.html
@@ -1241,6 +1223,7 @@ fast/dom/StyleSheet/detached-style-pi.xhtml
 fast/dom/StyleSheet/detached-style.html
 fast/dom/Window/window-appendages-cleared.html
 fast/dom/tab-in-right-alignment.html
+fast/events/popup-blocked-from-fake-user-gesture.html
 fast/frames/frame-element-name.html
 fast/frames/iframe-onload-remove-self-no-crash.html
 fast/frames/iframe-reparenting-adopt-node.html
@@ -1280,6 +1263,7 @@ media/controls-after-reload.html
 media/controls-styling.html
 platform/mac/fast/loader/non-html-load-event.html
 plugins/embed-attributes-style.html
+plugins/plugin-initiate-popup-window.html
 storage/open-database-while-transaction-in-progress.html
 svg/custom/clip-path-referencing-use2.svg
 svg/dom/fuzz-path-parser.html
index aa8188b..6214ddd 100644 (file)
@@ -1,3 +1,20 @@
+2012-01-25  Nándor Huszka  <huszka.nandor@stud.u-szeged.hu>
+
+        [WK2] WebKitTestRunner needs layoutTestController.setPopupBlockingEnabled
+        https://bugs.webkit.org/show_bug.cgi?id=63458
+
+        Reviewed by Adam Roben.
+
+        Implement the setPopupBlockingEnabled method.
+
+        * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
+        (WKBundleSetPrivateBrowsingEnabled):
+        (WKBundleSetPopupBlockingEnabled):
+        * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
+        * WebProcess/InjectedBundle/InjectedBundle.cpp:
+        (WebKit::InjectedBundle::setPopupBlockingEnabled):
+        * WebProcess/InjectedBundle/InjectedBundle.h:
+
 2012-01-25  Yael Aharon  <yael.aharon@nokia.com>
 
         [Qt] Build fix when using force_static_libs_as_shared
index d88281e..bb25f39 100644 (file)
@@ -156,6 +156,11 @@ void WKBundleSetPrivateBrowsingEnabled(WKBundleRef bundleRef, WKBundlePageGroupR
     toImpl(bundleRef)->setPrivateBrowsingEnabled(toImpl(pageGroupRef), enabled);
 }
 
+void WKBundleSetPopupBlockingEnabled(WKBundleRef bundleRef, WKBundlePageGroupRef pageGroupRef, bool enabled)
+{
+    toImpl(bundleRef)->setPopupBlockingEnabled(toImpl(pageGroupRef), enabled);
+}
+
 void WKBundleSwitchNetworkLoaderToNewTestingSession(WKBundleRef bundleRef)
 {
     toImpl(bundleRef)->switchNetworkLoaderToNewTestingSession();
index 95ca7ce..a4e1c50 100644 (file)
@@ -70,6 +70,7 @@ WK_EXPORT void WKBundleSetAllowFileAccessFromFileURLs(WKBundleRef bundle, WKBund
 WK_EXPORT void WKBundleSetFrameFlatteningEnabled(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled);
 WK_EXPORT void WKBundleSetJavaScriptCanAccessClipboard(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled);
 WK_EXPORT void WKBundleSetPrivateBrowsingEnabled(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled);
+WK_EXPORT void WKBundleSetPopupBlockingEnabled(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled);
 WK_EXPORT void WKBundleSetAuthorAndUserStylesEnabled(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled);
 WK_EXPORT void WKBundleClearAllDatabases(WKBundleRef bundle);
 WK_EXPORT void WKBundleSetDatabaseQuota(WKBundleRef bundle, uint64_t);
index b87151e..a0db5ed 100644 (file)
@@ -159,6 +159,14 @@ void InjectedBundle::setPrivateBrowsingEnabled(WebPageGroupProxy* pageGroup, boo
         (*iter)->settings()->setPrivateBrowsingEnabled(enabled);
 }
 
+void InjectedBundle::setPopupBlockingEnabled(WebPageGroupProxy* pageGroup, bool enabled)
+{
+    const HashSet<Page*>& pages = PageGroup::pageGroup(pageGroup->identifier())->pages();
+    HashSet<Page*>::const_iterator end = pages.end();
+    for (HashSet<Page*>::const_iterator iter = pages.begin(); iter != end; ++iter)
+        (*iter)->settings()->setJavaScriptCanOpenWindowsAutomatically(!enabled);
+}
+
 void InjectedBundle::switchNetworkLoaderToNewTestingSession()
 {
 #if USE(CFURLSTORAGESESSIONS)
index 6ff2cfa..e6abace 100644 (file)
@@ -103,6 +103,7 @@ public:
     void setFrameFlatteningEnabled(WebPageGroupProxy*, bool);
     void setJavaScriptCanAccessClipboard(WebPageGroupProxy*, bool);
     void setPrivateBrowsingEnabled(WebPageGroupProxy*, bool);
+    void setPopupBlockingEnabled(WebPageGroupProxy*, bool);
     void switchNetworkLoaderToNewTestingSession();
     void setAuthorAndUserStylesEnabled(WebPageGroupProxy*, bool);
     void addOriginAccessWhitelistEntry(const String&, const String&, const String&, bool);
index ed09edd..0f76e56 100644 (file)
@@ -1,3 +1,17 @@
+2012-01-25  Nándor Huszka  <huszka.nandor@stud.u-szeged.hu>
+
+        [WK2] WebKitTestRunner needs layoutTestController.setPopupBlockingEnabled
+        https://bugs.webkit.org/show_bug.cgi?id=63458
+
+        Reviewed by Adam Roben.
+
+        Implement the setPopupBlockingEnabled method.
+
+        * WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl:
+        * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
+        (WTR::LayoutTestController::setPopupBlockingEnabled):
+        * WebKitTestRunner/InjectedBundle/LayoutTestController.h:
+
 2012-01-24  Balazs Kelemen  <kbalazs@webkit.org>
 
         [Qt] Cleanup testfonts handling
index 4ce74b0..84a476d 100644 (file)
@@ -54,6 +54,7 @@ module WTR {
         void setFrameFlatteningEnabled(in boolean value);
         void setJavaScriptCanAccessClipboard(in boolean value);
         void setPrivateBrowsingEnabled(in boolean value);
+        void setPopupBlockingEnabled(in boolean value);
         void setAuthorAndUserStylesEnabled(in boolean value);
         void addOriginAccessWhitelistEntry(in DOMString sourceOrigin, in DOMString destinationProtocol, in DOMString destinationHost, in boolean allowDestinationSubdomains);
         void removeOriginAccessWhitelistEntry(in DOMString sourceOrigin, in DOMString destinationProtocol, in DOMString destinationHost, in boolean allowDestinationSubdomains);
index 6cd2e42..8110961 100644 (file)
@@ -378,6 +378,11 @@ void LayoutTestController::setPrivateBrowsingEnabled(bool enabled)
      WKBundleSetPrivateBrowsingEnabled(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), enabled);
 }
 
+void LayoutTestController::setPopupBlockingEnabled(bool enabled)
+{
+     WKBundleSetPopupBlockingEnabled(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), enabled);
+}
+
 void LayoutTestController::setAuthorAndUserStylesEnabled(bool enabled)
 {
      WKBundleSetAuthorAndUserStylesEnabled(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), enabled);
index b47cb47..fbdac91 100644 (file)
@@ -85,6 +85,7 @@ public:
     void setFrameFlatteningEnabled(bool);
     void setJavaScriptCanAccessClipboard(bool);
     void setPrivateBrowsingEnabled(bool);
+    void setPopupBlockingEnabled(bool);
     void setAuthorAndUserStylesEnabled(bool);
     void setCustomPolicyDelegate(bool enabled, bool permissive = false);
     void addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains);