WebKitTools:
authorkmccullough@apple.com <kmccullough@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Dec 2007 02:07:18 +0000 (02:07 +0000)
committerkmccullough@apple.com <kmccullough@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Dec 2007 02:07:18 +0000 (02:07 +0000)
        Reviewed by Adam.

        - Layout tests fix.  We need a way to remove machine-dependent
        information from paths in layout test results. The UIDelegate now does
        this.

        * DumpRenderTree/DumpRenderTree.h:
        * DumpRenderTree/win/DumpRenderTree.cpp:
        (urlSuitableForTestResult):
        * DumpRenderTree/win/DumpRenderTreeWin.h:
        * DumpRenderTree/win/ResourceLoadDelegate.cpp:
        * DumpRenderTree/win/UIDelegate.cpp:
        (UIDelegate::webViewAddMessageToConsole):

LayoutTests:

        Reviewed by Adam.

        - Layout tests fix.  Removed machine dependant results and generated new
        results without machine specific information.

        * fast/dom/frame-loading-via-document-write-expected.txt: Added.
        * http/tests/security/frame-loading-via-document-write-expected.txt: Added.
        * http/tests/security/local-CSS-from-remote-expected.txt:
        * http/tests/security/local-JavaScript-from-remote-expected.txt:
        * http/tests/security/local-iFrame-from-remote-expected.txt:
        * http/tests/security/local-image-from-remote-expected.txt:
        * platform/mac/fast/dom/frame-loading-via-document-write-expected.checksum: Removed.
        * platform/mac/fast/dom/frame-loading-via-document-write-expected.png: Removed.
        * platform/mac/fast/dom/frame-loading-via-document-write-expected.txt: Removed.
        * platform/mac/http/tests/security: Removed.
        * platform/mac/http/tests/security/frame-loading-via-document-write-expected.checksum: Removed.
        * platform/mac/http/tests/security/frame-loading-via-document-write-expected.png: Removed.
        * platform/mac/http/tests/security/frame-loading-via-document-write-expected.txt: Removed.
        * platform/win/Skipped:
        * platform/win/http: Removed.
        * platform/win/http/tests: Removed.
        * platform/win/http/tests/security: Removed.
        * platform/win/http/tests/security/frame-loading-via-document-write-expected.txt: Removed.

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

19 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/dom/frame-loading-via-document-write-expected.txt [moved from LayoutTests/platform/mac/fast/dom/frame-loading-via-document-write-expected.txt with 100% similarity]
LayoutTests/http/tests/security/frame-loading-via-document-write-expected.txt [moved from LayoutTests/platform/win/http/tests/security/frame-loading-via-document-write-expected.txt with 59% similarity]
LayoutTests/http/tests/security/local-CSS-from-remote-expected.txt
LayoutTests/http/tests/security/local-JavaScript-from-remote-expected.txt
LayoutTests/http/tests/security/local-iFrame-from-remote-expected.txt
LayoutTests/http/tests/security/local-image-from-remote-expected.txt
LayoutTests/platform/mac/fast/dom/frame-loading-via-document-write-expected.checksum [deleted file]
LayoutTests/platform/mac/fast/dom/frame-loading-via-document-write-expected.png [deleted file]
LayoutTests/platform/mac/http/tests/security/frame-loading-via-document-write-expected.checksum [deleted file]
LayoutTests/platform/mac/http/tests/security/frame-loading-via-document-write-expected.png [deleted file]
LayoutTests/platform/mac/http/tests/security/frame-loading-via-document-write-expected.txt [deleted file]
LayoutTests/platform/win/Skipped
WebKitTools/ChangeLog
WebKitTools/DumpRenderTree/DumpRenderTree.h
WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp
WebKitTools/DumpRenderTree/win/DumpRenderTreeWin.h
WebKitTools/DumpRenderTree/win/ResourceLoadDelegate.cpp
WebKitTools/DumpRenderTree/win/UIDelegate.cpp

index eba3db2..0b36757 100644 (file)
@@ -1,3 +1,29 @@
+2007-12-13  Kevin McCullough  <kmccullough@apple.com>
+
+        Reviewed by Adam.
+
+        - Layout tests fix.  Removed machine dependant results and generated new
+        results without machine specific information.
+
+        * fast/dom/frame-loading-via-document-write-expected.txt: Added.
+        * http/tests/security/frame-loading-via-document-write-expected.txt: Added.
+        * http/tests/security/local-CSS-from-remote-expected.txt:
+        * http/tests/security/local-JavaScript-from-remote-expected.txt:
+        * http/tests/security/local-iFrame-from-remote-expected.txt:
+        * http/tests/security/local-image-from-remote-expected.txt:
+        * platform/mac/fast/dom/frame-loading-via-document-write-expected.checksum: Removed.
+        * platform/mac/fast/dom/frame-loading-via-document-write-expected.png: Removed.
+        * platform/mac/fast/dom/frame-loading-via-document-write-expected.txt: Removed.
+        * platform/mac/http/tests/security: Removed.
+        * platform/mac/http/tests/security/frame-loading-via-document-write-expected.checksum: Removed.
+        * platform/mac/http/tests/security/frame-loading-via-document-write-expected.png: Removed.
+        * platform/mac/http/tests/security/frame-loading-via-document-write-expected.txt: Removed.
+        * platform/win/Skipped:
+        * platform/win/http: Removed.
+        * platform/win/http/tests: Removed.
+        * platform/win/http/tests/security: Removed.
+        * platform/win/http/tests/security/frame-loading-via-document-write-expected.txt: Removed.
+
 2007-12-13  Alexey Proskuryakov  <ap@webkit.org>
 
         Reviewed by Adele.
@@ -1,4 +1,4 @@
-CONSOLE MESSAGE: line 0: Not allowed to load local resource: file://C:/cygwin/home/PyongHopscotch/WebKit/OpenSource/LayoutTests/fast/dom/resources/abe.png
+CONSOLE MESSAGE: line 0: Not allowed to load local resource: abe.png
 
 
 --------
index 938f135..3428fa4 100644 (file)
@@ -1,4 +1,4 @@
-CONSOLE MESSAGE: line 0: Not allowed to load local resource: file://C:/cygwin/home/PyongHopscotch/WebKit/OpenSource/LayoutTests/http/tests/security/resources/cssStyle.css
+CONSOLE MESSAGE: line 0: Not allowed to load local resource: cssStyle.css
 This test is to see if a remote file can include a local CSS style. 
 Currently this test cannot be run manually on Windows because we do not have a function like pathToLocalResource() outside of DRT. 
 
index bba963c..36c16f9 100644 (file)
@@ -1,4 +1,4 @@
-CONSOLE MESSAGE: line 0: Not allowed to load local resource: file://C:/cygwin/home/PyongHopscotch/WebKit/OpenSource/LayoutTests/http/tests/security/resources/localScript.js
+CONSOLE MESSAGE: line 0: Not allowed to load local resource: localScript.js
 This test is to see if a remote file can run a local script. 
 Currently this test cannot be run manually on Windows because we do not have a function like pathToLocalResource() outside of DRT. 
 
index 51443a2..577357a 100644 (file)
@@ -1,4 +1,4 @@
-CONSOLE MESSAGE: line 0: Not allowed to load local resource: file://C:/cygwin/home/PyongHopscotch/WebKit/OpenSource/LayoutTests/http/tests/security/resources/localPage.html
+CONSOLE MESSAGE: line 0: Not allowed to load local resource: localPage.html
 This test is to see if a remote file can include a local page in an iFrame. 
 Currently this test cannot be run manually on Windows because we do not have a function like pathToLocalResource() outside of DRT. 
 
index a9e88a5..70c75e2 100644 (file)
@@ -1,4 +1,4 @@
-CONSOLE MESSAGE: line 0: Not allowed to load local resource: file://C:/cygwin/home/PyongHopscotch/WebKit/OpenSource/LayoutTests/http/tests/security/resources/compass.jpg
+CONSOLE MESSAGE: line 0: Not allowed to load local resource: compass.jpg
 This test is to see if a remote file can include a local image. 
 Currently this test cannot be run manually on Windows because we do not have a function like pathToLocalResource() outside of DRT. 
 
diff --git a/LayoutTests/platform/mac/fast/dom/frame-loading-via-document-write-expected.checksum b/LayoutTests/platform/mac/fast/dom/frame-loading-via-document-write-expected.checksum
deleted file mode 100644 (file)
index b032a5f..0000000
+++ /dev/null
@@ -1 +0,0 @@
-d0cde9b945399195425306c086c31364
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/dom/frame-loading-via-document-write-expected.png b/LayoutTests/platform/mac/fast/dom/frame-loading-via-document-write-expected.png
deleted file mode 100644 (file)
index ef57dbb..0000000
Binary files a/LayoutTests/platform/mac/fast/dom/frame-loading-via-document-write-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/mac/http/tests/security/frame-loading-via-document-write-expected.checksum b/LayoutTests/platform/mac/http/tests/security/frame-loading-via-document-write-expected.checksum
deleted file mode 100644 (file)
index 6749c33..0000000
+++ /dev/null
@@ -1 +0,0 @@
-27e576b9e74a6968b20050557cababb5
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/http/tests/security/frame-loading-via-document-write-expected.png b/LayoutTests/platform/mac/http/tests/security/frame-loading-via-document-write-expected.png
deleted file mode 100644 (file)
index 3841d12..0000000
Binary files a/LayoutTests/platform/mac/http/tests/security/frame-loading-via-document-write-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/mac/http/tests/security/frame-loading-via-document-write-expected.txt b/LayoutTests/platform/mac/http/tests/security/frame-loading-via-document-write-expected.txt
deleted file mode 100644 (file)
index 857e0f3..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-CONSOLE MESSAGE: line 0: Not allowed to load local resource: file:////tmp/LayoutTests/fast/dom/resources/abe.png
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
-  RenderBlock {HTML} at (0,0) size 800x600
-    RenderFrameSet {FRAMESET} at (0,0) size 800x600
-      RenderFrame {FRAME} at (0,0) size 800x196
-        layer at (0,0) size 800x196
-          RenderView at (0,0) size 800x196
-        layer at (0,0) size 800x196
-          RenderBlock {HTML} at (0,0) size 800x196
-            RenderBody {BODY} at (8,8) size 784x180
-              RenderBlock {DIV} at (0,0) size 784x54
-                RenderInline {SPAN} at (0,0) size 221x18
-                  RenderText {#text} at (0,0) size 221x18
-                    text run at (0,0) width 221: "This page was successfully loaded."
-                  RenderBR {BR} at (221,14) size 0x0
-                RenderInline {SPAN} at (0,0) size 124x18
-                  RenderText {#text} at (0,18) size 124x18
-                    text run at (0,18) width 124: "My protocol is http:"
-                  RenderBR {BR} at (124,32) size 0x0
-                RenderInline {SPAN} at (0,0) size 125x18
-                  RenderText {#text} at (0,36) size 125x18
-                    text run at (0,36) width 125: "My referrer is blank"
-                  RenderBR {BR} at (125,50) size 0x0
-      RenderFrame {FRAME} at (0,202) size 800x196
-        layer at (0,0) size 800x196
-          RenderView at (0,0) size 800x196
-        layer at (0,0) size 800x58
-          RenderBlock {HTML} at (0,0) size 800x58
-            RenderBody {BODY} at (8,8) size 784x42
-              RenderTable {TABLE} at (0,0) size 133x42
-                RenderTableSection {TBODY} at (0,0) size 133x42
-                  RenderTableRow {TR} at (0,2) size 133x38
-                    RenderTableCell {TD} at (2,2) size 129x38 [r=0 c=0 rs=1 cs=1]
-                      RenderBlock {DIV} at (1,1) size 127x18
-                        RenderText {#text} at (0,0) size 127x18
-                          text run at (0,0) width 127: "Image NOT loaded."
-                      RenderBlock (anonymous) at (1,19) size 127x18
-                        RenderImage {IMG} at (0,14) size 0x0
-      RenderFrame {FRAME} at (0,404) size 800x196
-        layer at (0,0) size 800x196
-          RenderView at (0,0) size 800x196
-        layer at (0,0) size 800x64
-          RenderBlock {HTML} at (0,0) size 800x64
-            RenderBody {BODY} at (8,8) size 784x48
-              RenderTable {TABLE} at (0,0) size 95x48
-                RenderTableSection {TBODY} at (0,0) size 95x48
-                  RenderTableRow {TR} at (0,2) size 95x44
-                    RenderTableCell {TD} at (2,2) size 91x44 [r=0 c=0 rs=1 cs=1]
-                      RenderBlock {DIV} at (1,1) size 89x18
-                        RenderText {#text} at (0,0) size 89x18
-                          text run at (0,0) width 89: "Image loaded."
-                      RenderBlock (anonymous) at (1,19) size 89x24
-                        RenderImage {IMG} at (0,0) size 20x20
index 8cdc3f2..556904e 100644 (file)
 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #
 
-# Access violation when trying to run local script. <rdar://5631705>
-fast/dom/frame-loading-via-document-write.html
-fast/loader/local-iFrame-source-from-local.html
-fast/loader/local-image-from-local.html
-fast/loader/local-CSS-from-local.html
-fast/loader/local-JavaScript-from-local.html
-http/tests/security/local-JavaScript-from-remote.html
-http/tests/security/local-iFrame-from-remote.html
-http/tests/security/local-CSS-from-remote.html
-http/tests/security/local-user-CSS-from-remote.html
-http/tests/security/frame-loading-via-document-write.html
-http/tests/security/local-image-from-remote.html
-
 # Should be moved to platform/mac <rdar://5621425>
 http/tests/misc/willCacheResponse-delegate-callback.html
 
index f814b92..01cd303 100644 (file)
@@ -1,3 +1,19 @@
+2007-12-13  Kevin McCullough  <kmccullough@apple.com>
+
+        Reviewed by Adam.
+
+        - Layout tests fix.  We need a way to remove machine-dependent
+        information from paths in layout test results. The UIDelegate now does
+        this.
+
+        * DumpRenderTree/DumpRenderTree.h:
+        * DumpRenderTree/win/DumpRenderTree.cpp:
+        (urlSuitableForTestResult):
+        * DumpRenderTree/win/DumpRenderTreeWin.h:
+        * DumpRenderTree/win/ResourceLoadDelegate.cpp:
+        * DumpRenderTree/win/UIDelegate.cpp:
+        (UIDelegate::webViewAddMessageToConsole):
+
 2007-12-13  Alp Toker  <alp@atoker.com>
 
         Build fix for DRT breakage introduced in r28690.
index 174da27..e74d4bc 100644 (file)
 extern CFRunLoopTimerRef waitToDumpWatchdog;
 #endif
 
+#include <string>
+
+std::wstring urlSuitableForTestResult(const std::wstring& url);
+
 class LayoutTestController;
 
 extern volatile bool done;
index 5f36c01..a8d33d2 100644 (file)
@@ -57,6 +57,7 @@
 #include <io.h>
 #include <windows.h>
 #include <stdio.h>
+#include <shlwapi.h>
 
 using std::wstring;
 
@@ -103,6 +104,14 @@ static const unsigned timeoutId = 10;
 const unsigned maxViewWidth = 800;
 const unsigned maxViewHeight = 600;
 
+wstring urlSuitableForTestResult(const wstring& url)
+{
+    if (!url.c_str() || !url.find(L"file://"))
+        return url;
+
+    return PathFindFileNameW(url.c_str());
+}
+
 static LRESULT CALLBACK DumpRenderTreeWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
 {
     switch (msg) {
index e9149ae..37df978 100644 (file)
@@ -58,4 +58,8 @@ extern IWebPolicyDelegate* policyDelegate;
 
 extern HWND webViewWindow;
 
+#include <string>
+
+std::wstring urlSuitableForTestResult(const std::wstring& url);
+
 #endif // DumpRenderTreeWin_h
index 688f033..0f15648 100644 (file)
@@ -32,7 +32,6 @@
 #include "LayoutTestController.h"
 #include <wtf/HashMap.h>
 #include <wtf/Vector.h>
-#include <string>
 #include <sstream>
 
 using std::wstring;
@@ -43,14 +42,6 @@ static inline wstring wstringFromBSTR(BSTR str)
     return wstring(str, ::SysStringLen(str));
 }
 
-static wstring urlSuitableForTestResult(const wstring& url)
-{
-    // FIXME: This should convert file:/// URLs like the Mac version does.
-    // It's currently not done because the only tests that use file:/// URLs 
-    // are the webarchive tests and we don't support those on Windows.
-    return url;
-}
-
 wstring wstringFromInt(int i)
 {
     std::wostringstream ss;
index 2b00d4d..6f070c4 100755 (executable)
@@ -40,6 +40,8 @@
 #include <WebKit/IWebViewPrivate.h>
 #include <stdio.h>
 
+using std::wstring;
+
 UIDelegate::UIDelegate()
     : m_refCount(1)
 {
@@ -151,8 +153,15 @@ HRESULT STDMETHODCALLTYPE UIDelegate::webViewAddMessageToConsole(
     /* [in] */ BSTR url,
     /* [in] */ BOOL isError)
 {
-    printf("CONSOLE MESSAGE: line %d: %S\n", lineNumber, message ? message : L"");
-
+    wstring newMessage;
+    if (message) {
+        newMessage = message;
+        int fileProtocol = newMessage.find(L"file://");
+        if (fileProtocol)
+            newMessage = newMessage.substr(0, fileProtocol) + urlSuitableForTestResult(newMessage);
+    }
+
+    printf("CONSOLE MESSAGE: line %d: %S\n", lineNumber, message ? newMessage.c_str() : L"");
     return S_OK;
 }