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

Side by Side Diff: third_party/WebKit/LayoutTests/virtual/threaded/fast/compositorworker/compositor-proxy-disconnect-worker-terminate.html

Issue 2041193005: [compositorworker] compositor proxy mutation updates underlying layers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@compositor-worker-upstream-registration
Patch Set: Use RAII pattern Created 4 years, 6 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 unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <div id="container"></div> 2 <div id="container"></div>
3 <script src="../../../../fast/workers/resources/worker-util.js"></script> 3 <script src="../../../../fast/workers/resources/worker-util.js"></script>
4 <script src="../../../../resources/testharness.js"></script> 4 <script src="../../../../resources/testharness.js"></script>
5 <script src="../../../../resources/testharnessreport.js"></script> 5 <script src="../../../../resources/testharnessreport.js"></script>
6 <script> 6 <script>
7 7
8 var test = async_test(function() { 8 var test = async_test(function() {
9 assert_not_equals('undefined', typeof window.internals); 9 assert_not_equals('undefined', typeof window.internals);
10 var worker = new CompositorWorker('resources/proxy-idle.js'); 10 var worker = new CompositorWorker('resources/proxy-idle.js');
11 worker.onmessage = function() { 11 worker.onmessage = function() {
12 var docLayer = JSON.parse(window.internals.layerTreeAsText(document)); 12 var docLayer = JSON.parse(window.internals.layerTreeAsText(document));
13 console.log(JSON.stringify(docLayer));
13 assert_equals(1, docLayer.children.length); 14 assert_equals(1, docLayer.children.length);
14 assert_equals(1, docLayer.children[0].children.length); 15 assert_equals(1, docLayer.children[0].children.length);
15 16
16 worker.terminate(); 17 worker.terminate();
17 18
18 // Give some time for the worker to terminate. 19 // Give some time for the worker to terminate.
19 waitUntilWorkerThreadsExit(function() { 20 waitUntilWorkerThreadsExit(function() {
20 docLayer = JSON.parse(window.internals.layerTreeAsText(document)); 21 docLayer = JSON.parse(window.internals.layerTreeAsText(document));
21 assert_equals(1, docLayer.children.length); 22 assert_equals(1, docLayer.children.length);
22 assert_equals('undefined', typeof docLayer.children[0].children); 23 assert_equals('undefined', typeof docLayer.children[0].children);
23 test.done(); 24 test.done();
24 }); 25 });
25 } 26 }
26 27
27 var proxy = new CompositorProxy(document.getElementById('container'), ['opac ity']); 28 var proxy = new CompositorProxy(document.getElementById('container'), ['opac ity']);
28 worker.postMessage(proxy); 29 worker.postMessage(proxy);
29 30
30 var container = document.getElementById('container'); 31 var container = document.getElementById('container');
31 var docLayer = JSON.parse(window.internals.layerTreeAsText(document)); 32 var docLayer = JSON.parse(window.internals.layerTreeAsText(document));
32 assert_equals(1, docLayer.children.length); 33 assert_equals(1, docLayer.children.length);
33 assert_equals(1, docLayer.children[0].children.length); 34 assert_equals(1, docLayer.children[0].children.length);
34 proxy.disconnect(); 35 proxy.disconnect();
35 }, "This test checks that an element's compositor proxy cannot be mutated after disconnect()."); 36 }, "This test checks that the layer is kept alive by a worker only proxy.");
36 37
37 </script> 38 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698