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

Unified Diff: third_party/WebKit/LayoutTests/virtual/threaded/fast/compositorworker/basic-plumbing-main-to-worker.html

Issue 1547893003: WIP - compositor worker mega patch. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 11 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/virtual/threaded/fast/compositorworker/basic-plumbing-main-to-worker.html
diff --git a/third_party/WebKit/LayoutTests/virtual/threaded/fast/compositorworker/basic-plumbing-main-to-worker.html b/third_party/WebKit/LayoutTests/virtual/threaded/fast/compositorworker/basic-plumbing-main-to-worker.html
new file mode 100644
index 0000000000000000000000000000000000000000..5ee667b7f567d0d8c62812308abdb98cf2143d23
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/virtual/threaded/fast/compositorworker/basic-plumbing-main-to-worker.html
@@ -0,0 +1,63 @@
+<!DOCTYPE html>
+<!--
+Tests that a change from the main thread is received on the compositor thread.
+-->
+<script>
+window.jsTestIsAsync = true;
+</script>
+<script src="../../../../resources/js-test.js"></script>
+
+<script>
+if (window.internals) {
+ internals.settings.setCompositorWorkerEnabled(true);
+}
+
+var cw;
+onload = function() {
+ cw = new CompositorWorker('resources/basic-plumbing-main-to-worker.js');
+ cw.onmessage = continueTest;
+ var keys = ['opacity', 'transform', 'scrollTop', 'scrollLeft'];
+ cw.postMessage({'proxy': new CompositorProxy(document.getElementById('box'), keys)});
+}
+
+function continueTest(e) {
+ shouldBe(JSON.stringify(e.data.opacity), '1.0');
+ shouldBe(JSON.stringify(e.data.scrollLeft), '0');
+ shouldBe(JSON.stringify(e.data.scrollTop), '0');
+ shouldBe("'" + JSON.stringify(e.data.transform) + "'", '\'{"0":1,"1":0,"2":0,"3":0,"4":0,"5":1,"6":0,"7":0,"8":0,"9":0,"10":1,"11":0,"12":0,"13":0,"14":0,"15":1}\'');
+ var element = document.getElementById('box');
+ element.scrollLeft = 10;
+ element.scrollTop = 20;
+ element.style.transform = 'translate3d(30px, 0, 0)';
+ element.style.opacity = 0.5;
+ cw.onmessage = finishTest;
+ cw.postMessage({});
+}
+
+function finishTest(e) {
+ shouldBe(JSON.stringify(e.data.opacity), '0.5');
+ shouldBe(JSON.stringify(e.data.scrollLeft), '10');
+ shouldBe(JSON.stringify(e.data.scrollTop), '20');
+ shouldBe("'" + JSON.stringify(e.data.transform) + "'", '\'{"0":1,"1":0,"2":0,"3":0,"4":0,"5":1,"6":0,"7":0,"8":0,"9":0,"10":1,"11":0,"12":30,"13":0,"14":0,"15":1}\'');
+ if (window.testRunner)
+ testRunner.notifyDone();
+}
+</script>
+
+<style>
+#box {
+ width: 100px;
+ height: 100px;
+ overflow: scroll;
+}
+
+#scrolled {
+ background: white;
+ width: 300px;
+ height: 300px;
+}
+</style>
+
+<div id="box">
+ <div id="scrolled"></div>
+</div>

Powered by Google App Engine
This is Rietveld 408576698