| <html> |
| <head> |
| <style> |
| .layer { |
| transform: translateZ(10px); |
| opacity: 0.8; |
| } |
| </style> |
| <script src="../../http/tests/inspector/inspector-test.js"></script> |
| <script src="../../http/tests/inspector/layers-test.js"></script> |
| <script> |
| |
| function updateGeometry() |
| { |
| document.getElementById("a").style.width = "300px"; |
| } |
| |
| function test() |
| { |
| var layersBeforeHighlight = []; |
| |
| InspectorTest.requestLayers(step1); |
| |
| function step1() |
| { |
| // Assure layer objects are not re-created during updates. |
| InspectorTest.layerTreeModel().layerTree().forEachLayer(function(layer) { layersBeforeHighlight.push(layer.id()); }); |
| InspectorTest.DOMAgent.highlightRect(0, 0, 200, 200, {r:255, g:0, b:0}); |
| InspectorTest.evaluateAndRunWhenTreeChanges("requestAnimationFrame(updateGeometry)", step2); |
| } |
| |
| function step2() |
| { |
| var layersAfterHighlight = []; |
| InspectorTest.layerTreeModel().layerTree().forEachLayer(function(layer) { layersAfterHighlight.push(layer.id()); }); |
| layersBeforeHighlight.sort(); |
| layersAfterHighlight.sort(); |
| InspectorTest.assertEquals(JSON.stringify(layersBeforeHighlight), JSON.stringify(layersAfterHighlight)); |
| InspectorTest.addResult("DONE"); |
| InspectorTest.completeTest(); |
| } |
| } |
| |
| </script> |
| </head> |
| <body onload="runTest()"> |
| <div id="a" style="width: 200px; height: 200px" class="layer"> |
| </div> |
| </body> |
| </html> |