/** Test for Bug 399925. */ var triggerDiscardingManually = false; var pngResults = [];
SimpleTest.waitForExplicitFinish();
SimpleTest.requestFlakyTimeout("untriaged");
window.onload = function() {
// It'd be nice to reduce the discard timer here, but unfortunately we only
// read that pref on startup. We instead manually trigger discarding on
// platforms where the discard timer is too long (which we'll somewhat
// arbitrarily define as 'longer than 60 seconds'). var expirationMs =
SpecialPowers.getIntPref('image.mem.surfacecache.min_expiration_ms');
if (expirationMs > 60000) {
ok(true, 'Triggering discarding manually because SurfaceCache expiration ' + 'is ' + expirationMs + ' ms');
triggerDiscardingManually = true;
} else {
ok(true, 'Using normal discarding because SurfaceCache expiration ' + 'is ' + expirationMs + ' ms');
}
// Enable discarding for the test.
SpecialPowers.pushPrefEnv({ 'set':[['image.mem.discardable',true]]
}, runTest);
}
function runTest() { var image = new Image();
image.setAttribute("id", "gif");
// 1. Draw the canvas once on loadComplete
// 2. Redraw the canvas and compare the results right on discard
addCallbacks(image, drawCanvas, function() {
drawCanvas();
is(pngResults[0]java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
SimpleTest.finish();
});
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.