Index: third_party/WebKit/LayoutTests/csspaint/resources/test-runner-simple-paint-worklet.js |
diff --git a/third_party/WebKit/LayoutTests/csspaint/resources/test-runner-simple-paint-worklet.js b/third_party/WebKit/LayoutTests/csspaint/resources/test-runner-simple-paint-worklet.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..95c7b146151d80f783b6216d708a1813235ed75d |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/csspaint/resources/test-runner-simple-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: |
+// testRunnerSimplePaintWorklet('/* worklet code goes here. */'); |
+ |
+function testRunnerSimplePaintWorklet(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(); |
Justin Novosad
2016/04/06 15:52:45
I am a bit concerned about this call to notifyDone
ikilpatrick
2016/04/07 23:03:00
I couldn't think of a shorter name :) done.
|
+ } |
+ }); |
+ }); |
+} |