Chromium Code Reviews| Index: LayoutTests/fast/compositorworker/compositor-proxy-disconnect-worker-terminate.html |
| diff --git a/LayoutTests/fast/compositorworker/compositor-proxy-disconnect-worker-terminate.html b/LayoutTests/fast/compositorworker/compositor-proxy-disconnect-worker-terminate.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..719708c7e8575012863d7e55d0e094b04c5e2cbb |
| --- /dev/null |
| +++ b/LayoutTests/fast/compositorworker/compositor-proxy-disconnect-worker-terminate.html |
| @@ -0,0 +1,40 @@ |
| +<!DOCTYPE html> |
| +<div id="container"></div> |
| +<script src="../../resources/testharness.js"></script> |
| +<script src="../../resources/testharnessreport.js"></script> |
| +<script> |
| + |
| +if (window.testRunner) |
| + testRunner.dumpAsText(); |
|
esprehn
2015/04/08 00:17:13
doesn't testharness take care of this?
sadrul
2015/04/08 02:35:03
You are right. Done.
|
| + |
| +var test = async_test("This test checks that an element's compositor proxy cannot be mutated after disconnect()."); |
|
esprehn
2015/04/08 00:17:13
async_test("...", function() {
});
sadrul
2015/04/08 02:35:03
Done.
|
| + |
| +assert_not_equals('undefined', typeof window.internals); |
| +var worker = new CompositorWorker('resources/proxy-idle.js'); |
| +worker.onmessage = function() { |
| + var docLayer = JSON.parse(window.internals.layerTreeAsText(document)); |
| + assert_equals(1, docLayer.children.length); |
| + assert_equals(1, docLayer.children[0].children.length); |
| + |
| + worker.terminate(); |
| + |
| + // Give some time for the worker to terminate. |
| + window.setTimeout(function() { |
| + window.GCController.collect(); |
| + docLayer = JSON.parse(window.internals.layerTreeAsText(document)); |
| + assert_equals(1, docLayer.children.length); |
| + assert_equals('undefined', typeof docLayer.children[0].children); |
| + test.done(); |
| + }, 400); |
|
esprehn
2015/04/08 00:17:13
This is not acceptable, this test is going to take
sadrul
2015/04/08 02:35:03
Removed. I didn't know about waitUntilWorkerThread
|
| +} |
| + |
| +var proxy = new CompositorProxy(document.getElementById('container'), ['opacity']); |
| +worker.postMessage(proxy); |
| + |
| +var container = document.getElementById('container'); |
| +var docLayer = JSON.parse(window.internals.layerTreeAsText(document)); |
| +assert_equals(1, docLayer.children.length); |
| +assert_equals(1, docLayer.children[0].children.length); |
| +proxy.disconnect(); |
| + |
| +</script> |