Disable the hang detector for bug 429592 while running the startup cache tests because they intentionally hang the browser to trigger the startup timeout. feedback=mwu on IRC
authorBenjamin Smedberg <benjamin@smedbergs.us>
Fri, 04 Nov 2011 15:13:40 -0400
changeset 79795 e6012a713f5383435be479560b8b02feb3c11b78
parent 79794 e297dc3d0401621daf50c00778b86ba5af39a43f
child 79796 6c7b3971eca36645126fa283f24f62a06e6b271d
push idunknown
push userunknown
push dateunknown
bugs429592
milestone10.0a1
Disable the hang detector for bug 429592 while running the startup cache tests because they intentionally hang the browser to trigger the startup timeout. feedback=mwu on IRC
startupcache/test/TestStartupCache.cpp
--- a/startupcache/test/TestStartupCache.cpp
+++ b/startupcache/test/TestStartupCache.cpp
@@ -46,16 +46,18 @@
 #include "nsISupports.h"
 #include "nsIStartupCache.h"
 #include "nsIStringStream.h"
 #include "nsIStorageStream.h"
 #include "nsIObjectInputStream.h"
 #include "nsIObjectOutputStream.h"
 #include "nsIURI.h"
 #include "nsStringAPI.h"
+#include "nsIPrefBranch.h"
+#include "nsIPrefService.h"
 
 namespace mozilla {
 namespace scache {
 
 NS_IMPORT nsresult
 NewObjectInputStreamFromBuffer(char* buffer, PRUint32 len, 
                                nsIObjectInputStream** stream);
 
@@ -86,16 +88,17 @@ nsresult
 WaitForStartupTimer() {
   nsresult rv;
   nsCOMPtr<nsIStartupCache> sc 
     = do_GetService("@mozilla.org/startupcache/cache;1");
   PR_Sleep(10 * PR_TicksPerSecond());
   
   bool complete;
   while (true) {
+    
     NS_ProcessPendingEvents(nsnull);
     rv = sc->StartupWriteComplete(&complete);
     if (NS_FAILED(rv) || complete)
       break;
     PR_Sleep(1 * PR_TicksPerSecond());
   }
   return rv;
 }
@@ -314,16 +317,19 @@ TestEarlyShutdown() {
 }
 
 
 int main(int argc, char** argv)
 {
   int rv = 0;
   nsresult rv2;
   ScopedXPCOM xpcom("Startup Cache");
+
+  nsCOMPtr<nsIPrefBranch> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID);
+  prefs->SetIntPref("hangmonitor.timeout", 0);
   
   if (NS_FAILED(TestStartupWriteRead()))
     rv = 1;
   if (NS_FAILED(TestWriteInvalidateRead()))
     rv = 1;
   if (NS_FAILED(TestWriteObject()))
     rv = 1;
   if (NS_FAILED(TestEarlyShutdown()))