WebKitTools:
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Apr 2008 17:29:32 +0000 (17:29 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Apr 2008 17:29:32 +0000 (17:29 +0000)
2008-04-08  Brady Eidson  <beidson@apple.com>

        Reviewed by Mitzpettel

        Fixed http://bugs.webkit.org/show_bug.cgi?id=18302
        -WebArchive subresources dump in random order, intermittent failures

        * DumpRenderTree/mac/DumpRenderTree.mm:
        (compareResourceURLs): Sorting function based on the resource URLs
        (serializeWebArchiveToXML): Sort the subresource array

LayoutTests:

2008-04-08  Brady Eidson  <beidson@apple.com>

        Reviewed by Mitzpettel

        Fixed http://bugs.webkit.org/show_bug.cgi?id=18302
        -WebArchive subresources dump in random order, intermittent failures

        Now that a DRT fix has set the order, these 3 tests needed new results

        * webarchive/test-css-import-expected.txt:
        * webarchive/test-duplicate-resources-expected.txt:
        * webarchive/test-frameset-expected.txt:

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

LayoutTests/ChangeLog
LayoutTests/webarchive/test-css-import-expected.txt
LayoutTests/webarchive/test-duplicate-resources-expected.txt
LayoutTests/webarchive/test-frameset-expected.txt
WebKitTools/ChangeLog
WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm

index 2a7519e..18ec2a8 100644 (file)
@@ -1,3 +1,16 @@
+2008-04-08  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Mitzpettel
+
+        Fixed http://bugs.webkit.org/show_bug.cgi?id=18302
+        -WebArchive subresources dump in random order, intermittent failures
+
+        Now that a DRT fix has set the order, these 3 tests needed new results
+
+        * webarchive/test-css-import-expected.txt:
+        * webarchive/test-duplicate-resources-expected.txt:
+        * webarchive/test-frameset-expected.txt:
+
 2008-04-07  Brady Eidson  <beidson@apple.com>
 
         Rubberstamped by Geoff Garen
index 03fafd4..0509fa2 100644 (file)
@@ -35,8 +35,8 @@
        <array>
                <dict>
                        <key>WebResourceData</key>
-                       <string>@import url('test-css-link-recurse.css');
-.red { color: red; }
+                       <string>@import url('test-css-import.css');
+.green { color: green; }
 </string>
                        <key>WebResourceMIMEType</key>
                        <string>text/css</string>
                                <key>MIMEType</key>
                                <string>text/css</string>
                                <key>URL</key>
-                               <string>file:///LayoutTests/webarchive/resources/test-css-link.css</string>
+                               <string>file:///LayoutTests/webarchive/resources/test-css-import-recurse.css</string>
                                <key>expectedContentLength</key>
-                               <integer>63</integer>
+                               <integer>61</integer>
                        </dict>
                        <key>WebResourceURL</key>
-                       <string>file:///LayoutTests/webarchive/resources/test-css-link.css</string>
+                       <string>file:///LayoutTests/webarchive/resources/test-css-import-recurse.css</string>
                </dict>
                <dict>
                        <key>WebResourceData</key>
-                       <string>@import url('test-css-link-recurse.css');
-.purple { color: purple; }
+                       <string>@import url('test-css-import-recurse.css');
+.blue { color: blue; }
 </string>
                        <key>WebResourceMIMEType</key>
                        <string>text/css</string>
                                <key>MIMEType</key>
                                <string>text/css</string>
                                <key>URL</key>
-                               <string>file:///LayoutTests/webarchive/resources/test-css-link-recurse.css</string>
+                               <string>file:///LayoutTests/webarchive/resources/test-css-import.css</string>
                                <key>expectedContentLength</key>
-                               <integer>69</integer>
+                               <integer>67</integer>
                        </dict>
                        <key>WebResourceURL</key>
-                       <string>file:///LayoutTests/webarchive/resources/test-css-link-recurse.css</string>
+                       <string>file:///LayoutTests/webarchive/resources/test-css-import.css</string>
                </dict>
                <dict>
                        <key>WebResourceData</key>
-                       <string>@import url('test-css-import.css');
-.green { color: green; }
+                       <string>@import url('test-css-link-recurse.css');
+.purple { color: purple; }
 </string>
                        <key>WebResourceMIMEType</key>
                        <string>text/css</string>
                                <key>MIMEType</key>
                                <string>text/css</string>
                                <key>URL</key>
-                               <string>file:///LayoutTests/webarchive/resources/test-css-import-recurse.css</string>
+                               <string>file:///LayoutTests/webarchive/resources/test-css-link-recurse.css</string>
                                <key>expectedContentLength</key>
-                               <integer>61</integer>
+                               <integer>69</integer>
                        </dict>
                        <key>WebResourceURL</key>
-                       <string>file:///LayoutTests/webarchive/resources/test-css-import-recurse.css</string>
+                       <string>file:///LayoutTests/webarchive/resources/test-css-link-recurse.css</string>
                </dict>
                <dict>
                        <key>WebResourceData</key>
-                       <string>@import url('test-css-import-recurse.css');
-.blue { color: blue; }
+                       <string>@import url('test-css-link-recurse.css');
+.red { color: red; }
 </string>
                        <key>WebResourceMIMEType</key>
                        <string>text/css</string>
                                <key>MIMEType</key>
                                <string>text/css</string>
                                <key>URL</key>
-                               <string>file:///LayoutTests/webarchive/resources/test-css-import.css</string>
+                               <string>file:///LayoutTests/webarchive/resources/test-css-link.css</string>
                                <key>expectedContentLength</key>
-                               <integer>67</integer>
+                               <integer>63</integer>
                        </dict>
                        <key>WebResourceURL</key>
-                       <string>file:///LayoutTests/webarchive/resources/test-css-import.css</string>
+                       <string>file:///LayoutTests/webarchive/resources/test-css-link.css</string>
                </dict>
        </array>
 </dict>
index dc00022..103785a 100644 (file)
                        <array>
                                <dict>
                                        <key>WebResourceData</key>
-                                       <string>div { font-family: Arial, Helvetica, sans-serif; color: red; }
-</string>
-                                       <key>WebResourceMIMEType</key>
-                                       <string>text/css</string>
-                                       <key>WebResourceResponse</key>
-                                       <dict>
-                                               <key>MIMEType</key>
-                                               <string>text/css</string>
-                                               <key>URL</key>
-                                               <string>file:///LayoutTests/webarchive/resources/test-style.css</string>
-                                               <key>expectedContentLength</key>
-                                               <integer>63</integer>
-                                       </dict>
-                                       <key>WebResourceURL</key>
-                                       <string>file:///LayoutTests/webarchive/resources/test-style.css</string>
-                               </dict>
-                               <dict>
-                                       <key>WebResourceData</key>
                                        <data>
                                        R0lGODlhNABAAMQfAGJiYvLz9ImKitvb2/39
                                        /cnJyaSkpOPj49TU1MHBwbW1terq7Lu7u/X1
                                        <key>WebResourceURL</key>
                                        <string>file:///LayoutTests/webarchive/resources/apple.gif</string>
                                </dict>
+                               <dict>
+                                       <key>WebResourceData</key>
+                                       <string>div { font-family: Arial, Helvetica, sans-serif; color: red; }
+</string>
+                                       <key>WebResourceMIMEType</key>
+                                       <string>text/css</string>
+                                       <key>WebResourceResponse</key>
+                                       <dict>
+                                               <key>MIMEType</key>
+                                               <string>text/css</string>
+                                               <key>URL</key>
+                                               <string>file:///LayoutTests/webarchive/resources/test-style.css</string>
+                                               <key>expectedContentLength</key>
+                                               <integer>63</integer>
+                                       </dict>
+                                       <key>WebResourceURL</key>
+                                       <string>file:///LayoutTests/webarchive/resources/test-style.css</string>
+                               </dict>
                        </array>
                </dict>
        </array>
        <array>
                <dict>
                        <key>WebResourceData</key>
-                       <string>if (window.layoutTestController)
-    layoutTestController.dumpDOMAsWebArchive();
-</string>
-                       <key>WebResourceMIMEType</key>
-                       <string>text/javascript</string>
-                       <key>WebResourceResponse</key>
-                       <dict>
-                               <key>MIMEType</key>
-                               <string>text/javascript</string>
-                               <key>URL</key>
-                               <string>file:///LayoutTests/webarchive/resources/dump-webarchive.js</string>
-                               <key>expectedContentLength</key>
-                               <integer>81</integer>
-                       </dict>
-                       <key>WebResourceURL</key>
-                       <string>file:///LayoutTests/webarchive/resources/dump-webarchive.js</string>
-               </dict>
-               <dict>
-                       <key>WebResourceData</key>
-                       <string>div { font-family: Arial, Helvetica, sans-serif; color: red; }
-</string>
-                       <key>WebResourceMIMEType</key>
-                       <string>text/css</string>
-                       <key>WebResourceResponse</key>
-                       <dict>
-                               <key>MIMEType</key>
-                               <string>text/css</string>
-                               <key>URL</key>
-                               <string>file:///LayoutTests/webarchive/resources/test-style.css</string>
-                               <key>expectedContentLength</key>
-                               <integer>63</integer>
-                       </dict>
-                       <key>WebResourceURL</key>
-                       <string>file:///LayoutTests/webarchive/resources/test-style.css</string>
-               </dict>
-               <dict>
-                       <key>WebResourceData</key>
                        <data>
                        R0lGODlhNABAAMQfAGJiYvLz9ImKitvb2/39/cnJyaSkpOPj49TU
                        1MHBwbW1terq7Lu7u/X19uXm5+3u7+fo6eDg4e/w8t7e3/n5+RcX
                        <key>WebResourceURL</key>
                        <string>file:///LayoutTests/webarchive/resources/apple.gif</string>
                </dict>
+               <dict>
+                       <key>WebResourceData</key>
+                       <string>if (window.layoutTestController)
+    layoutTestController.dumpDOMAsWebArchive();
+</string>
+                       <key>WebResourceMIMEType</key>
+                       <string>text/javascript</string>
+                       <key>WebResourceResponse</key>
+                       <dict>
+                               <key>MIMEType</key>
+                               <string>text/javascript</string>
+                               <key>URL</key>
+                               <string>file:///LayoutTests/webarchive/resources/dump-webarchive.js</string>
+                               <key>expectedContentLength</key>
+                               <integer>81</integer>
+                       </dict>
+                       <key>WebResourceURL</key>
+                       <string>file:///LayoutTests/webarchive/resources/dump-webarchive.js</string>
+               </dict>
+               <dict>
+                       <key>WebResourceData</key>
+                       <string>div { font-family: Arial, Helvetica, sans-serif; color: red; }
+</string>
+                       <key>WebResourceMIMEType</key>
+                       <string>text/css</string>
+                       <key>WebResourceResponse</key>
+                       <dict>
+                               <key>MIMEType</key>
+                               <string>text/css</string>
+                               <key>URL</key>
+                               <string>file:///LayoutTests/webarchive/resources/test-style.css</string>
+                               <key>expectedContentLength</key>
+                               <integer>63</integer>
+                       </dict>
+                       <key>WebResourceURL</key>
+                       <string>file:///LayoutTests/webarchive/resources/test-style.css</string>
+               </dict>
        </array>
 </dict>
 </plist>
index 7f796a1..3491a88 100644 (file)
                        <array>
                                <dict>
                                        <key>WebResourceData</key>
-                                       <string>div { font-family: Arial, Helvetica, sans-serif; color: red; }
-</string>
-                                       <key>WebResourceMIMEType</key>
-                                       <string>text/css</string>
-                                       <key>WebResourceResponse</key>
-                                       <dict>
-                                               <key>MIMEType</key>
-                                               <string>text/css</string>
-                                               <key>URL</key>
-                                               <string>file:///LayoutTests/webarchive/resources/test-style.css</string>
-                                               <key>expectedContentLength</key>
-                                               <integer>63</integer>
-                                       </dict>
-                                       <key>WebResourceURL</key>
-                                       <string>file:///LayoutTests/webarchive/resources/test-style.css</string>
-                               </dict>
-                               <dict>
-                                       <key>WebResourceData</key>
                                        <data>
                                        R0lGODlhNABAAMQfAGJiYvLz9ImKitvb2/39
                                        /cnJyaSkpOPj49TU1MHBwbW1terq7Lu7u/X1
                                        <key>WebResourceURL</key>
                                        <string>file:///LayoutTests/webarchive/resources/apple.gif</string>
                                </dict>
+                               <dict>
+                                       <key>WebResourceData</key>
+                                       <string>div { font-family: Arial, Helvetica, sans-serif; color: red; }
+</string>
+                                       <key>WebResourceMIMEType</key>
+                                       <string>text/css</string>
+                                       <key>WebResourceResponse</key>
+                                       <dict>
+                                               <key>MIMEType</key>
+                                               <string>text/css</string>
+                                               <key>URL</key>
+                                               <string>file:///LayoutTests/webarchive/resources/test-style.css</string>
+                                               <key>expectedContentLength</key>
+                                               <integer>63</integer>
+                                       </dict>
+                                       <key>WebResourceURL</key>
+                                       <string>file:///LayoutTests/webarchive/resources/test-style.css</string>
+                               </dict>
                        </array>
                </dict>
        </array>
index f7befc7..d49eb2e 100644 (file)
@@ -1,3 +1,14 @@
+2008-04-08  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Mitzpettel
+
+        Fixed http://bugs.webkit.org/show_bug.cgi?id=18302
+        -WebArchive subresources dump in random order, intermittent failures
+
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (compareResourceURLs): Sorting function based on the resource URLs
+        (serializeWebArchiveToXML): Sort the subresource array
+
 2008-04-07  Brady Eidson  <beidson@apple.com>
 
         OMG, BUILD - please!
index b8c45af..705a548 100644 (file)
@@ -608,6 +608,14 @@ static void convertWebResourceResponseToDictionary(NSMutableDictionary *property
     [responseDictionary release];
 }
 
+static NSInteger compareResourceURLs(id resource1, id resource2, void *context)
+{
+    NSString *url1 = [resource1 objectForKey:@"WebResourceURL"];
+    NSString *url2 = [resource2 objectForKey:@"WebResourceURL"];
+    return [url1 compare:url2];
+}
+
 static NSString *serializeWebArchiveToXML(WebArchive *webArchive)
 {
     NSString *errorString;
@@ -642,6 +650,10 @@ static NSString *serializeWebArchiveToXML(WebArchive *webArchive)
             convertWebResourceResponseToDictionary(subresourcePropertyList);
             convertWebResourceDataToString(subresourcePropertyList);
         }
+        
+        // Sort the subresources so they're always in a predictable order for the dump
+        if (NSArray *sortedSubresources = [subresources sortedArrayUsingFunction:compareResourceURLs context:nil])
+            [resourcePropertyList setObject:sortedSubresources forKey:@"WebSubresources"];
     }
 
     NSData *xmlData = [NSPropertyListSerialization dataFromPropertyList:propertyList