mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-03 05:47:29 +09:00
Issue #21 - Remove Telemetry accumulation/structures from toolkit js.
This fixes toolkit modules and prevents toolkit component breakage. Also removes about:telemetry
This commit is contained in:
parent
8d800b1cb0
commit
44388b01a3
42 changed files with 22 additions and 3581 deletions
|
|
@ -55,31 +55,6 @@ function testPixel(ctx, x, y, r, g, b, a, fuzz) {
|
|||
return false;
|
||||
}
|
||||
|
||||
function reportResult(val) {
|
||||
try {
|
||||
let histogram = Services.telemetry.getHistogramById("GRAPHICS_SANITY_TEST");
|
||||
histogram.add(val);
|
||||
} catch (e) {}
|
||||
|
||||
Preferences.set(RUNNING_PREF, false);
|
||||
Services.prefs.savePrefFile(null);
|
||||
}
|
||||
|
||||
function reportTestReason(val) {
|
||||
let histogram = Services.telemetry.getHistogramById("GRAPHICS_SANITY_TEST_REASON");
|
||||
histogram.add(val);
|
||||
}
|
||||
|
||||
function annotateCrashReport(value) {
|
||||
try {
|
||||
// "1" if we're annotating the crash report, "" to remove the annotation.
|
||||
var crashReporter = Cc['@mozilla.org/toolkit/crash-reporter;1'].
|
||||
getService(Ci.nsICrashReporter);
|
||||
crashReporter.annotateCrashReport("GraphicsSanityTest", value ? "1" : "");
|
||||
} catch (e) {
|
||||
}
|
||||
}
|
||||
|
||||
function setTimeout(aMs, aCallback) {
|
||||
var timer = Cc['@mozilla.org/timer;1'].
|
||||
createInstance(Ci.nsITimer);
|
||||
|
|
@ -125,18 +100,15 @@ function testCompositor(win, ctx) {
|
|||
var testPassed = true;
|
||||
|
||||
if (!verifyVideoRendering(ctx)) {
|
||||
reportResult(TEST_FAILED_VIDEO);
|
||||
Preferences.set(DISABLE_VIDEO_PREF, true);
|
||||
testPassed = false;
|
||||
}
|
||||
|
||||
if (!verifyLayersRendering(ctx)) {
|
||||
reportResult(TEST_FAILED_RENDER);
|
||||
testPassed = false;
|
||||
}
|
||||
|
||||
if (testPassed) {
|
||||
reportResult(TEST_PASSED);
|
||||
}
|
||||
|
||||
return testPassed;
|
||||
|
|
@ -160,7 +132,6 @@ var listener = {
|
|||
.getInterface(Ci.nsIDOMWindowUtils);
|
||||
setTimeout(TIMEOUT_SEC * 1000, () => {
|
||||
if (this.win) {
|
||||
reportResult(TEST_TIMEOUT);
|
||||
this.endTest();
|
||||
}
|
||||
});
|
||||
|
|
@ -227,10 +198,6 @@ var listener = {
|
|||
|
||||
this.mm = null;
|
||||
}
|
||||
|
||||
// Remove the annotation after we've cleaned everything up, to catch any
|
||||
// incidental crashes from having performed the sanity test.
|
||||
annotateCrashReport(false);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -248,7 +215,6 @@ SanityTest.prototype = {
|
|||
|
||||
if (Preferences.get(RUNNING_PREF, false)) {
|
||||
Preferences.set(DISABLE_VIDEO_PREF, true);
|
||||
reportResult(TEST_CRASHED);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -257,11 +223,6 @@ SanityTest.prototype = {
|
|||
if (prefValue == value) {
|
||||
return true;
|
||||
}
|
||||
if (prefValue === undefined) {
|
||||
reportTestReason(REASON_FIRST_RUN);
|
||||
} else {
|
||||
reportTestReason(reason);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -296,8 +257,6 @@ SanityTest.prototype = {
|
|||
|
||||
if (!this.shouldRunTest()) return;
|
||||
|
||||
annotateCrashReport(true);
|
||||
|
||||
// Open a tiny window to render our test page, and notify us when it's loaded
|
||||
var sanityTest = Services.ww.openWindow(null,
|
||||
"chrome://gfxsanity/content/sanityparent.html",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue