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

Unified Diff: third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-resize.html

Issue 2738773004: No longer clamp setTimeout(..., 0) to 1ms. (Closed)
Patch Set: update webgl2 conformance expectations as well Created 3 years, 8 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: third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-resize.html
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-resize.html b/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-resize.html
index 432d9b3b133a73621a54cb5b9644ad8ca77d6260..0b58369e5f64ae8a969672abf369afe037ca3ffd 100644
--- a/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-resize.html
+++ b/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-resize.html
@@ -93,31 +93,34 @@ async_test(function(t) {
t.done();
}
});
- // Set timeout acts as a sync barrier to allow commit to propagate
- setTimeout(function(){
- t.step(function() {
- // Verify that commit() asynchronously updates the size of its placeholder canvas.
- assert_equals(placeholder.width, 10);
- assert_equals(placeholder.height, 20);
- });
- t.step(function() {
- // Verify that width/height attributes are still settable even though they have no effect.
- placeholder.width = 50;
- placeholder.height = 60;
- assert_equals(placeholder.width, 50);
- assert_equals(placeholder.height, 60);
- });
- createImageBitmap(placeholder).then(image => {
+ // TODO(junov): Use the Promise returned by commit to schedule after the
+ // commit. (crbug.com/709484)
+ setTimeout(function() {
+ setTimeout(function() {
t.step(function() {
- // Verify that an image grabbed from the placeholder has the correct dimensions
- assert_equals(image.width, 30);
- assert_equals(image.height, 40);
+ // Verify that commit() asynchronously updates the size of its placeholder canvas.
+ assert_equals(placeholder.width, 10);
+ assert_equals(placeholder.height, 20);
});
- asyncStepsCompleted = asyncStepsCompleted + 1;
- if (asyncStepsCompleted == 2) {
- t.done();
- }
- });
+ t.step(function() {
+ // Verify that width/height attributes are still settable even though they have no effect.
+ placeholder.width = 50;
+ placeholder.height = 60;
+ assert_equals(placeholder.width, 50);
+ assert_equals(placeholder.height, 60);
+ });
+ createImageBitmap(placeholder).then(image => {
+ t.step(function() {
+ // Verify that an image grabbed from the placeholder has the correct dimensions
+ assert_equals(image.width, 30);
+ assert_equals(image.height, 40);
+ });
+ asyncStepsCompleted = asyncStepsCompleted + 1;
+ if (asyncStepsCompleted == 2) {
+ t.done();
+ }
+ });
+ }, 0);
}, 0);
}, "Verify that resizing an OffscreenCanvas with a 2d context propagates the new size to its placeholder canvas asynchronously, upon commit.");
@@ -180,7 +183,7 @@ async_test(function(t) {
t.done();
}
});
- }, 0);
+ }, 1);
}, "Verify that resizing an OffscreenCanvas with a webgl context propagates the new size to its placeholder canvas asynchronously, upon commit.");
async_test(function(t){
@@ -210,7 +213,7 @@ async_test(function(t){
assert_array_equals(pixel3, [0, 0, 0, 0]);
});
t.done();
- });
+ }, 1);
}, "Verify that drawImage uses the size of the committed frame as the intinsic size of a placeholder canvas.");
-</script>
+</script>

Powered by Google App Engine
This is Rietveld 408576698