Make the main frame's base path more explicit in _drt_descriptionSuitableForTestResult
authorbenjamin@webkit.org <benjamin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 Nov 2011 21:43:15 +0000 (21:43 +0000)
committerbenjamin@webkit.org <benjamin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 Nov 2011 21:43:15 +0000 (21:43 +0000)
https://bugs.webkit.org/show_bug.cgi?id=71351

Reviewed by Darin Adler.

Add the delimiter "/" at the end of the path instead of adding +1 when using
the path.

* DumpRenderTree/mac/ResourceLoadDelegate.mm:
(-[NSURL _drt_descriptionSuitableForTestResult]):

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

Tools/ChangeLog
Tools/DumpRenderTree/mac/ResourceLoadDelegate.mm

index 0b201a0c23b4c8f6c3dfb1aef59e923596d9cabd..c29dbd6e6aac6eb7e618962879ab7e850ae7f0a4 100644 (file)
@@ -1,3 +1,16 @@
+2011-11-02  Benjamin Poulain  <benjamin@webkit.org>
+
+        Make the main frame's base path more explicit in _drt_descriptionSuitableForTestResult
+        https://bugs.webkit.org/show_bug.cgi?id=71351
+
+        Reviewed by Darin Adler.
+
+        Add the delimiter "/" at the end of the path instead of adding +1 when using
+        the path.
+
+        * DumpRenderTree/mac/ResourceLoadDelegate.mm:
+        (-[NSURL _drt_descriptionSuitableForTestResult]):
+
 2011-11-02  Tom Sepez  <tsepez@chromium.org>
 
         XSSAuditor is silent
index 468a8ceabe670ef138faa82e41ddd70e0b7514e7..5e451f14d096e83888058d1c7e235082ed5ebd97 100644 (file)
@@ -82,11 +82,10 @@ using namespace std;
         dataSource = [mainFrame provisionalDataSource];
 
     NSString *basePath = [[[[dataSource request] URL] path] stringByDeletingLastPathComponent];
+    basePath = [basePath stringByAppendingString:@"/"];
 
-    if ([[self path] hasPrefix:basePath]) {
-        ASSERT([[self path] length] >= ([basePath length] + 1));
-        return [[self path] substringFromIndex:[basePath length] + 1];
-    }
+    if ([[self path] hasPrefix:basePath])
+        return [[self path] substringFromIndex:[basePath length]];
     return [self absoluteString];
 }