2010-09-09 Mihai Parparita <mihaip@chromium.org>
authortony@chromium.org <tony@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Sep 2010 21:48:20 +0000 (21:48 +0000)
committertony@chromium.org <tony@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Sep 2010 21:48:20 +0000 (21:48 +0000)
        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@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: https://svn.webkit.org/repository/webkit/trunk@67119 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/platform/chromium-linux/fast/dom/HTMLLinkElement/prefetch-expected.txt [deleted file]
LayoutTests/platform/chromium-mac/fast/dom/HTMLLinkElement/prefetch-expected.txt [deleted file]
LayoutTests/platform/chromium/test_expectations.txt
WebKitTools/ChangeLog
WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp
WebKitTools/DumpRenderTree/chromium/LayoutTestController.h
WebKitTools/DumpRenderTree/chromium/TestShell.h
WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp

index 511b32cc4f843a086375b3dc25a06dd9ff64db89..14b087e5ab08c0fe1cebc3a5cea368bad4e12fc8 100644 (file)
@@ -1,3 +1,16 @@
+2010-09-09  Mihai Parparita  <mihaip@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@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 (file)
index a3468f1..0000000
+++ /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 (file)
index a3468f1..0000000
+++ /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.
index bd8c086a7e9966267ad206caa63fbd4c01fe9028..8cc4e091c4e6bffb4713288817f6b157b6205f06 100644 (file)
@@ -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
index f680eb21ea7b57701cfd057c17dc7567a28eaba8..1807a838c1a39f7b97f4e184509935cc548d7e37 100644 (file)
@@ -1,3 +1,25 @@
+2010-09-09  Mihai Parparita  <mihaip@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@chromium.org>
 
         Reviewed by Daniel Bates.
index 8e08c4cf9e54ca5dc280620997440cb9f7673ebf..f896241fb4f272064f0e6b7f787f9922ded857ea 100644 (file)
@@ -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;
index 55c8c8bb238264c023ed692b44d4ab99e4f5c60e..268bed551547cf2096ac346e146ad5685230e8c3 100644 (file)
@@ -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.
index cb5f862f906c804f746b5b4ab0504b14dc8e4af3..d3ed5fa6aae57ea95f04bc09f063cea0572b5573 100644 (file)
@@ -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.
index fae3f56220342252517e5fcefc65f9a173c28f9e..c994b8d3f8497591d94f30171cc0aaf985c28c9b 100644 (file)
@@ -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());