When the sanity test fails, report its snapshot via Telemetry. (bug 1194505, r=mattwoodrow,vladan)

This commit is contained in:
David Anderson
2015-08-13 17:51:31 -07:00
parent 4f477a0f55
commit 12f2549299
2 changed files with 24 additions and 1 deletions

View File

@@ -74,6 +74,16 @@ function reportTestReason(val) {
histogram.add(val);
}
function reportSnapshotContents(canvas) {
try {
var data = canvas.toDataURL();
Cc['@mozilla.org/observer-service;1'].
getService(Ci.nsIObserverService).
notifyObservers(null, "graphics-sanity-test-failed", data);
} catch (e) {
}
}
function annotateCrashReport(value) {
try {
// "1" if we're annotating the crash report, "" to remove the annotation.
@@ -167,7 +177,9 @@ let listener = {
// Perform the compositor backbuffer test, which currently we use for
// actually deciding whether to enable hardware media decoding.
testCompositor(this.win, this.ctx);
if (!testCompositor(this.win, this.ctx)) {
reportSnapshotContents(this.canvas);
}
this.endTest();
},