<!DOCTYPE html> | |
<script src="../../../resources/js-test.js"></script> | |
<script> | |
description("Test that creating a cached image and immediately checking its width works"); | |
jsTestIsAsync = true; | |
var src = '../resources/abe.png?' + Math.random(); | |
var currentResult = false; | |
function test(expected) { | |
var i = new Image(); | |
i.src = src; | |
currentResult = (i.width == expected); | |
shouldBeTrue('currentResult'); | |
} | |
test(0); | |
onload = function(){ | |
test(76); | |
finishJSTest(); | |
}; | |
</script> |