Bug 522375: fix non-libxul builds + testcase nits from gavin. a=bustage,tests
authorTaras Glek <tglek@mozilla.com>
Fri, 14 Jan 2011 13:29:25 -0800
changeset 60610 392f4f212ea995720be6b5fe2ccce57cc890fe4b
parent 60609 c227d5a3bc9989a14b9e5906bf96d9ab51b1c82d
child 60611 c9420f27b9dcdb9e3aa9d6114f63199fa599ab4c
push idunknown
push userunknown
push dateunknown
reviewersbustage, tests
bugs522375
milestone2.0b10pre
Bug 522375: fix non-libxul builds + testcase nits from gavin. a=bustage,tests
browser/components/sessionstore/test/browser/browser_522375.js
toolkit/components/startup/src/nsAppStartup.cpp
--- a/browser/components/sessionstore/test/browser/browser_522375.js
+++ b/browser/components/sessionstore/test/browser/browser_522375.js
@@ -1,13 +1,11 @@
 function test() {
-  waitForExplicitFinish();
   var startup_info = Components.classes["@mozilla.org/toolkit/app-startup;1"].getService(Components.interfaces.nsIAppStartup_MOZILLA_2_0).getStartupInfo();
   // No .process info on mac
-  is(startup_info.process <= startup_info.main, true, "process created before main is run " + uneval(startup_info));
+  ok(startup_info.process <= startup_info.main, "process created before main is run " + uneval(startup_info));
 
   // on linux firstPaint can happen after everything is loaded (especially with remote X)
   if (startup_info.firstPaint)
-    is(startup_info.main <= startup_info.firstPaint, true, "main ran before first paint " + uneval(startup_info));
+    ok(startup_info.main <= startup_info.firstPaint, "main ran before first paint " + uneval(startup_info));
 
-  is(startup_info.main < startup_info.sessionRestored, true, "Session restored after main " + uneval(startup_info));
-  finish();
+  ok(startup_info.main < startup_info.sessionRestored, "Session restored after main " + uneval(startup_info));
 }
--- a/toolkit/components/startup/src/nsAppStartup.cpp
+++ b/toolkit/components/startup/src/nsAppStartup.cpp
@@ -85,18 +85,20 @@
 #include <sys/syscall.h>
 #endif
 
 #ifdef XP_MACOSX
 #include <sys/sysctl.h>
 #endif
 
 static NS_DEFINE_CID(kAppShellCID, NS_APPSHELL_CID);
+#ifdef MOZ_ENABLE_LIBXUL
 extern PRTime gXRE_mainTimestamp;
 extern PRTime gFirstPaintTimestamp;
+#endif
 // mfinklesessionstore-browser-state-restored might be a better choice than the one below
 static PRTime gRestoredTimestamp = 0;       // Timestamp of sessionstore-windows-restored
 static PRTime gProcessCreationTimestamp = 0;// Timestamp of sessionstore-windows-restored
 
 class nsAppExitEvent : public nsRunnable {
 private:
   nsRefPtr<nsAppStartup> mService;
 
@@ -680,13 +682,15 @@ nsAppStartup::GetStartupInfo()
   JSObject *obj = JS_NewObject(cx, NULL, NULL, NULL);
   *retvalPtr = OBJECT_TO_JSVAL(obj);
   ncc->SetReturnValueWasSet(PR_TRUE);
 
   if (!gProcessCreationTimestamp)
     gProcessCreationTimestamp = CalculateProcessCreationTimestamp();
 
   MaybeDefineProperty(cx, obj, "process", gProcessCreationTimestamp);
+#ifdef MOZ_ENABLE_LIBXUL
   MaybeDefineProperty(cx, obj, "main", gXRE_mainTimestamp);
   MaybeDefineProperty(cx, obj, "firstPaint", gFirstPaintTimestamp);
+#endif
   MaybeDefineProperty(cx, obj, "sessionRestored", gRestoredTimestamp);
   return NS_OK;
 }