Title: [129653] trunk
Revision
129653
Author
commit-qu...@webkit.org
Date
2012-09-26 09:12:52 -0700 (Wed, 26 Sep 2012)

Log Message

[WK2][WTR] Policy client: dumping from decidePolicyForResponse callback
https://bugs.webkit.org/show_bug.cgi?id=97034

Patch by Mikhail Pozdnyakov <mikhail.pozdnya...@intel.com> on 2012-09-26
Reviewed by Kenneth Rohde Christiansen.

Source/WebCore:

Exported WebCore::ResourceResponseBase::isAttachment() method for MAC port.

No new tests. No functionality added.

* WebCore.exp.in:

Source/WebKit2:

Added suggested filename getter to WKURLResponse interface and also added a property showing whether the response
is attachment.

* Shared/API/c/WKURLResponse.cpp:
(WKURLResponseSuggestedFilename):
(WKURLResponseIsAttachment):
* Shared/API/c/WKURLResponse.h:

Tools:

Provided dumping from WTR Policy client 'decidePolicyForResponse' callback.

* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::decidePolicyForResponse):

LayoutTests:

Unskipped some of http/tests/download tests from wk2/Skipped, put those which still fail
to an appropriate group in wk2/Skipped file. All of the http/tests/download tests still fail
for EFL WK1.

* platform/efl-wk1/TestExpectations:
* platform/efl/TestExpectations:
* platform/wk2/Skipped:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (129652 => 129653)


--- trunk/LayoutTests/ChangeLog	2012-09-26 16:00:09 UTC (rev 129652)
+++ trunk/LayoutTests/ChangeLog	2012-09-26 16:12:52 UTC (rev 129653)
@@ -1,3 +1,18 @@
+2012-09-26  Mikhail Pozdnyakov  <mikhail.pozdnya...@intel.com>
+
+        [WK2][WTR] Policy client: dumping from decidePolicyForResponse callback
+        https://bugs.webkit.org/show_bug.cgi?id=97034
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Unskipped some of http/tests/download tests from wk2/Skipped, put those which still fail
+        to an appropriate group in wk2/Skipped file. All of the http/tests/download tests still fail
+        for EFL WK1.
+
+        * platform/efl-wk1/TestExpectations:
+        * platform/efl/TestExpectations:
+        * platform/wk2/Skipped:
+
 2012-09-26  Stephen Chenney  <schen...@chromium.org>
 
         Unreviewed Chromium expectations update.

Modified: trunk/LayoutTests/platform/efl/TestExpectations (129652 => 129653)


--- trunk/LayoutTests/platform/efl/TestExpectations	2012-09-26 16:00:09 UTC (rev 129652)
+++ trunk/LayoutTests/platform/efl/TestExpectations	2012-09-26 16:12:52 UTC (rev 129653)
@@ -521,9 +521,6 @@
 #__worldID is undefined in isolated world
 Bug(EFL) http/tests/security/isolatedWorld/didClearWindowObject.html
 
-# Needs custom policy delegate enhancement to log downloads - EFL port is missing api for getting header fields from HTTP responses. 
-webkit.org/b/87974 http/tests/download [ Failure ImageOnlyFailure ]
-
 # Needs custom policy delegate enhancement to log DOM node info - EFL port is missing DOM node abstraction
 webkit.org/b/87972 fast/loader/policy-delegate-action-hit-test-zoomed.html [ Failure ]
 webkit.org/b/87972 fast/encoding/mailto-always-utf-8.html [ Failure ]

Modified: trunk/LayoutTests/platform/efl-wk1/TestExpectations (129652 => 129653)


--- trunk/LayoutTests/platform/efl-wk1/TestExpectations	2012-09-26 16:00:09 UTC (rev 129652)
+++ trunk/LayoutTests/platform/efl-wk1/TestExpectations	2012-09-26 16:12:52 UTC (rev 129653)
@@ -115,3 +115,6 @@
 # Fail after r128393.
 webkit.org/b/96620 http/tests/loading/pdf-commit-load-callbacks.html [ Failure ]
 webkit.org/b/96620 http/tests/loading/text-content-type-with-binary-extension.html [ Failure ]
+
+# Needs custom policy delegate enhancement to log downloads - EFL port is missing api for getting header fields from HTTP responses.
+webkit.org/b/87974 http/tests/download [ Failure ]

Modified: trunk/LayoutTests/platform/wk2/Skipped (129652 => 129653)


--- trunk/LayoutTests/platform/wk2/Skipped	2012-09-26 16:00:09 UTC (rev 129652)
+++ trunk/LayoutTests/platform/wk2/Skipped	2012-09-26 16:12:52 UTC (rev 129653)
@@ -806,9 +806,11 @@
 fast/spatial-navigation/snav-iframe-no-scrollable-content.html
 fast/spatial-navigation/snav-imagemap-overlapped-areas.html
 
-# WK2 is missing API for getting header fields from HTTP responses
-# which have to be serialized.
-http/tests/download
+# InjectedBundlePagePolicyClient::decidePolicyForResponse is not called on WK2 EFL at least.
+# Might be port-specific issue. Should be checked on other ports.
+http/tests/download/default-encoding.html
+http/tests/download/inherited-encoding-form-submission-result.html
+http/tests/download/inherited-encoding.html
 
 # WebFrameLoaderClient::canHandleRequest() has to be implemented.
 http/tests/misc/redirect-to-external-url.html

Modified: trunk/Source/WebCore/ChangeLog (129652 => 129653)


--- trunk/Source/WebCore/ChangeLog	2012-09-26 16:00:09 UTC (rev 129652)
+++ trunk/Source/WebCore/ChangeLog	2012-09-26 16:12:52 UTC (rev 129653)
@@ -1,3 +1,16 @@
+2012-09-26  Mikhail Pozdnyakov  <mikhail.pozdnya...@intel.com>
+
+        [WK2][WTR] Policy client: dumping from decidePolicyForResponse callback
+        https://bugs.webkit.org/show_bug.cgi?id=97034
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Exported WebCore::ResourceResponseBase::isAttachment() method for MAC port.
+
+        No new tests. No functionality added.
+
+        * WebCore.exp.in:
+
 2012-09-26  Brady Eidson  <beid...@apple.com>
 
         (Threaded scrolling) WebKit not scrolling to the correct location upon going back on macsurfer.com

Modified: trunk/Source/WebCore/WebCore.exp.in (129652 => 129653)


--- trunk/Source/WebCore/WebCore.exp.in	2012-09-26 16:00:09 UTC (rev 129652)
+++ trunk/Source/WebCore/WebCore.exp.in	2012-09-26 16:12:52 UTC (rev 129653)
@@ -1251,6 +1251,7 @@
 __ZNK7WebCore20ResourceResponseBase16textEncodingNameEv
 __ZNK7WebCore20ResourceResponseBase17suggestedFilenameEv
 __ZNK7WebCore20ResourceResponseBase21expectedContentLengthEv
+__ZNK7WebCore20ResourceResponseBase12isAttachmentEv
 __ZNK7WebCore20ResourceResponseBase3urlEv
 __ZNK7WebCore20ResourceResponseBase6isHTTPEv
 __ZNK7WebCore20ResourceResponseBase8mimeTypeEv

Modified: trunk/Source/WebKit2/ChangeLog (129652 => 129653)


--- trunk/Source/WebKit2/ChangeLog	2012-09-26 16:00:09 UTC (rev 129652)
+++ trunk/Source/WebKit2/ChangeLog	2012-09-26 16:12:52 UTC (rev 129653)
@@ -1,3 +1,18 @@
+2012-09-26  Mikhail Pozdnyakov  <mikhail.pozdnya...@intel.com>
+
+        [WK2][WTR] Policy client: dumping from decidePolicyForResponse callback
+        https://bugs.webkit.org/show_bug.cgi?id=97034
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Added suggested filename getter to WKURLResponse interface and also added a property showing whether the response
+        is attachment.
+
+        * Shared/API/c/WKURLResponse.cpp:
+        (WKURLResponseSuggestedFilename):
+        (WKURLResponseIsAttachment):
+        * Shared/API/c/WKURLResponse.h:
+
 2012-09-26  Martin Robinson  <mrobin...@igalia.com>
 
         [GTK] Use XDamage to simplify RedirectedXCompositeWindow

Modified: trunk/Source/WebKit2/Shared/API/c/WKURLResponse.cpp (129652 => 129653)


--- trunk/Source/WebKit2/Shared/API/c/WKURLResponse.cpp	2012-09-26 16:00:09 UTC (rev 129652)
+++ trunk/Source/WebKit2/Shared/API/c/WKURLResponse.cpp	2012-09-26 16:12:52 UTC (rev 129653)
@@ -51,3 +51,13 @@
 {
     return toImpl(responseRef)->resourceResponse().httpStatusCode();
 }
+
+WKStringRef WKURLResponseCopySuggestedFilename(WKURLResponseRef responseRef)
+{
+    return toCopiedAPI(toImpl(responseRef)->resourceResponse().suggestedFilename());
+}
+
+bool WKURLResponseIsAttachment(WKURLResponseRef responseRef)
+{
+    return toImpl(responseRef)->resourceResponse().isAttachment();
+}

Modified: trunk/Source/WebKit2/Shared/API/c/WKURLResponse.h (129652 => 129653)


--- trunk/Source/WebKit2/Shared/API/c/WKURLResponse.h	2012-09-26 16:00:09 UTC (rev 129652)
+++ trunk/Source/WebKit2/Shared/API/c/WKURLResponse.h	2012-09-26 16:12:52 UTC (rev 129653)
@@ -40,6 +40,10 @@
 
 WK_EXPORT int32_t WKURLResponseHTTPStatusCode(WKURLResponseRef);
 
+WK_EXPORT WKStringRef WKURLResponseCopySuggestedFilename(WKURLResponseRef);
+
+WK_EXPORT bool WKURLResponseIsAttachment(WKURLResponseRef);
+
 #ifdef __cplusplus
 }
 #endif

Modified: trunk/Tools/ChangeLog (129652 => 129653)


--- trunk/Tools/ChangeLog	2012-09-26 16:00:09 UTC (rev 129652)
+++ trunk/Tools/ChangeLog	2012-09-26 16:12:52 UTC (rev 129653)
@@ -1,3 +1,15 @@
+2012-09-26  Mikhail Pozdnyakov  <mikhail.pozdnya...@intel.com>
+
+        [WK2][WTR] Policy client: dumping from decidePolicyForResponse callback
+        https://bugs.webkit.org/show_bug.cgi?id=97034
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Provided dumping from WTR Policy client 'decidePolicyForResponse' callback.
+
+        * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+        (WTR::InjectedBundlePage::decidePolicyForResponse):
+
 2012-09-26  Zoltan Arvai  <zar...@inf.u-szeged.hu>
 
         [Qt][WTR] Build fix for MSVC. 

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp (129652 => 129653)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp	2012-09-26 16:00:09 UTC (rev 129652)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp	2012-09-26 16:12:52 UTC (rev 129653)
@@ -1330,6 +1330,13 @@
 
 WKBundlePagePolicyAction InjectedBundlePage::decidePolicyForResponse(WKBundlePageRef page, WKBundleFrameRef, WKURLResponseRef response, WKURLRequestRef, WKTypeRef*)
 {
+    if (WKURLResponseIsAttachment(response)) {
+        WKRetainPtr<WKStringRef> filename = adoptWK(WKURLResponseCopySuggestedFilename(response));
+        InjectedBundle::shared().stringBuilder()->appendLiteral("Policy delegate: resource is an attachment, suggested file name \'");
+        InjectedBundle::shared().stringBuilder()->append(toWTFString(filename));
+        InjectedBundle::shared().stringBuilder()->appendLiteral("\'\n");
+    }
+
     WKRetainPtr<WKStringRef> mimeType = adoptWK(WKURLResponseCopyMIMEType(response));
     return WKBundlePageCanShowMIMEType(page, mimeType.get()) ? WKBundlePagePolicyActionUse : WKBundlePagePolicyActionPassThrough;
 }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to