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", nodeId: 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", nodeId: 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", nodeId: 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", nodeId: 2, scrollRects: [ |
| 42 {rect: {x: 0, y: 0, width: 10, height: 10}, type: "TouchEventHandler
"} |
| 43 ] |
| 44 } |
| 45 ]; |
| 46 |
| 47 function markScrollRects() |
| 48 { |
| 49 var root = WebInspector.panel("layers")._layers3DView._rotatingContainer
Element; |
| 50 Array.prototype.forEach.call(root.querySelectorAll('.scroll-rect'), func
tion(element) { |
| 51 element.__unchanged = true; |
| 52 }); |
| 53 } |
| 54 |
| 55 function onGotLayers() |
| 56 { |
| 57 InspectorTest.addResult("Initial scroll rectangles"); |
| 58 InspectorTest._layerTreeModel._layerTreeChanged(layers); |
| 59 markScrollRects(); |
| 60 InspectorTest.dumpViewScrollRects(); |
| 61 InspectorTest.dumpModelScrollRects(); |
| 62 |
| 63 InspectorTest.addResult("Updated scroll rectangles"); |
| 64 InspectorTest._layerTreeModel._layerTreeChanged(changedLayers); |
| 65 InspectorTest.dumpViewScrollRects(); |
| 66 InspectorTest.dumpModelScrollRects(); |
| 67 |
| 68 InspectorTest.completeTest(); |
| 69 } |
| 70 |
| 71 WebInspector.showPanel("layers"); |
| 72 InspectorTest.requestLayers(onGotLayers); |
| 73 } |
| 74 </script> |
| 75 </head> |
| 76 <body onload="runTest()"> |
| 77 </body> |
| 78 </html> |
OLD | NEW |