зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 5c52ec9e5a3d (bug 878577)
This commit is contained in:
Родитель
07a47250c0
Коммит
0b8e36117b
Двоичные данные
image/test/mochitest/12M-pixels-1.png
Двоичные данные
image/test/mochitest/12M-pixels-1.png
Двоичный файл не отображается.
До Ширина: | Высота: | Размер: 22 KiB |
Двоичные данные
image/test/mochitest/12M-pixels-2.png
Двоичные данные
image/test/mochitest/12M-pixels-2.png
Двоичный файл не отображается.
До Ширина: | Высота: | Размер: 22 KiB |
Двоичные данные
image/test/mochitest/6M-pixels.png
Двоичные данные
image/test/mochitest/6M-pixels.png
Двоичный файл не отображается.
До Ширина: | Высота: | Размер: 9.9 KiB |
|
@ -1,4 +1,5 @@
|
|||
[DEFAULT]
|
||||
skip-if = buildapp == 'b2g'
|
||||
support-files =
|
||||
INT32_MIN.bmp
|
||||
animated-gif2.gif
|
||||
|
@ -53,13 +54,10 @@ support-files =
|
|||
short_header.gif
|
||||
source.png
|
||||
over.png
|
||||
6M-pixels.png
|
||||
12M-pixels-1.png
|
||||
12M-pixels-2.png
|
||||
|
||||
[test_ImageContentLoaded.html]
|
||||
[test_bug399925.html]
|
||||
skip-if = e10s || buildapp == 'b2g' #Bug 969779 - should set preference via SpecialPowers.pushPrefEnv()
|
||||
skip-if = e10s
|
||||
# [test_bug435296.html]
|
||||
# disabled - See bug 578591
|
||||
[test_bug466586.html]
|
||||
|
@ -86,5 +84,3 @@ skip-if = e10s || buildapp == 'b2g' #Bug 969779 - should set preference via Spec
|
|||
[test_drawDiscardedImage.html]
|
||||
[test_error_events.html]
|
||||
[test_short_gif_header.html]
|
||||
[test_image_buffer_limit.html]
|
||||
run-if = toolkit == "gonk"
|
||||
|
|
|
@ -1,94 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=878577
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 878577 - Hard limit of decoded image buffer size</title>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="application/javascript" src="imgutils.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<!--
|
||||
Initial setup: The default size limit is 65M
|
||||
Step 1: Load 6M-pixels.png ok
|
||||
Step 2: Load 12M-pixels-1.png fail
|
||||
Step 3: Remove 6M-pixels.png and clear the decoded image
|
||||
Step 4: Load 12M-pixels-2.png ok
|
||||
-->
|
||||
|
||||
<script>
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
function loadImage(url) {
|
||||
info('loading ' + url);
|
||||
var image = new Image(50,50);
|
||||
image.src = url;
|
||||
document.body.appendChild(image);
|
||||
return image;
|
||||
}
|
||||
|
||||
function fail(msg) {
|
||||
return function() {
|
||||
ok(false, msg);
|
||||
SimpleTest.finish();
|
||||
};
|
||||
}
|
||||
|
||||
function runTest() {
|
||||
// provide a clean setup
|
||||
clearImageCache();
|
||||
|
||||
var img_6M = loadImage('6M-pixels.png');
|
||||
img_6M.onerror = fail('unable to load 6M-pixels.png');
|
||||
img_6M.onload = function() {
|
||||
ok(true, 'expect success on loading a 6M-pixel image');
|
||||
|
||||
var img_12M = loadImage('12M-pixels-1.png');
|
||||
img_12M.onload = fail('should fail to load due to image buffer size limit');
|
||||
img_12M.onerror = function() {
|
||||
ok(true, 'expect fail on loading a 12M-pixel image');
|
||||
|
||||
// remove image cache
|
||||
info('discard decoded image buffer');
|
||||
img_6M.onerror = null;
|
||||
img_6M.src = null;
|
||||
img_12M.onerror = null;
|
||||
img_12M.src = null;
|
||||
document.body.removeChild(img_6M);
|
||||
document.body.removeChild(img_12M);
|
||||
clearImageCache();
|
||||
|
||||
// Spin the event to give the image a chance to be discarded.
|
||||
SimpleTest.executeSoon(function() {
|
||||
var another_img_12M = loadImage('12M-pixels-2.png');
|
||||
another_img_12M.onerror = fail('unable to load 12M-pixels-2.png');
|
||||
another_img_12M.onload = function() {
|
||||
ok(true, 'expect success on loading another 12M-pixel image');
|
||||
another_img_12M.onerror = null;
|
||||
another_img_12M.onload = null;
|
||||
SimpleTest.finish();
|
||||
}; // another_img_12M.onload
|
||||
});
|
||||
|
||||
}; // img_12M.onerror
|
||||
}; // img_6M.onload
|
||||
}
|
||||
|
||||
window.addEventListener("load", function() {
|
||||
SpecialPowers.pushPrefEnv({
|
||||
"set": [
|
||||
// XXX prevent displayed imgFrame been released
|
||||
["image.mem.allow_locking_in_content_processes", true]
|
||||
]
|
||||
}, runTest);
|
||||
});
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
Загрузка…
Ссылка в новой задаче