Canvas test_url: wait until image is loaded
The loadImages() function has been waiting already since
6318560eca
); but test_url() was not
waiting, which could result in CI flakiness. Anyway tryVerify is better
than waiting 200ms every time it's slow, and will give us a failure
message about isImageLoaded() if it fails.
Pick-to: 6.5 6.2
Task-number: QTBUG-41043
Change-Id: I0bb552d3452d85342d2ffa3b6becded5b01177a8
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
This commit is contained in:
parent
38885dda73
commit
e37d2dac8a
|
@ -11,8 +11,7 @@ CanvasTestCase {
|
|||
canvas.loadImage('rgrg-256x256.png');
|
||||
canvas.loadImage('ggrr-256x256.png');
|
||||
canvas.loadImage('broken.png');
|
||||
while (!canvas.isImageLoaded('green.png'))
|
||||
wait(200);
|
||||
tryVerify(function() { return canvas.isImageLoaded('green.png'); })
|
||||
}
|
||||
|
||||
function test_3args(row) {
|
||||
|
@ -223,6 +222,7 @@ CanvasTestCase {
|
|||
var ctx = canvas.getContext('2d');
|
||||
|
||||
canvas.loadImage(testCase.green);
|
||||
tryVerify(function() { return canvas.isImageLoaded(testCase.green); })
|
||||
ctx.drawImage(testCase.green, 0, 0);
|
||||
comparePixel(ctx, 0,0, 0,255,0,255,2);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue