diff --git a/startupcache/test/TestStartupCache.cpp b/startupcache/test/TestStartupCache.cpp index 73c44cc6e9b..f1d6655c231 100644 --- a/startupcache/test/TestStartupCache.cpp +++ b/startupcache/test/TestStartupCache.cpp @@ -51,6 +51,8 @@ #include "nsIObjectOutputStream.h" #include "nsIURI.h" #include "nsStringAPI.h" +#include "nsIPrefBranch.h" +#include "nsIPrefService.h" namespace mozilla { namespace scache { @@ -91,6 +93,7 @@ WaitForStartupTimer() { bool complete; while (true) { + NS_ProcessPendingEvents(nsnull); rv = sc->StartupWriteComplete(&complete); if (NS_FAILED(rv) || complete) @@ -319,6 +322,9 @@ int main(int argc, char** argv) int rv = 0; nsresult rv2; ScopedXPCOM xpcom("Startup Cache"); + + nsCOMPtr prefs = do_GetService(NS_PREFSERVICE_CONTRACTID); + prefs->SetIntPref("hangmonitor.timeout", 0); if (NS_FAILED(TestStartupWriteRead())) rv = 1;