WebKitTools:

2009-07-07  Brady Eidson  <beidson@apple.com>

        Reviewed by Mark Rowe.

        https://bugs.webkit.org/show_bug.cgi?id=27049 - In dumpBackForwardList() mode, DRT should normalize file urls.

        Make the dump of a history item agnostic to the layout of filesystem on the testing machine.

        * DumpRenderTree/mac/DumpRenderTree.mm:
        (dumpHistoryItem):
        * DumpRenderTree/win/DumpRenderTree.cpp:
        (dumpHistoryItem):

LayoutTests:

2009-07-07  Brady Eidson  <beidson@apple.com>

        Reviewed by Mark Rowe.

        https://bugs.webkit.org/show_bug.cgi?id=27049 - In dumpBackForwardList() mode, DRT should normalize file urls.

        * fast/loader/subframe-navigate-during-main-frame-load-expected.txt: Make the results agnostic to the layout of 
          filesystem on the testing machine.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@45615 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 73b7380..145e23a7 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,12 @@
+2009-07-07  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Mark Rowe.
+
+        https://bugs.webkit.org/show_bug.cgi?id=27049 - In dumpBackForwardList() mode, DRT should normalize file urls.
+
+        * fast/loader/subframe-navigate-during-main-frame-load-expected.txt: Make the results agnostic to the layout of 
+          filesystem on the testing machine.
+
 2009-07-07  Simon Fraser  <simon.fraser@apple.com>
 
         Reviewed by Dan Bernstein.
diff --git a/LayoutTests/fast/loader/subframe-navigate-during-main-frame-load-expected.txt b/LayoutTests/fast/loader/subframe-navigate-during-main-frame-load-expected.txt
index 08c6cd5d0..a682eb0 100644
--- a/LayoutTests/fast/loader/subframe-navigate-during-main-frame-load-expected.txt
+++ b/LayoutTests/fast/loader/subframe-navigate-during-main-frame-load-expected.txt
@@ -4,7 +4,7 @@
 
 
 ============== Back Forward List ==============
-        file:///Volumes/Data/svn/OpenSource/LayoutTests/fast/loader/subframe-navigate-during-main-frame-load.html  **nav target**
-curr->  file:///Volumes/Data/svn/OpenSource/LayoutTests/fast/loader/resources/subframe-navigate-during-main-frame-load2.html  **nav target**
+        (file test):fast/loader/subframe-navigate-during-main-frame-load.html  **nav target**
+curr->  (file test):fast/loader/resources/subframe-navigate-during-main-frame-load2.html  **nav target**
             data:text/html,%3Cbody%20onload=%22layoutTestController.notifyDone();%22%3E%3C/body%3E (in frame "subframe")
 ===============================================
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 50c978b..400da0c 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,16 @@
+2009-07-07  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Mark Rowe.
+
+        https://bugs.webkit.org/show_bug.cgi?id=27049 - In dumpBackForwardList() mode, DRT should normalize file urls.
+
+        Make the dump of a history item agnostic to the layout of filesystem on the testing machine.
+
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (dumpHistoryItem):
+        * DumpRenderTree/win/DumpRenderTree.cpp:
+        (dumpHistoryItem):
+
 2009-07-07  Simon Hausmann  <hausmann@webkit.org>
 
         Reviewed by Holger Freyther.
diff --git a/WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm b/WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm
index 22491ae..62d8639 100644
--- a/WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm
+++ b/WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm
@@ -615,7 +615,18 @@
     }
     for (int i = start; i < indent; i++)
         putchar(' ');
-    printf("%s", [[item URLString] UTF8String]);
+    
+    NSString *urlString = [item URLString];
+    if ([[NSURL URLWithString:urlString] isFileURL]) {
+        NSRange range = [urlString rangeOfString:@"/LayoutTests/"];
+
+        range.length = range.length + range.location;
+        range.location = 0;
+        
+        urlString = [urlString stringByReplacingCharactersInRange:range withString:@"(file test):"];
+    }
+    
+    printf("%s", [urlString UTF8String]);
     NSString *target = [item target];
     if (target && [target length] > 0)
         printf(" (in frame \"%s\")", [target UTF8String]);
diff --git a/WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp b/WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp
index 4212a99..66266b9 100644
--- a/WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp
+++ b/WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp
@@ -406,6 +406,24 @@
     BSTR url;
     if (FAILED(item->URLString(&url)))
         return;
+
+    if (wcsstr(url, L"file:/") == url) {
+        static wchar_t* layoutTestsString = L"/LayoutTests/";
+        static wchar_t* fileTestString = L"(file test):";
+        
+        wchar_t* result = wcsstr(url, layoutTestsString);
+        if (result == NULL)
+            return;
+        wchar_t* start = result + wcslen(layoutTestsString);
+
+        BSTR newURL = SysAllocStringLen(NULL, SysStringLen(url));
+        wcscpy(newURL, fileTestString);
+        wcscpy(newURL + wcslen(fileTestString), start);
+
+        SysFreeString(url);
+        url = newURL;
+    }
+
     printf("%S", url ? url : L"");
     SysFreeString(url);