Print warning to stdout rather than stderr when a test attempts to access a remote...
authormrowe@apple.com <mrowe@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 18 Sep 2008 07:48:12 +0000 (07:48 +0000)
committermrowe@apple.com <mrowe@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 18 Sep 2008 07:48:12 +0000 (07:48 +0000)
This should make it more obvious when a test does this, as stderr output tends to be obscured
by noise in the test results.

Also fixes some coding style issues in ResourceLoadDelegate.mm.

Rubber-stamped by Sam Weinig.

* DumpRenderTree/mac/ResourceLoadDelegate.mm:
(-[NSError _drt_descriptionSuitableForTestResult]):
(-[NSURL _drt_descriptionSuitableForTestResult]):
(-[ResourceLoadDelegate webView:identifierForInitialRequest:fromDataSource:]):
(-[ResourceLoadDelegate webView:resource:willSendRequest:redirectResponse:fromDataSource:]):
(-[ResourceLoadDelegate webView:resource:didReceiveResponse:fromDataSource:]):
(-[ResourceLoadDelegate webView:resource:didFinishLoadingFromDataSource:]):
(-[ResourceLoadDelegate webView:resource:didFailLoadingWithError:fromDataSource:]):
(-[ResourceLoadDelegate webView:resource:willCacheResponse:fromDataSource:]):

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

WebKitTools/ChangeLog
WebKitTools/DumpRenderTree/mac/ResourceLoadDelegate.mm

index 27d62aa..5acadbd 100644 (file)
@@ -1,3 +1,23 @@
+2008-09-18  Mark Rowe  <mrowe@apple.com>
+
+        Rubber-stamped by Sam Weinig.
+
+        Print warning to stdout rather than stderr when a test attempts to access a remote resource.
+        This should make it more obvious when a test does this, as stderr output tends to be obscured
+        by noise in the test results.
+
+        Also fixes some coding style issues in ResourceLoadDelegate.mm.
+
+        * DumpRenderTree/mac/ResourceLoadDelegate.mm:
+        (-[NSError _drt_descriptionSuitableForTestResult]):
+        (-[NSURL _drt_descriptionSuitableForTestResult]):
+        (-[ResourceLoadDelegate webView:identifierForInitialRequest:fromDataSource:]):
+        (-[ResourceLoadDelegate webView:resource:willSendRequest:redirectResponse:fromDataSource:]):
+        (-[ResourceLoadDelegate webView:resource:didReceiveResponse:fromDataSource:]):
+        (-[ResourceLoadDelegate webView:resource:didFinishLoadingFromDataSource:]):
+        (-[ResourceLoadDelegate webView:resource:didFailLoadingWithError:fromDataSource:]):
+        (-[ResourceLoadDelegate webView:resource:willCacheResponse:fromDataSource:]):
+
 2008-09-18  Stephanie Lewis  <slewis@apple.com>
 
         Reviewed by Mark Rowe and Maciej Stachowiak..
index 3c2dec1..5d2e2b4 100644 (file)
 {
     NSString *str = [NSString stringWithFormat:@"<NSError domain %@, code %d", [self domain], [self code]];
     NSURL *failingURL;
-    
+
     if ((failingURL = [[self userInfo] objectForKey:@"NSErrorFailingURLKey"]))
         str = [str stringByAppendingFormat:@", failing URL \"%@\"", [failingURL _drt_descriptionSuitableForTestResult]];
-        
+
     str = [str stringByAppendingFormat:@">"];
-    
+
     return str;
 }
 
@@ -76,9 +76,9 @@
     WebDataSource *dataSource = [mainFrame dataSource];
     if (!dataSource)
         dataSource = [mainFrame provisionalDataSource];
-    
+
     NSString *basePath = [[[[dataSource request] URL] path] stringByDeletingLastPathComponent];
-    
+
     return [[self path] substringFromIndex:[basePath length] + 1];
 }
 
 - webView: (WebView *)wv identifierForInitialRequest: (NSURLRequest *)request fromDataSource: (WebDataSource *)dataSource
 {
     ASSERT([[dataSource webFrame] dataSource] || [[dataSource webFrame] provisionalDataSource]);
-    
+
     if (!done && gLayoutTestController->dumpResourceLoadCallbacks())
         return [[request URL] _drt_descriptionSuitableForTestResult];
-    
+
     return @"<unknown>";
 }
 
         NSString *string = [NSString stringWithFormat:@"%@ - willSendRequest %@ redirectResponse %@", identifier, [newRequest _drt_descriptionSuitableForTestResult],
             [redirectResponse _drt_descriptionSuitableForTestResult]];
         printf("%s\n", [string UTF8String]);
-    }    
+    }
 
     NSURL *url = [newRequest URL];
     NSString *host = [url host];
         && NSOrderedSame != [host compare:@"127.0.0.1"]
         && NSOrderedSame != [host compare:@"255.255.255.255"] // used in some tests that expect to get back an error
         && NSOrderedSame != [host caseInsensitiveCompare:@"localhost"]) {
-        fprintf(stderr, "Blocked access to external URL %s\n", [[url absoluteString] cStringUsingEncoding:NSUTF8StringEncoding]);
+        printf("Blocked access to external URL %s\n", [[url absoluteString] cStringUsingEncoding:NSUTF8StringEncoding]);
         return nil;
     }
 
     if (disallowedURLs && CFSetContainsValue(disallowedURLs, url))
         return nil;
-    
+
     return newRequest;
 }
 
 {
     if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) {
         NSString *string = [NSString stringWithFormat:@"%@ - didReceiveResponse %@", identifier, [response _drt_descriptionSuitableForTestResult]];
-        printf ("%s\n", [string UTF8String]);
-    }    
+        printf("%s\n", [string UTF8String]);
+    }
 }
 
 -(void)webView: (WebView *)wv resource:identifier didReceiveContentLength: (NSInteger)length fromDataSource:(WebDataSource *)dataSource
 {
     if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) {
         NSString *string = [NSString stringWithFormat:@"%@ - didFinishLoading", identifier];
-        printf ("%s\n", [string UTF8String]);
+        printf("%s\n", [string UTF8String]);
     }
 }
 
 {
     if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) {
         NSString *string = [NSString stringWithFormat:@"%@ - didFailLoadingWithError: %@", identifier, [error _drt_descriptionSuitableForTestResult]];
-        printf ("%s\n", [string UTF8String]);
+        printf("%s\n", [string UTF8String]);
     }
 }
 
 {
     if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) {
         NSString *string = [NSString stringWithFormat:@"%@ - willCacheResponse: called", identifier];
-        printf ("%s\n", [string UTF8String]);
+        printf("%s\n", [string UTF8String]);
     }
     return response;
 }