[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

tony at chromium.org tony at chromium.org
Wed Dec 22 13:15:09 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit f4055487dfe42a3544335a3735fc0c5430b09364
Author: tony at chromium.org <tony at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Sep 9 21:48:20 2010 +0000

    2010-09-09  Mihai Parparita  <mihaip at chromium.org>
    
            Reviewed by Tony Chang.
    
            Implement layoutTestController.dumpResourceResponseMIMETypes in Chromium DRT
            https://bugs.webkit.org/show_bug.cgi?id=45479
    
            Remove tests from Chromium expectations that now pass.
    
            * platform/chromium-linux/fast/dom/HTMLLinkElement/prefetch-expected.txt: Removed.
            * platform/chromium-mac/fast/dom/HTMLLinkElement/prefetch-expected.txt: Removed.
            * platform/chromium/test_expectations.txt:
    2010-09-09  Mihai Parparita  <mihaip at chromium.org>
    
            Reviewed by Tony Chang.
    
            Implement layoutTestController.dumpResourceResponseMIMETypes in Chromium DRT
            https://bugs.webkit.org/show_bug.cgi?id=45479
    
            Implement layoutTestController.dumpResourceResponseMIMETypes (modelled after
            implementation in ResourceLoadDelegate in the Mac port).
    
            * DumpRenderTree/chromium/LayoutTestController.cpp:
            (LayoutTestController::LayoutTestController):
            (LayoutTestController::dumpResourceResponseMIMETypes):
            (LayoutTestController::reset):
            * DumpRenderTree/chromium/LayoutTestController.h:
            (LayoutTestController::setShouldDumpResourceResponseMIMETypes):
            (LayoutTestController::shouldDumpResourceResponseMIMETypes):
            * DumpRenderTree/chromium/TestShell.h:
            (TestShell::shouldDumpResourceResponseMIMETypes):
            * DumpRenderTree/chromium/WebViewHost.cpp:
            (WebViewHost::didReceiveResponse):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@67119 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 511b32c..14b087e 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,16 @@
+2010-09-09  Mihai Parparita  <mihaip at chromium.org>
+
+        Reviewed by Tony Chang.
+
+        Implement layoutTestController.dumpResourceResponseMIMETypes in Chromium DRT
+        https://bugs.webkit.org/show_bug.cgi?id=45479
+
+        Remove tests from Chromium expectations that now pass.
+
+        * platform/chromium-linux/fast/dom/HTMLLinkElement/prefetch-expected.txt: Removed.
+        * platform/chromium-mac/fast/dom/HTMLLinkElement/prefetch-expected.txt: Removed.
+        * platform/chromium/test_expectations.txt:
+
 2010-09-09  Robert Hogan  <robert at webkit.org>
 
         Reviewed by Andreas Kling.
diff --git a/LayoutTests/platform/chromium-linux/fast/dom/HTMLLinkElement/prefetch-expected.txt b/LayoutTests/platform/chromium-linux/fast/dom/HTMLLinkElement/prefetch-expected.txt
deleted file mode 100644
index a3468f1..0000000
--- a/LayoutTests/platform/chromium-linux/fast/dom/HTMLLinkElement/prefetch-expected.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-CONSOLE MESSAGE: line 6: Uncaught TypeError: Object [object Object] has no method 'dumpResourceResponseMIMETypes'
-
-This test requires DumpRenderTree to see the log of what resources are loaded.
diff --git a/LayoutTests/platform/chromium-mac/fast/dom/HTMLLinkElement/prefetch-expected.txt b/LayoutTests/platform/chromium-mac/fast/dom/HTMLLinkElement/prefetch-expected.txt
deleted file mode 100644
index a3468f1..0000000
--- a/LayoutTests/platform/chromium-mac/fast/dom/HTMLLinkElement/prefetch-expected.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-CONSOLE MESSAGE: line 6: Uncaught TypeError: Object [object Object] has no method 'dumpResourceResponseMIMETypes'
-
-This test requires DumpRenderTree to see the log of what resources are loaded.
diff --git a/LayoutTests/platform/chromium/test_expectations.txt b/LayoutTests/platform/chromium/test_expectations.txt
index bd8c086..8cc4e09 100644
--- a/LayoutTests/platform/chromium/test_expectations.txt
+++ b/LayoutTests/platform/chromium/test_expectations.txt
@@ -2673,11 +2673,6 @@ BUG46603 : fast/frames/lots-of-objects.html = PASS TIMEOUT
 // LayoutTestController::pageProperty is not implemented for Chromium yet.
 BUGWK35961 : printing/page-rule-selection.html = TEXT
 
-// Needs to implement layoutTestController.dumpResourceResponseMIMETypes()
-BUG46872 : fast/preloader = TEXT
-BUG46872 : fast/dom/HTMLLinkElement/prefetch.html = TIMEOUT
-BUG46872 : http/tests/loading/preload-slow-loading.php = TEXT
-
 BUG47035 WIN DEBUG : fast/loader/stateobjects/document-destroyed-navigate-back-with-fragment-scroll.html = PASS TEXT
 
 // CSS3 Hyphenation landed in http://trac.webkit.org/changeset/61548
@@ -2799,8 +2794,6 @@ BUG48859 WIN : fast/inline/continuation-outlines-with-layers-2.html = IMAGE+TEXT
 // Need investigation.
 BUGWK38016 WIN : svg/custom/foreign-object-skew.svg = FAIL
 
-BUG49031 WIN LINUX MAC : http/tests/mime/uppercase-mime-type.html = MISSING
-
 BUG49021 : userscripts/mixed-case-stylesheet.html = TEXT
 BUG49021 : userscripts/simple-stylesheet.html = TEXT
 BUG49021 : userscripts/user-style-all-frames.html = TEXT
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index f680eb2..1807a83 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,5 +1,27 @@
 2010-09-09  Mihai Parparita  <mihaip at chromium.org>
 
+        Reviewed by Tony Chang.
+
+        Implement layoutTestController.dumpResourceResponseMIMETypes in Chromium DRT
+        https://bugs.webkit.org/show_bug.cgi?id=45479
+
+        Implement layoutTestController.dumpResourceResponseMIMETypes (modelled after
+        implementation in ResourceLoadDelegate in the Mac port).
+
+        * DumpRenderTree/chromium/LayoutTestController.cpp:
+        (LayoutTestController::LayoutTestController):
+        (LayoutTestController::dumpResourceResponseMIMETypes):
+        (LayoutTestController::reset):
+        * DumpRenderTree/chromium/LayoutTestController.h:
+        (LayoutTestController::setShouldDumpResourceResponseMIMETypes):
+        (LayoutTestController::shouldDumpResourceResponseMIMETypes):
+        * DumpRenderTree/chromium/TestShell.h:
+        (TestShell::shouldDumpResourceResponseMIMETypes):
+        * DumpRenderTree/chromium/WebViewHost.cpp:
+        (WebViewHost::didReceiveResponse):
+
+2010-09-09  Mihai Parparita  <mihaip at chromium.org>
+
         Reviewed by Daniel Bates.
 
         svn-apply tries to delete directories it shouldn't
diff --git a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp
index 8e08c4c..f896241 100644
--- a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp
+++ b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp
@@ -83,6 +83,7 @@ LayoutTestController::LayoutTestController(TestShell* shell)
     bindMethod("dumpBackForwardList", &LayoutTestController::dumpBackForwardList);
     bindMethod("dumpFrameLoadCallbacks", &LayoutTestController::dumpFrameLoadCallbacks);
     bindMethod("dumpResourceLoadCallbacks", &LayoutTestController::dumpResourceLoadCallbacks);
+    bindMethod("dumpResourceResponseMIMETypes", &LayoutTestController::dumpResourceResponseMIMETypes);
     bindMethod("dumpStatusCallbacks", &LayoutTestController::dumpWindowStatusChanges);
     bindMethod("dumpTitleChanges", &LayoutTestController::dumpTitleChanges);
     bindMethod("setAcceptsEditing", &LayoutTestController::setAcceptsEditing);
@@ -285,6 +286,12 @@ void LayoutTestController::dumpResourceLoadCallbacks(const CppArgumentList&, Cpp
     result->setNull();
 }
 
+void LayoutTestController::dumpResourceResponseMIMETypes(const CppArgumentList&, CppVariant* result)
+{
+    m_dumpResourceResponseMIMETypes = true;
+    result->setNull();
+}
+
 void LayoutTestController::dumpChildFrameScrollPositions(const CppArgumentList&, CppVariant* result)
 {
     m_dumpChildFrameScrollPositions = true;
@@ -480,6 +487,7 @@ void LayoutTestController::reset()
     m_dumpEditingCallbacks = false;
     m_dumpFrameLoadCallbacks = false;
     m_dumpResourceLoadCallbacks = false;
+    m_dumpResourceResponseMIMETypes = false;
     m_dumpBackForwardList = false;
     m_dumpChildFrameScrollPositions = false;
     m_dumpChildFramesAsText = false;
diff --git a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h
index 55c8c8b..268bed5 100644
--- a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h
+++ b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h
@@ -96,6 +96,16 @@ public:
     // dump all frames as plain text if the dumpAsText flag is set.
     // It takes no arguments, and ignores any that may be present.
     void dumpChildFramesAsText(const CppArgumentList&, CppVariant*);
+    
+    // This function sets a flag that tells the test_shell to dump a descriptive
+    // line for each resource load callback. It takes no arguments, and ignores
+    // any that may be present.
+    void dumpResourceLoadCallbacks(const CppArgumentList&, CppVariant*);    
+    
+    // This function sets a flag that tells the test_shell to dump the MIME type
+    // for each resource that was loaded. It takes no arguments, and ignores any
+    // that may be present.
+    void dumpResourceResponseMIMETypes(const CppArgumentList&, CppVariant*);
 
     // This function sets a flag that tells the test_shell to dump all calls
     // to window.status().
@@ -226,7 +236,6 @@ public:
     // are needed to pass the layout tests.
     void dumpAsWebArchive(const CppArgumentList&, CppVariant*);
     void dumpTitleChanges(const CppArgumentList&, CppVariant*);
-    void dumpResourceLoadCallbacks(const CppArgumentList&, CppVariant*);
     void setMainFrameIsFirstResponder(const CppArgumentList&, CppVariant*);
     void display(const CppArgumentList&, CppVariant*);
     void testRepaint(const CppArgumentList&, CppVariant*);
@@ -323,6 +332,8 @@ public:
     bool shouldDumpFrameLoadCallbacks() { return m_dumpFrameLoadCallbacks; }
     void setShouldDumpFrameLoadCallbacks(bool value) { m_dumpFrameLoadCallbacks = value; }
     bool shouldDumpResourceLoadCallbacks() {return m_dumpResourceLoadCallbacks; }
+    void setShouldDumpResourceResponseMIMETypes(bool value) { m_dumpResourceResponseMIMETypes = value; }
+    bool shouldDumpResourceResponseMIMETypes() {return m_dumpResourceResponseMIMETypes; }
     bool shouldDumpStatusCallbacks() { return m_dumpWindowStatusChanges; }
     bool shouldDumpSelectionRect() { return m_dumpSelectionRect; }
     bool shouldDumpBackForwardList() { return m_dumpBackForwardList; }
@@ -442,6 +453,10 @@ private:
     // If true, the test_shell will output a descriptive line for each resource
     // load callback.
     bool m_dumpResourceLoadCallbacks;
+    
+    // If true, the test_shell will output the MIME type for each resource that 
+    // was loaded.
+    bool m_dumpResourceResponseMIMETypes;
 
     // If true, the test_shell will produce a dump of the back forward list as
     // well.
diff --git a/WebKitTools/DumpRenderTree/chromium/TestShell.h b/WebKitTools/DumpRenderTree/chromium/TestShell.h
index cb5f862..d3ed5fa 100644
--- a/WebKitTools/DumpRenderTree/chromium/TestShell.h
+++ b/WebKitTools/DumpRenderTree/chromium/TestShell.h
@@ -107,6 +107,7 @@ public:
     void setFocus(WebKit::WebWidget*, bool enable);
     bool shouldDumpFrameLoadCallbacks() const { return (m_testIsPreparing || m_testIsPending) && layoutTestController()->shouldDumpFrameLoadCallbacks(); }
     bool shouldDumpResourceLoadCallbacks() const  { return (m_testIsPreparing || m_testIsPending) && layoutTestController()->shouldDumpResourceLoadCallbacks(); }
+    bool shouldDumpResourceResponseMIMETypes() const  { return (m_testIsPreparing || m_testIsPending) && layoutTestController()->shouldDumpResourceResponseMIMETypes(); }
     void setIsLoading(bool flag) { m_isLoading = flag; }
 
     // Called by the LayoutTestController to signal test completion.
diff --git a/WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp b/WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp
index fae3f56..c994b8d 100644
--- a/WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp
+++ b/WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp
@@ -156,7 +156,7 @@ static string URLDescription(const GURL& url)
 static void printResponseDescription(const WebURLResponse& response)
 {
     if (response.isNull()) {
-        fputs("(null)", stdout);
+        puts("(null)");
         return;
     }
     string url = response.url().spec();
@@ -168,17 +168,17 @@ static void printResponseDescription(const WebURLResponse& response)
 static void printNodeDescription(const WebNode& node, int exception)
 {
     if (exception) {
-        fputs("ERROR", stdout);
+        puts("ERROR");
         return;
     }
     if (node.isNull()) {
-        fputs("(null)", stdout);
+        puts("(null)");
         return;
     }
-    fputs(node.nodeName().utf8().data(), stdout);
+    puts(node.nodeName().utf8().data());
     const WebNode& parent = node.parentNode();
     if (!parent.isNull()) {
-        fputs(" > ", stdout);
+        puts(" > ");
         printNodeDescription(parent, 0);
     }
 }
@@ -186,7 +186,7 @@ static void printNodeDescription(const WebNode& node, int exception)
 static void printRangeDescription(const WebRange& range)
 {
     if (range.isNull()) {
-        fputs("(null)", stdout);
+        puts("(null)");
         return;
     }
     printf("range from %d of ", range.startOffset());
@@ -277,9 +277,9 @@ void WebViewHost::didStopLoading()
 bool WebViewHost::shouldBeginEditing(const WebRange& range)
 {
     if (layoutTestController()->shouldDumpEditingCallbacks()) {
-        fputs("EDITING DELEGATE: shouldBeginEditingInDOMRange:", stdout);
+        puts("EDITING DELEGATE: shouldBeginEditingInDOMRange:");
         printRangeDescription(range);
-        fputs("\n", stdout);
+        puts("\n");
     }
     return layoutTestController()->acceptsEditing();
 }
@@ -287,9 +287,9 @@ bool WebViewHost::shouldBeginEditing(const WebRange& range)
 bool WebViewHost::shouldEndEditing(const WebRange& range)
 {
     if (layoutTestController()->shouldDumpEditingCallbacks()) {
-        fputs("EDITING DELEGATE: shouldEndEditingInDOMRange:", stdout);
+        puts("EDITING DELEGATE: shouldEndEditingInDOMRange:");
         printRangeDescription(range);
-        fputs("\n", stdout);
+        puts("\n");
     }
     return layoutTestController()->acceptsEditing();
 }
@@ -297,9 +297,9 @@ bool WebViewHost::shouldEndEditing(const WebRange& range)
 bool WebViewHost::shouldInsertNode(const WebNode& node, const WebRange& range, WebEditingAction action)
 {
     if (layoutTestController()->shouldDumpEditingCallbacks()) {
-        fputs("EDITING DELEGATE: shouldInsertNode:", stdout);
+        ("EDITING DELEGATE: shouldInsertNode:");
         printNodeDescription(node, 0);
-        fputs(" replacingDOMRange:", stdout);
+        puts(" replacingDOMRange:");
         printRangeDescription(range);
         printf(" givenAction:%s\n", editingActionDescription(action).c_str());
     }
@@ -320,9 +320,9 @@ bool WebViewHost::shouldChangeSelectedRange(
     const WebRange& fromRange, const WebRange& toRange, WebTextAffinity affinity, bool stillSelecting)
 {
     if (layoutTestController()->shouldDumpEditingCallbacks()) {
-        fputs("EDITING DELEGATE: shouldChangeSelectedDOMRange:", stdout);
+        puts("EDITING DELEGATE: shouldChangeSelectedDOMRange:");
         printRangeDescription(fromRange);
-        fputs(" toDOMRange:", stdout);
+        puts(" toDOMRange:");
         printRangeDescription(toRange);
         printf(" affinity:%s stillSelecting:%s\n",
                textAffinityDescription(affinity).c_str(),
@@ -334,9 +334,9 @@ bool WebViewHost::shouldChangeSelectedRange(
 bool WebViewHost::shouldDeleteRange(const WebRange& range)
 {
     if (layoutTestController()->shouldDumpEditingCallbacks()) {
-        fputs("EDITING DELEGATE: shouldDeleteDOMRange:", stdout);
+        puts("EDITING DELEGATE: shouldDeleteDOMRange:");
         printRangeDescription(range);
-        fputs("\n", stdout);
+        puts("\n");
     }
     return layoutTestController()->acceptsEditing();
 }
@@ -346,7 +346,7 @@ bool WebViewHost::shouldApplyStyle(const WebString& style, const WebRange& range
     if (layoutTestController()->shouldDumpEditingCallbacks()) {
         printf("EDITING DELEGATE: shouldApplyStyle:%s toElementsInDOMRange:", style.utf8().data());
         printRangeDescription(range);
-        fputs("\n", stdout);
+        puts("\n");
     }
     return layoutTestController()->acceptsEditing();
 }
@@ -365,13 +365,13 @@ void WebViewHost::didBeginEditing()
 {
     if (!layoutTestController()->shouldDumpEditingCallbacks())
         return;
-    fputs("EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification\n", stdout);
+    puts("EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification\n");
 }
 
 void WebViewHost::didChangeSelection(bool isEmptySelection)
 {
     if (layoutTestController()->shouldDumpEditingCallbacks())
-        fputs("EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification\n", stdout);
+        puts("EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification\n");
     // No need to update clipboard with the selected text in DRT.
 }
 
@@ -379,14 +379,14 @@ void WebViewHost::didChangeContents()
 {
     if (!layoutTestController()->shouldDumpEditingCallbacks())
         return;
-    fputs("EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification\n", stdout);
+    puts("EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification\n");
 }
 
 void WebViewHost::didEndEditing()
 {
     if (!layoutTestController()->shouldDumpEditingCallbacks())
         return;
-    fputs("EDITING DELEGATE: webViewDidEndEditing:WebViewDidEndEditingNotification\n", stdout);
+    puts("EDITING DELEGATE: webViewDidEndEditing:WebViewDidEndEditingNotification\n");
 }
 
 bool WebViewHost::handleCurrentKeyboardEvent()
@@ -661,10 +661,10 @@ WebNavigationPolicy WebViewHost::decidePolicyForNavigation(
     printf("Policy delegate: attempt to load %s with navigation type '%s'",
            URLDescription(request.url()).c_str(), webNavigationTypeToString(type));
     if (!originatingNode.isNull()) {
-        fputs(" originating from ", stdout);
+        puts(" originating from ");
         printNodeDescription(originatingNode, 0);
     }
-    fputs("\n", stdout);
+    puts("\n");
     if (m_policyDelegateIsPermissive)
         result = WebKit::WebNavigationPolicyCurrentTab;
     else
@@ -720,7 +720,7 @@ void WebViewHost::didCancelClientRedirect(WebFrame* frame)
     if (!m_shell->shouldDumpFrameLoadCallbacks())
         return;
     printFrameDescription(frame);
-    fputs(" - didCancelClientRedirectForFrame\n", stdout);
+    puts(" - didCancelClientRedirectForFrame\n");
 }
 
 void WebViewHost::didCreateDataSource(WebFrame*, WebDataSource* ds)
@@ -732,7 +732,7 @@ void WebViewHost::didStartProvisionalLoad(WebFrame* frame)
 {
     if (m_shell->shouldDumpFrameLoadCallbacks()) {
         printFrameDescription(frame);
-        fputs(" - didStartProvisionalLoadForFrame\n", stdout);
+        puts(" - didStartProvisionalLoadForFrame\n");
     }
 
     if (!m_topLoadingFrame)
@@ -740,7 +740,7 @@ void WebViewHost::didStartProvisionalLoad(WebFrame* frame)
 
     if (layoutTestController()->stopProvisionalFrameLoads()) {
         printFrameDescription(frame);
-        fputs(" - stopping load in didStartProvisionalLoadForFrame callback\n", stdout);
+        puts(" - stopping load in didStartProvisionalLoadForFrame callback\n");
         frame->stopLoading();
     }
     updateAddressBar(frame->view());
@@ -750,7 +750,7 @@ void WebViewHost::didReceiveServerRedirectForProvisionalLoad(WebFrame* frame)
 {
     if (m_shell->shouldDumpFrameLoadCallbacks()) {
         printFrameDescription(frame);
-        fputs(" - didReceiveServerRedirectForProvisionalLoadForFrame\n", stdout);
+        puts(" - didReceiveServerRedirectForProvisionalLoadForFrame\n");
     }
     updateAddressBar(frame->view());
 }
@@ -759,7 +759,7 @@ void WebViewHost::didFailProvisionalLoad(WebFrame* frame, const WebURLError& err
 {
     if (m_shell->shouldDumpFrameLoadCallbacks()) {
         printFrameDescription(frame);
-        fputs(" - didFailProvisionalLoadWithError\n", stdout);
+        puts(" - didFailProvisionalLoadWithError\n");
     }
 
     locationChangeDone(frame);
@@ -772,7 +772,7 @@ void WebViewHost::didCommitProvisionalLoad(WebFrame* frame, bool isNewNavigation
 {
     if (m_shell->shouldDumpFrameLoadCallbacks()) {
         printFrameDescription(frame);
-        fputs(" - didCommitLoadForFrame\n", stdout);
+        puts(" - didCommitLoadForFrame\n");
     }
     updateForCommittedLoad(frame, isNewNavigation);
 }
@@ -801,7 +801,7 @@ void WebViewHost::didFinishDocumentLoad(WebFrame* frame)
 {
     if (m_shell->shouldDumpFrameLoadCallbacks()) {
         printFrameDescription(frame);
-        fputs(" - didFinishDocumentLoadForFrame\n", stdout);
+        puts(" - didFinishDocumentLoadForFrame\n");
     } else {
         unsigned pendingUnloadEvents = frame->unloadListenerCount();
         if (pendingUnloadEvents) {
@@ -815,7 +815,7 @@ void WebViewHost::didHandleOnloadEvents(WebFrame* frame)
 {
     if (m_shell->shouldDumpFrameLoadCallbacks()) {
         printFrameDescription(frame);
-        fputs(" - didHandleOnloadEventsForFrame\n", stdout);
+        puts(" - didHandleOnloadEventsForFrame\n");
     }
 }
 
@@ -823,7 +823,7 @@ void WebViewHost::didFailLoad(WebFrame* frame, const WebURLError& error)
 {
     if (m_shell->shouldDumpFrameLoadCallbacks()) {
         printFrameDescription(frame);
-        fputs(" - didFailLoadWithError\n", stdout);
+        puts(" - didFailLoadWithError\n");
     }
     locationChangeDone(frame);
 }
@@ -832,7 +832,7 @@ void WebViewHost::didFinishLoad(WebFrame* frame)
 {
     if (m_shell->shouldDumpFrameLoadCallbacks()) {
         printFrameDescription(frame);
-        fputs(" - didFinishLoadForFrame\n", stdout);
+        puts(" - didFinishLoadForFrame\n");
     }
     updateAddressBar(frame->view());
     locationChangeDone(frame);
@@ -849,7 +849,7 @@ void WebViewHost::didChangeLocationWithinPage(WebFrame* frame)
 {
     if (m_shell->shouldDumpFrameLoadCallbacks()) {
         printFrameDescription(frame);
-        fputs(" - didChangeLocationWithinPageForFrame\n", stdout);
+        puts(" - didChangeLocationWithinPageForFrame\n");
     }
 }
 
@@ -875,11 +875,11 @@ void WebViewHost::willSendRequest(WebFrame*, unsigned identifier, WebURLRequest&
                URLDescription(mainDocumentURL).c_str(),
                request.httpMethod().utf8().data());
         printResponseDescription(redirectResponse);
-        fputs("\n", stdout);
+        puts("\n");
     }
 
     if (!redirectResponse.isNull() && m_blocksRedirects) {
-        fputs("Returning null for this redirect\n", stdout);
+        puts("Returning null for this redirect\n");
         // To block the request, we set its URL to an empty one.
         request.setURL(WebURL());
         return;
@@ -915,19 +915,27 @@ void WebViewHost::willSendRequest(WebFrame*, unsigned identifier, WebURLRequest&
 
 void WebViewHost::didReceiveResponse(WebFrame*, unsigned identifier, const WebURLResponse& response)
 {
-    if (!m_shell->shouldDumpResourceLoadCallbacks())
-        return;
-    printResourceDescription(identifier);
-    fputs(" - didReceiveResponse ", stdout);
-    printResponseDescription(response);
-    fputs("\n", stdout);
+    if (m_shell->shouldDumpResourceLoadCallbacks()) {
+        printResourceDescription(identifier);
+        puts(" - didReceiveResponse ");
+        printResponseDescription(response);
+        puts("\n");
+    }
+    if (m_shell->shouldDumpResourceResponseMIMETypes()) {
+        GURL url = response.url();
+        WebString mimeType = response.mimeType();
+        printf("%s has MIME type %s\n",
+            url.ExtractFileName().c_str(),
+            // Simulate NSURLResponse's mapping of empty/unknown MIME types to application/octet-stream
+            mimeType.isEmpty() ? "application/octet-stream" : mimeType.utf8().data());
+    }
 }
 
 void WebViewHost::didFinishResourceLoad(WebFrame*, unsigned identifier)
 {
     if (m_shell->shouldDumpResourceLoadCallbacks()) {
         printResourceDescription(identifier);
-        fputs(" - didFinishLoading\n", stdout);
+        puts(" - didFinishLoading\n");
     }
     m_resourceIdentifierMap.remove(identifier);
 }
@@ -936,9 +944,9 @@ void WebViewHost::didFailResourceLoad(WebFrame*, unsigned identifier, const WebU
 {
     if (m_shell->shouldDumpResourceLoadCallbacks()) {
         printResourceDescription(identifier);
-        fputs(" - didFailLoadingWithError: ", stdout);
-        fputs(webkit_support::MakeURLErrorDescription(error).c_str(), stdout);
-        fputs("\n", stdout);
+        puts(" - didFailLoadingWithError: ");
+        puts(webkit_support::MakeURLErrorDescription(error).c_str());
+        puts("\n");
     }
     m_resourceIdentifierMap.remove(identifier);
 }
@@ -946,13 +954,13 @@ void WebViewHost::didFailResourceLoad(WebFrame*, unsigned identifier, const WebU
 void WebViewHost::didDisplayInsecureContent(WebFrame*)
 {
     if (m_shell->shouldDumpFrameLoadCallbacks())
-        fputs("didDisplayInsecureContent\n", stdout);
+        puts("didDisplayInsecureContent\n");
 }
 
 void WebViewHost::didRunInsecureContent(WebFrame*, const WebSecurityOrigin& origin)
 {
     if (m_shell->shouldDumpFrameLoadCallbacks())
-        fputs("didRunInsecureContent\n", stdout);
+        puts("didRunInsecureContent\n");
 }
 
 bool WebViewHost::allowScript(WebFrame*, bool enabledPerSettings)
@@ -1200,14 +1208,14 @@ void WebViewHost::printFrameDescription(WebFrame* webframe)
     string name8 = webframe->name().utf8();
     if (webframe == webView()->mainFrame()) {
         if (!name8.length()) {
-            fputs("main frame", stdout);
+            puts("main frame");
             return;
         }
         printf("main frame \"%s\"", name8.c_str());
         return;
     }
     if (!name8.length()) {
-        fputs("frame (anonymous)", stdout);
+        puts("frame (anonymous)");
         return;
     }
     printf("frame \"%s\"", name8.c_str());

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list