mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-26 23:23:33 +00:00
Bug 686026 - test_mozGetAsFile.html runs finish three times, instead of once; r=joedrew
This commit is contained in:
parent
dea5dcabf0
commit
85f4bfade8
@ -7,16 +7,20 @@
|
||||
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
<script>
|
||||
|
||||
var gCompares = 0;
|
||||
|
||||
function compareAsync(file, canvas, type)
|
||||
{
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
++gCompares;
|
||||
|
||||
var reader = new FileReader();
|
||||
reader.onload =
|
||||
function(e) {
|
||||
is(e.target.result, canvas.toDataURL(type),
|
||||
"<canvas>.mozGetAsFile().getAsDataURL() should equal <canvas>.toDataURL()");
|
||||
SimpleTest.finish();
|
||||
if (--gCompares == 0) {
|
||||
SimpleTest.finish();
|
||||
}
|
||||
};
|
||||
reader.readAsDataURL(file);
|
||||
}
|
||||
@ -40,8 +44,6 @@ is(jpegfile.type, "image/jpeg",
|
||||
compareAsync(jpegfile, canvas, "image/jpeg");
|
||||
is(jpegfile.name, "bar.jpg", "File name should be what we passed in");
|
||||
|
||||
SimpleTest.finish();
|
||||
|
||||
});
|
||||
</script>
|
||||
<img src="image_yellow75.png" id="yellow75.png" class="resource">
|
||||
|
Loading…
x
Reference in New Issue
Block a user