зеркало из https://github.com/mozilla/gecko-dev.git
Bug 435296 - Tests. r=dolske
This commit is contained in:
Родитель
f9b8d27445
Коммит
c32a1505e2
|
@ -47,6 +47,8 @@ include $(topsrcdir)/config/rules.mk
|
|||
_TEST_FILES = imgutils.js \
|
||||
test_bug399925.html \
|
||||
bug399925.gif \
|
||||
schrep.png \
|
||||
test_bug435296.html \
|
||||
bug468160.sjs \
|
||||
test_bug468160.html \
|
||||
red.png \
|
||||
|
|
Двоичный файл не отображается.
После Ширина: | Высота: | Размер: 38 KiB |
|
@ -0,0 +1,71 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=435296
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 435296</title>
|
||||
<script type="application/javascript" src="/MochiKit/MochiKit.js"></script>
|
||||
<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>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=435296">Mozilla Bug 435296</a>
|
||||
<img id="testimage" style="display: none;">
|
||||
<pre id="test">
|
||||
<script type="application/javascript">
|
||||
|
||||
// Boilerplate
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
// We're relying on very particular behavior for certain images - clear the
|
||||
// image cache.
|
||||
clearImageCache();
|
||||
|
||||
// In order to work around the effects introduced in bug 512435, we only load
|
||||
// the image after window onload fires
|
||||
function windowLoadHandler()
|
||||
{
|
||||
// Set the source and an onload handler
|
||||
var image = document.getElementById("testimage");
|
||||
image.src = "schrep.png";
|
||||
image.onload = imageLoadHandler;
|
||||
}
|
||||
|
||||
function imageLoadHandler()
|
||||
{
|
||||
// The image is hidden, so it should not be decoded
|
||||
ok(!isFrameDecoded("testimage"), "image should not be decoded");
|
||||
|
||||
// Make the image visible
|
||||
var image = document.getElementById("testimage");
|
||||
image.style.display = "inline";
|
||||
|
||||
// Wait for the image to decode
|
||||
setTimeout("tryToFinish();", 500);
|
||||
}
|
||||
|
||||
function tryToFinish()
|
||||
{
|
||||
// If it hasn't happened yet, wait longer. If it never happens, this test
|
||||
// will timeout after 300 seconds...
|
||||
if (!isFrameDecoded("testimage")) {
|
||||
setTimeout("tryToFinish();", 500);
|
||||
return;
|
||||
}
|
||||
|
||||
// By definition, the image is decoded here. Give ourselves a pat on the back.
|
||||
ok(isFrameDecoded("testimage"), "image should be decoded");
|
||||
|
||||
// All done
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
// Set our onload handler
|
||||
window.onload = windowLoadHandler;
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
Загрузка…
Ссылка в новой задаче