Reviewed by Darin.
authorap <ap@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 19 Feb 2006 09:49:00 +0000 (09:49 +0000)
committerap <ap@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 19 Feb 2006 09:49:00 +0000 (09:49 +0000)
        - http://bugzilla.opendarwin.org/show_bug.cgi?id=7308
          DumpRenderTree should be able to load files via HTTP

        * DumpRenderTree/DumpRenderTree.m: (dumpRenderTree):
        Handle tests starting with "http://" as real URLs, not file system paths.

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

WebKitTools/ChangeLog
WebKitTools/DumpRenderTree/DumpRenderTree.m

index a6082576ef24fe1fadfe24b082a8dca7fdf0de7c..d6cef9d364421e472d3586e34a142971a15ccf42 100644 (file)
@@ -1,3 +1,13 @@
+2006-02-19  Alexey Proskuryakov  <ap@nypop.com>
+
+        Reviewed by Darin.
+
+        - http://bugzilla.opendarwin.org/show_bug.cgi?id=7308
+          DumpRenderTree should be able to load files via HTTP
+
+        * DumpRenderTree/DumpRenderTree.m: (dumpRenderTree):
+        Handle tests starting with "http://" as real URLs, not file system paths.
+
 2006-02-19  Alexey Proskuryakov  <ap@nypop.com>
 
         Reviewed by Maciej.
index dbe69aa859a84d0d99a55bdc11d6b3099a0033ec..020cacfa10d1361a4ed882e17ad93707a551add8 100644 (file)
@@ -94,7 +94,7 @@
 }
 @end
 
-static void dumpRenderTree(const char *filename);
+static void dumpRenderTree(const char *pathOrURL);
 static NSString *md5HashStringForBitmap(NSBitmapImageRep *bitmap);
 
 static volatile BOOL done;
@@ -732,18 +732,23 @@ static void dump(void)
 
 @end
 
-static void dumpRenderTree(const char *filename)
+static void dumpRenderTree(const char *pathOrURL)
 {
-    CFStringRef filenameString = CFStringCreateWithCString(NULL, filename, kCFStringEncodingUTF8);
-    if (!filenameString) {
+    CFStringRef pathOrURLString = CFStringCreateWithCString(NULL, pathOrURL, kCFStringEncodingUTF8);
+    if (!pathOrURLString) {
         fprintf(stderr, "can't parse filename as UTF-8\n");
         return;
     }
 
-    CFURLRef URL = CFURLCreateWithFileSystemPath(NULL, filenameString, kCFURLPOSIXPathStyle, FALSE);
+    CFURLRef URL;
+    if (CFStringHasPrefix(pathOrURLString, CFSTR("http://")))
+        URL = CFURLCreateWithString(NULL, pathOrURLString, NULL);
+    else
+        URL = CFURLCreateWithFileSystemPath(NULL, pathOrURLString, kCFURLPOSIXPathStyle, FALSE);
+    
     if (!URL) {
-        CFRelease(filenameString);
-        fprintf(stderr, "can't turn %s into a CFURL\n", filename);
+        CFRelease(pathOrURLString);
+        fprintf(stderr, "can't turn %s into a CFURL\n", pathOrURL);
         return;
     }
 
@@ -754,7 +759,7 @@ static void dumpRenderTree(const char *filename)
     dumpTitleChanges = NO;
     if (currentTest != nil)
         CFRelease(currentTest);
-    currentTest = (NSString *)filenameString;
+    currentTest = (NSString *)pathOrURLString;
 
     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
     [frame loadRequest:[NSURLRequest requestWithURL:(NSURL *)URL]];