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", unchanged: true } |
| 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", unchanged: true}, |
| 21 {rect: {x: 10, y: 0, width: 10, height: 10}, type: "TouchEventHandle
r", unchanged: true} |
| 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
", unchanged: true} |
| 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 onGotLayers() |
| 48 { |
| 49 InspectorTest.addResult("Initial scroll rectangles"); |
| 50 InspectorTest._layerTreeModel._layerTreeChanged(layers); |
| 51 InspectorTest.dumpViewScrollRects(); |
| 52 InspectorTest.dumpModelScrollRects(); |
| 53 |
| 54 InspectorTest.addResult("Updated scroll rectangles"); |
| 55 InspectorTest._layerTreeModel._layerTreeChanged(changedLayers); |
| 56 InspectorTest.dumpViewScrollRects(); |
| 57 InspectorTest.dumpModelScrollRects(); |
| 58 |
| 59 InspectorTest.completeTest(); |
| 60 } |
| 61 |
| 62 WebInspector.showPanel("layers"); |
| 63 InspectorTest.requestLayers(onGotLayers); |
| 64 } |
| 65 </script> |
| 66 </head> |
| 67 <body onload="runTest()"> |
| 68 </body> |
| 69 </html> |
OLD | NEW |