Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(300)

Unified Diff: LayoutTests/fast/canvas/canvas-createImageBitmap-animated.html

Issue 1304093006: Add a new API for testing animated images (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase harder Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/fast/canvas/canvas-createImageBitmap-animated.html
diff --git a/LayoutTests/fast/canvas/canvas-createImageBitmap-animated.html b/LayoutTests/fast/canvas/canvas-createImageBitmap-animated.html
index 524ee649b1f2c627a90dbc75a5c30e05eb99d182..e6acaeb6c6833d9f6086a170a26d1fac96347c9a 100644
--- a/LayoutTests/fast/canvas/canvas-createImageBitmap-animated.html
+++ b/LayoutTests/fast/canvas/canvas-createImageBitmap-animated.html
@@ -20,22 +20,20 @@
var ctx = canvas.getContext("2d");
var img = new Image();
- img.src = 'resources/green-red-animated.gif';
img.onload = imageLoaded;
+ img.src = 'resources/green-red-animated.gif';
function imageLoaded() {
- // The gif switches from green to red in 10ms. We wait 50ms to ensure that the gif will have changed colors.
// If the ImageBitmap is green, we know that it is a snapshot of the gif's 0th frame.
- window.setTimeout(function() {
- createImageBitmap(img).then(function (imageBitmap) {
- ctx.drawImage(imageBitmap, 0, 0);
- shouldBeGreen(100, 100);
- finishJSTest();
- }, function() {
- testFailed("Promise was rejected.");
- finishJSTest();
- });
- }, 50);
+ window.internals.advanceImageAnimation(img);
+ createImageBitmap(img).then(function (imageBitmap) {
+ ctx.drawImage(imageBitmap, 0, 0);
+ shouldBeGreen(100, 100);
+ finishJSTest();
+ }, function() {
+ testFailed("Promise was rejected.");
+ finishJSTest();
+ });
}
</script>
</body>

Powered by Google App Engine
This is Rietveld 408576698