Commit 903e1d40 authored by ggaren's avatar ggaren

Reviewed by Antti Koivisto.

        
        Added watchdog timer to waitUntilDone to prevent a run-away test from
        hanging the test harness.

        * DumpRenderTree/DumpRenderTree.m:
        (dump):
        (-[LayoutTestController waitUntilDone]):
        (-[LayoutTestController waitUntilDoneWatchdogFired]):
        * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@24376 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 187d292f
2007-07-17 Geoffrey Garen <ggaren@apple.com>
Reviewed by Antti Koivisto.
Added watchdog timer to waitUntilDone to prevent a run-away test from
hanging the test harness.
* DumpRenderTree/DumpRenderTree.m:
(dump):
(-[LayoutTestController waitUntilDone]):
(-[LayoutTestController waitUntilDoneWatchdogFired]):
* DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
2007-07-17 Kevin McCullough <kmccullough@apple.com>
Reviewed by Adam.
......
......@@ -107,6 +107,9 @@ @interface LocalPasteboard : NSPasteboard
volatile BOOL done;
NavigationController *navigationController = nil;
static NSTimer *waitToDumpWatchdog;
static NSTimeInterval waitToDumpWatchdogInterval = 10; // seconds
// Delegates
static FrameLoadDelegate *frameLoadDelegate;
static UIDelegate *uiDelegate;
......@@ -809,6 +812,10 @@ static void dumpBackForwardListForWebView(WebView *view)
void dump(void)
{
[waitToDumpWatchdog invalidate];
[waitToDumpWatchdog release];
waitToDumpWatchdog = nil;
if (dumpTree) {
NSString *result = nil;
......@@ -1110,6 +1117,16 @@ - (void)setCanOpenWindows
- (void)waitUntilDone
{
waitToDump = YES;
if (!waitToDumpWatchdog)
waitToDumpWatchdog = [[NSTimer scheduledTimerWithTimeInterval:waitToDumpWatchdogInterval target:self selector:@selector(waitUntilDoneWatchdogFired) userInfo:nil repeats:NO] retain];
}
- (void)waitUntilDoneWatchdogFired
{
const char* message = "FAIL: Timed out waiting for notifyDone to be called\n";
fprintf(stderr, message);
fprintf(stdout, message);
dump();
}
- (void)notifyDone
......
......@@ -123,7 +123,7 @@
9340995408540CAF007F3BC8 /* DumpRenderTree */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = DumpRenderTree; sourceTree = BUILT_PRODUCTS_DIR; };
93442CF408F8BA4900BFE8CA /* TextInputController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextInputController.h; sourceTree = "<group>"; };
93442CF508F8BA4900BFE8CA /* TextInputController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TextInputController.m; sourceTree = "<group>"; };
9345229C0BD12B710086EDA0 /* AHEM____.TTF */ = {isa = PBXFileReference; explicitFileType = file; name = AHEM____.TTF; path = DumpRenderTree.qtproj/fonts/AHEM____.TTF; sourceTree = "<group>"; };
9345229C0BD12B710086EDA0 /* AHEM____.TTF */ = {isa = PBXFileReference; explicitFileType = file; name = "AHEM____.TTF"; path = "DumpRenderTree.qtproj/fonts/AHEM____.TTF"; sourceTree = "<group>"; };
A803FCB709CAAAB0009B2A37 /* EventSendingController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = EventSendingController.h; sourceTree = "<group>"; };
A803FCB809CAAAB1009B2A37 /* EventSendingController.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = EventSendingController.m; sourceTree = "<group>"; };
A803FF7409CAAD08009B2A37 /* DumpRenderTree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DumpRenderTree.h; sourceTree = "<group>"; };
......@@ -381,6 +381,7 @@
08FB7793FE84155DC02AAC07 /* Project object */ = {
isa = PBXProject;
buildConfigurationList = 149C29C308902C6D008A9EFC /* Build configuration list for PBXProject "DumpRenderTree" */;
compatibilityVersion = "Xcode 2.4";
hasScannedForEncodings = 1;
mainGroup = 08FB7794FE84155DC02AAC07 /* DumpRenderTree */;
productRefGroup = 9340995508540CAF007F3BC8 /* Products */;
......@@ -537,7 +538,7 @@
"-sectcreate",
__DATA,
Ahem,
DumpRenderTree.qtproj/fonts/AHEM____.TTF,
"DumpRenderTree.qtproj/fonts/AHEM____.TTF",
);
PRODUCT_NAME = DumpRenderTree;
VALID_ARCHS = "ppc7400 ppc970 i386 ppc";
......@@ -553,7 +554,7 @@
"-sectcreate",
__DATA,
Ahem,
DumpRenderTree.qtproj/fonts/AHEM____.TTF,
"DumpRenderTree.qtproj/fonts/AHEM____.TTF",
);
PRODUCT_NAME = DumpRenderTree;
VALID_ARCHS = "ppc7400 ppc970 i386 ppc";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment