Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <html> | |
| 2 <head> | |
| 3 <style> | |
| 4 .layer { | |
| 5 -webkit-transform: translateZ(10px); | |
| 6 opacity: 0.8; | |
| 7 } | |
| 8 </style> | |
| 9 <script src="../../http/tests/inspector/inspector-test.js"></script> | |
| 10 <script src="../../http/tests/inspector/layers-test.js"></script> | |
| 11 <script> | |
| 12 window.quietUntilDone = true; | |
| 13 | |
| 14 function updateGeometry() | |
| 15 { | |
| 16 document.getElementById("a").style.width = "300px"; | |
| 17 } | |
| 18 | |
| 19 function test() | |
| 20 { | |
| 21 setTimeout(InspectorTest.completeTest.bind(InspectorTest), 3000); | |
|
pfeldman
2014/02/20 15:47:22
Please remove.
| |
| 22 var layersBeforeHighlight = []; | |
| 23 | |
| 24 InspectorTest.requestLayers(step1); | |
| 25 | |
| 26 function step1() | |
| 27 { | |
| 28 // Assure layer objects are not re-created during updates. | |
| 29 InspectorTest._layerTreeModel.forEachLayer(function(layer) { layersBefor eHighlight.push(layer.id()); }); | |
| 30 DOMAgent.highlightRect(0, 0, 200, 200, {r:255, g:0, b:0}); | |
| 31 InspectorTest.evaluateAndRunWhenTreeChanges("requestAnimationFrame(updat eGeometry)", step2); | |
| 32 } | |
| 33 | |
| 34 function step2() | |
| 35 { | |
| 36 var layersAfterHighlight = []; | |
| 37 InspectorTest._layerTreeModel.forEachLayer(function(layer) { layersAfter Highlight.push(layer.id()); }); | |
| 38 layersBeforeHighlight.sort(); | |
| 39 layersAfterHighlight.sort(); | |
| 40 InspectorTest.assertEquals(JSON.stringify(layersBeforeHighlight), JSON.s tringify(layersAfterHighlight)); | |
| 41 InspectorTest.addResult("DONE"); | |
| 42 InspectorTest.completeTest(); | |
| 43 } | |
| 44 } | |
| 45 | |
| 46 </script> | |
| 47 </head> | |
| 48 <body onload="runTest()"> | |
| 49 <div id="a" style="width: 200px; height: 200px" class="layer"> | |
| 50 </div> | |
| 51 </body> | |
| 52 </html> | |
| OLD | NEW |