Backed out changeset f856bcb5097f (bug 689256) for xpcshell orange on a CLOSED TREE.

This commit is contained in:
Ryan VanderMeulen 2013-03-06 14:37:34 -05:00
parent 6fae066075
commit babdb27448
3 changed files with 6 additions and 45 deletions

View File

@ -1,17 +1,7 @@
function test() {
var startup_info = Components.classes["@mozilla.org/toolkit/app-startup;1"].getService(Components.interfaces.nsIAppStartup).getStartupInfo();
// No .process info on mac
// Check if we encountered a telemetry error for the the process creation
// timestamp and turn the first test into a known failure.
var telemetry = Cc["@mozilla.org/base/telemetry;1"].getService(Ci.nsITelemetry);
var snapshot = telemetry.getHistogramById("STARTUP_MEASUREMENT_ERRORS")
.snapshot();
if (snapshot.counts[0] == 0)
ok(startup_info.process <= startup_info.main, "process created before main is run " + uneval(startup_info));
else
todo(false, "An error occurred while recording the process creation timestamp, skipping this test");
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)

View File

@ -791,17 +791,14 @@ nsAppStartup::GetStartupInfo(JSContext* aCx, JS::Value* aRetval)
PRTime ProcessCreationTimestamp = StartupTimeline::Get(StartupTimeline::PROCESS_CREATION);
if (!ProcessCreationTimestamp) {
PRTime MainTimestamp = StartupTimeline::Get(StartupTimeline::MAIN);
char *moz_app_restart = PR_GetEnv("MOZ_APP_RESTART");
if (moz_app_restart) {
ProcessCreationTimestamp = nsCRT::atoll(moz_app_restart) * PR_USEC_PER_MSEC;
} else {
ProcessCreationTimestamp = CalculateProcessCreationTimestamp();
}
// Bug 670008 & 689256: Avoid obviously invalid process creation times
if ((PR_Now() <= ProcessCreationTimestamp) ||
(ProcessCreationTimestamp > MainTimestamp))
{
// Bug 670008: Avoid obviously invalid process creation times
if (PR_Now() <= ProcessCreationTimestamp) {
ProcessCreationTimestamp = -1;
Telemetry::Accumulate(Telemetry::STARTUP_MEASUREMENT_ERRORS, StartupTimeline::PROCESS_CREATION);
}

View File

@ -8,7 +8,6 @@ let tmp = {};
Components.utils.import("resource://gre/modules/AddonRepository.jsm", tmp);
let AddonRepository = tmp.AddonRepository;
var gTelemetry = Cc["@mozilla.org/base/telemetry;1"].getService(Ci.nsITelemetry);
var gManagerWindow;
var gProvider;
@ -42,38 +41,13 @@ function test() {
}
info(url.query);
// Check if we encountered telemetry errors and turn the tests for which
// we don't have valid data into known failures.
let snapshot = gTelemetry.getHistogramById("STARTUP_MEASUREMENT_ERRORS")
.snapshot();
let tProcessValid = (snapshot.counts[0] == 0);
let tMainValid = tProcessValid && (snapshot.counts[2] == 0);
let tFirstPaintValid = tProcessValid && (snapshot.counts[5] == 0);
let tSessionRestoredValid = tProcessValid && (snapshot.counts[6] == 0);
let params = parseParams(url.query);
is(params.appOS, Services.appinfo.OS, "OS should be correct");
is(params.appVersion, Services.appinfo.version, "Version should be correct");
if (tMainValid) {
ok(params.tMain >= 0, "Should be a sensible tMain");
} else {
todo(false, "An error occurred while recording the startup timestamps, skipping this test");
}
if (tFirstPaintValid) {
ok(params.tFirstPaint >= 0, "Should be a sensible tFirstPaint");
} else {
todo(false, "An error occurred while recording the startup timestamps, skipping this test");
}
if (tSessionRestoredValid) {
ok(params.tSessionRestored >= 0, "Should be a sensible tSessionRestored");
} else {
todo(false, "An error occurred while recording the startup timestamps, skipping this test");
}
ok(params.tMain >= 0, "Should be a sensible tMain");
ok(params.tFirstPaint >= 0, "Should be a sensible tFirstPaint");
ok(params.tSessionRestored >= 0, "Should be a sensible tSessionRestored");
gSeenRequest = true;
}