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

Unified Diff: third_party/WebKit/LayoutTests/csspaint/resources/test-runner-paint-worklet.js

Issue 1866623002: Hook up CSSPaintValue::image to CSS Paint API callback. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed comments + rebase. Created 4 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/csspaint/resources/test-runner-paint-worklet.js
diff --git a/third_party/WebKit/LayoutTests/csspaint/resources/test-runner-paint-worklet.js b/third_party/WebKit/LayoutTests/csspaint/resources/test-runner-paint-worklet.js
new file mode 100644
index 0000000000000000000000000000000000000000..323b6a39b4884411eae2700212c99cec8ae272e0
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/csspaint/resources/test-runner-paint-worklet.js
@@ -0,0 +1,20 @@
+// Given a piece of 'code', runs it in the worklet, then once loaded waits for
+// layout and paint, before finishing the test.
+//
+// Usage:
+// importPaintWorkletAndTerminateTestAfterAsyncPaint('/* worklet code goes here. */');
+
+function importPaintWorkletAndTerminateTestAfterAsyncPaint(code) {
+ if (window.testRunner) {
+ testRunner.waitUntilDone();
+ }
+
+ var blob = new Blob([code]);
+ paintWorklet.import(URL.createObjectURL(blob)).then(function() {
+ runAfterLayoutAndPaint(function() {
+ if (window.testRunner) {
+ testRunner.notifyDone();
+ }
+ });
+ });
+}

Powered by Google App Engine
This is Rietveld 408576698