[WTR] Should dump as text when the mimetype is text/plain
authorossy@webkit.org <ossy@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Aug 2013 11:18:24 +0000 (11:18 +0000)
committerossy@webkit.org <ossy@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Aug 2013 11:18:24 +0000 (11:18 +0000)
https://bugs.webkit.org/show_bug.cgi?id=118306

Patch by Peter Gal <galpeter@inf.u-szeged.hu> on 2013-08-23
Reviewed by Christophe Dumez.

Tools:

Check for the text/plain mimetype and if true then mark it as
text dump.

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

LayoutTests:

Unskipping http/tests/multipart/load-last-non-html-frame.php.
Now the result should match the expectation.

* platform/wk2/TestExpectations:

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

LayoutTests/ChangeLog
LayoutTests/platform/wk2/TestExpectations
Tools/ChangeLog
Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp

index a4c1e13..4f50f7b 100644 (file)
@@ -1,3 +1,15 @@
+2013-08-23  Peter Gal  <galpeter@inf.u-szeged.hu>
+
+        [WTR] Should dump as text when the mimetype is text/plain
+        https://bugs.webkit.org/show_bug.cgi?id=118306
+
+        Reviewed by Christophe Dumez.
+
+        Unskipping http/tests/multipart/load-last-non-html-frame.php.
+        Now the result should match the expectation.
+
+        * platform/wk2/TestExpectations:
+
 2013-08-23  Simon Pena  <simon.pena@samsung.com>
 
         [GTK] Unreviewed gardening. Update test expectations.
index 8b5ad41..f6ee1ed 100644 (file)
@@ -235,7 +235,6 @@ editing/text-iterator/findString-selection-disabled.html
 
 # WebKit2 needs an implementation of FrameLoaderClient::revertToProvisionalState
 # https://bugs.webkit.org/show_bug.cgi?id=81365
-http/tests/multipart/load-last-non-html-frame.php
 http/tests/multipart/multipart-wait-before-boundary.html
 
 # layoutTestController.setWindowIsKey() has no effect on the web process side in WebKit2
index f4882f8..73e7aa1 100644 (file)
@@ -1,3 +1,16 @@
+2013-08-23  Peter Gal  <galpeter@inf.u-szeged.hu>
+
+        [WTR] Should dump as text when the mimetype is text/plain
+        https://bugs.webkit.org/show_bug.cgi?id=118306
+
+        Reviewed by Christophe Dumez.
+
+        Check for the text/plain mimetype and if true then mark it as
+        text dump.
+
+        * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+        (WTR::InjectedBundlePage::dump):
+
 2013-08-22  Filip Pizlo  <fpizlo@apple.com>
 
         Update LLVM binary drops and scripts to the latest version from SVN
index 41b88e7..b1dbab8 100644 (file)
@@ -848,8 +848,10 @@ void InjectedBundlePage::dump()
     WKBundlePageForceRepaint(m_page);
 
     WKBundleFrameRef frame = WKBundlePageGetMainFrame(m_page);
-    WTF::String url = toWTFString(adoptWK(WKURLCopyString(adoptWK(WKBundleFrameCopyURL(frame)).get())));
-    if (url.find("dumpAsText/") != WTF::notFound)
+    WKRetainPtr<WKURLRef> urlRef = adoptWK(WKBundleFrameCopyURL(frame));
+    String url = toWTFString(adoptWK(WKURLCopyString(urlRef.get())));
+    WKRetainPtr<WKStringRef> mimeType = adoptWK(WKBundleFrameCopyMIMETypeForResourceWithURL(frame, urlRef.get()));
+    if (url.find("dumpAsText/") != notFound || WKStringIsEqualToUTF8CString(mimeType.get(), "text/plain"))
         InjectedBundle::shared().testRunner()->dumpAsText(false);
 
     StringBuilder stringBuilder;