2010-11-24 Mihai Parparita <mihaip@chromium.org>
authormihaip@chromium.org <mihaip@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 24 Nov 2010 19:45:50 +0000 (19:45 +0000)
committermihaip@chromium.org <mihaip@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 24 Nov 2010 19:45:50 +0000 (19:45 +0000)
        Reviewed by David Levin.

        DRT should not generate pixel output for text/plain tests
        https://bugs.webkit.org/show_bug.cgi?id=50002

        Modify Mac, Windows and GTK DRT implementations to disable pixel output
        when encountering a text/plain response (the Chromium one already does
        this, and none of the other ports special-case text/plain output in
        the first place).

        * DumpRenderTree/gtk/DumpRenderTree.cpp:
        (dump):
        * DumpRenderTree/mac/DumpRenderTree.mm:
        (dump):
        * DumpRenderTree/win/DumpRenderTree.cpp:
        (dump):

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

WebKitTools/ChangeLog
WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp
WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm
WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp

index 1412ee2..bafefa4 100644 (file)
@@ -1,3 +1,22 @@
+2010-11-24  Mihai Parparita  <mihaip@chromium.org>
+
+        Reviewed by David Levin.
+
+        DRT should not generate pixel output for text/plain tests
+        https://bugs.webkit.org/show_bug.cgi?id=50002
+        
+        Modify Mac, Windows and GTK DRT implementations to disable pixel output
+        when encountering a text/plain response (the Chromium one already does
+        this, and none of the other ports special-case text/plain output in
+        the first place).
+
+        * DumpRenderTree/gtk/DumpRenderTree.cpp:
+        (dump):
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (dump):
+        * DumpRenderTree/win/DumpRenderTree.cpp:
+        (dump):
+
 2010-11-24  Andras Becsi  <abecsi@inf.u-szeged.hu>
 
         Unreviewed.
index 182b717..a1fcbc8 100644 (file)
@@ -495,20 +495,16 @@ void dump()
 {
     invalidateAnyPreviousWaitToDumpWatchdog();
 
-    bool dumpAsText = gLayoutTestController->dumpAsText();
     if (dumpTree) {
         char* result = 0;
         gchar* responseMimeType = webkit_web_frame_get_response_mime_type(mainFrame);
 
-        dumpAsText = g_str_equal(responseMimeType, "text/plain");
+        if (g_str_equal(responseMimeType, "text/plain")) {
+            gLayoutTestController->setDumpAsText(true);        
+            gLayoutTestController->setGeneratePixelResults(false);
+        }
         g_free(responseMimeType);
 
-        // Test can request controller to be dumped as text even
-        // while test's response mime type is not text/plain.
-        // Overriding this behavior with dumpAsText being false is a bad idea.
-        if (dumpAsText)
-            gLayoutTestController->setDumpAsText(dumpAsText);
-
         if (gLayoutTestController->dumpAsText())
             result = dumpFramesAsText(mainFrame);
         else {
index 68b4c2b..c08aee5 100644 (file)
@@ -907,14 +907,15 @@ void dump()
 {
     invalidateAnyPreviousWaitToDumpWatchdog();
 
-    bool dumpAsText = gLayoutTestController->dumpAsText();
     if (dumpTree) {
         NSString *resultString = nil;
         NSData *resultData = nil;
         NSString *resultMimeType = @"text/plain";
 
-        dumpAsText |= [[[mainFrame dataSource] _responseMIMEType] isEqualToString:@"text/plain"];
-        gLayoutTestController->setDumpAsText(dumpAsText);
+        if ([[[mainFrame dataSource] _responseMIMEType] isEqualToString:@"text/plain"]) {
+            gLayoutTestController->setDumpAsText(true);
+            gLayoutTestController->setGeneratePixelResults(false);
+        }
         if (gLayoutTestController->dumpAsText()) {
             resultString = dumpFramesAsText(mainFrame);
         } else if (gLayoutTestController->dumpAsPDF()) {
index 3e6e191..a8028c5 100644 (file)
@@ -671,8 +671,10 @@ void dump()
         COMPtr<IWebURLResponse> response;
         if (SUCCEEDED(dataSource->response(&response)) && response) {
             BSTR mimeType;
-            if (SUCCEEDED(response->MIMEType(&mimeType)))
-                ::gLayoutTestController->setDumpAsText(::gLayoutTestController->dumpAsText() | !_tcscmp(mimeType, TEXT("text/plain")));
+            if (SUCCEEDED(response->MIMEType(&mimeType)) && !_tcscmp(mimeType, TEXT("text/plain"))) {
+                ::gLayoutTestController->setDumpAsText(true);
+                ::gLayoutTestController->setGeneratePixelResults(false);
+            }
             SysFreeString(mimeType);
         }
     }