- fixed bug which would result in multiple unwanted dumps in a single layout...
authordarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Jun 2005 05:41:38 +0000 (05:41 +0000)
committerdarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Jun 2005 05:41:38 +0000 (05:41 +0000)
        * DumpRenderTree/DumpRenderTree.m:
        (-[WaitUntilDoneDelegate webView:locationChangeDone:forDataSource:]): Set new
        "readyToDump" flag.
        (-[LayoutTestController waitUntilDone]): Update for name change.
        (-[LayoutTestController notifyDone]): Dump only if ready.
        (dumpRenderTree): Set up new boolean and update for name change.

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

WebKitTools/ChangeLog
WebKitTools/DumpRenderTree/DumpRenderTree.m

index 76c74e472042f67589e626a8d24a2898acc8c6e1..35688b223acb284552a3d0f25a9d82777c906a2e 100644 (file)
@@ -1,3 +1,14 @@
+2005-06-29  Darin Adler  <darin@apple.com>
+
+        - fixed bug which would result in multiple unwanted dumps in a single layout test
+
+        * DumpRenderTree/DumpRenderTree.m:
+        (-[WaitUntilDoneDelegate webView:locationChangeDone:forDataSource:]): Set new
+        "readyToDump" flag.
+        (-[LayoutTestController waitUntilDone]): Update for name change.
+        (-[LayoutTestController notifyDone]): Dump only if ready.
+        (dumpRenderTree): Set up new boolean and update for name change.
+
 2005-06-29  Darin Adler  <darin@apple.com>
 
         Changes by Timothy Hatcher.
index f9fc831f222a4458f17df1aaf8dab44ca5449998..4d89d9baaaf1137503006cd52384b0754d7c9337 100644 (file)
@@ -48,7 +48,8 @@ static void dumpRenderTree(const char *filename);
 
 static volatile BOOL done;
 static WebFrame *frame;
-static BOOL waitLayoutTest;
+static BOOL readyToDump;
+static BOOL waitToDump;
 static BOOL dumpAsText;
 static BOOL dumpTitleChanges;
 
@@ -139,8 +140,11 @@ static void dump(void)
 
 - (void)webView:(WebView *)c locationChangeDone:(NSError *)error forDataSource:(WebDataSource *)dataSource
 {
-    if (!waitLayoutTest && [dataSource webFrame] == frame) {
-        dump();
+    if ([dataSource webFrame] == frame) {
+        if (waitToDump)
+            readyToDump = YES;
+        else
+            dump();
     }
 }
 
@@ -194,13 +198,14 @@ static void dump(void)
 
 - (void)waitUntilDone 
 {
-    waitLayoutTest = YES;
+    waitToDump = YES;
 }
 
 - (void)notifyDone
 {
-    dump();
-    waitLayoutTest = NO;
+    if (waitToDump && readyToDump)
+        dump();
+    waitToDump = NO;
 }
 
 - (void)dumpAsText
@@ -229,9 +234,10 @@ static void dumpRenderTree(const char *filename)
     }
 
     done = NO;
+    readyToDump = NO;
+    waitToDump = NO;
     dumpAsText = NO;
     dumpTitleChanges = NO;
-    waitLayoutTest = NO;
 
     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
     [frame loadRequest:[NSURLRequest requestWithURL:(NSURL *)URL]];