OLD | NEW |
(Empty) | |
| 1 <html> |
| 2 <head> |
| 3 <script src="../../http/tests/inspector/inspector-test.js"></script> |
| 4 <script src="../../http/tests/inspector/layers-test.js"></script> |
| 5 <script> |
| 6 function test() |
| 7 { |
| 8 var layers = [ |
| 9 { |
| 10 layerId: "1", offsetX: 0, offsetY: 0, width: 0, height: 0, paintCount: 0 |
| 11 }, |
| 12 { |
| 13 layerId: "2", offsetX: 0, offsetY: 0, width: 0, height: 0, paintCount: 0
, parentLayerId: "1", scrollRects: [ |
| 14 { rect: {x: 0, y: 10, width: 10, height: 10}, type: "RepaintsOnScrol
l"} |
| 15 ] |
| 16 }, |
| 17 { |
| 18 layerId: "3", offsetX: 0, offsetY: 0, width: 50, height: 50, paintCount:
0, parentLayerId: "2", backendNodeId: -1, |
| 19 scrollRects: [ |
| 20 {rect: {x: 10, y: 10, width: 10, height: 10}, type: "WheelEventHandl
er"}, |
| 21 {rect: {x: 10, y: 0, width: 10, height: 10}, type: "TouchEventHandle
r"} |
| 22 ] |
| 23 }, |
| 24 { |
| 25 layerId: "4", offsetX: 0, offsetY: 0, width: 50, height: 50, paintCount:
0, parentLayerId: "3", backendNodeId: -2, scrollRects: [ |
| 26 {rect: {x: 0, y: 0, width: 10, height: 10}, type: "TouchEventHandler
"} |
| 27 ] |
| 28 } |
| 29 ]; |
| 30 var changedLayers = [ |
| 31 { |
| 32 layerId: "1", offsetX: 0, offsetY: 0, width: 0, height: 0, paintCount: 0 |
| 33 }, |
| 34 { |
| 35 layerId: "3", offsetX: 0, offsetY: 0, width: 50, height: 50, paintCount:
0, parentLayerId: "1", backendNodeId: -1, scrollRects: [ |
| 36 {rect: {x: 0, y: 0, width: 10, height: 10}, type: "WheelEventHandler
"}, |
| 37 {rect: {x: 10, y: 0, width: 10, height: 10}, type: "TouchEventHandle
r"} |
| 38 ] |
| 39 }, |
| 40 { |
| 41 layerId: "4", offsetX: 0, offsetY: 0, width: 50, height: 50, paintCount:
0, parentLayerId: "3", backendNodeId: -2, scrollRects: [ |
| 42 {rect: {x: 0, y: 0, width: 10, height: 10}, type: "TouchEventHandler
"}, |
| 43 {rect: {x: 10, y: 10, width: 10, height: 10}, type: "TouchEventHandl
er"} |
| 44 ] |
| 45 } |
| 46 ]; |
| 47 |
| 48 function markScrollRects() |
| 49 { |
| 50 var root = WebInspector.inspectorView.panel("layers")._layers3DView._rot
atingContainerElement; |
| 51 Array.prototype.forEach.call(root.querySelectorAll('.scroll-rect'), func
tion(element) { |
| 52 element.__unchanged = true; |
| 53 }); |
| 54 } |
| 55 |
| 56 function sendLayersAndDump(caption, layers) |
| 57 { |
| 58 InspectorTest.addResult(caption); |
| 59 InspectorTest.layerTreeModel._repopulate(layers); |
| 60 InspectorTest.layerTreeModel.dispatchEventToListeners(WebInspector.Layer
TreeModel.Events.LayerTreeChanged); |
| 61 InspectorTest.dumpViewScrollRects(); |
| 62 InspectorTest.dumpModelScrollRects(); |
| 63 } |
| 64 |
| 65 |
| 66 WebInspector.inspectorView.showPanel("layers"); |
| 67 InspectorTest.layerTreeModel._backendNodeIdToNodeId = { |
| 68 "-1": 1, |
| 69 "-2": 2 |
| 70 }; |
| 71 sendLayersAndDump("Initial scroll rectangles", layers); |
| 72 markScrollRects(); |
| 73 sendLayersAndDump("Updated scroll rectangles", changedLayers); |
| 74 InspectorTest.completeTest(); |
| 75 } |
| 76 </script> |
| 77 </head> |
| 78 <body onload="runTest()"> |
| 79 </body> |
| 80 </html> |
OLD | NEW |