Chromium Code Reviews| Index: LayoutTests/inspector/layers/layer-scroll-rects-update.html |
| diff --git a/LayoutTests/inspector/layers/layer-scroll-rects-update.html b/LayoutTests/inspector/layers/layer-scroll-rects-update.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..b366956aab4fd07ca8619ee1e41378e04e696fbd |
| --- /dev/null |
| +++ b/LayoutTests/inspector/layers/layer-scroll-rects-update.html |
| @@ -0,0 +1,86 @@ |
| +<html> |
| +<head> |
| +<script src="../../http/tests/inspector/inspector-test.js"></script> |
| +<script src="../../http/tests/inspector/layers-test.js"></script> |
| +<script> |
| +function test() |
| +{ |
| + var layers = [ |
| + { |
| + layerId: "1", offsetX: 0, offsetY: 0, width: 0, height: 0, paintCount: 0 |
| + }, |
| + { |
| + layerId: "2", offsetX: 0, offsetY: 0, width: 0, height: 0, paintCount: 0, parentLayerId: "1", scrollRects: [ |
| + { rect: {x: 0, y: 10, width: 10, height: 10}, type: "RepaintsOnScroll"} |
| + ] |
| + }, |
| + { |
| + layerId: "3", offsetX: 0, offsetY: 0, width: 50, height: 50, paintCount: 0, parentLayerId: "2", backendNodeId: -1, |
| + scrollRects: [ |
| + {rect: {x: 10, y: 10, width: 10, height: 10}, type: "WheelEventHandler"}, |
| + {rect: {x: 10, y: 0, width: 10, height: 10}, type: "TouchEventHandler"} |
| + ] |
| + }, |
| + { |
| + layerId: "4", offsetX: 0, offsetY: 0, width: 50, height: 50, paintCount: 0, parentLayerId: "3", backendNodeId: -2, scrollRects: [ |
| + {rect: {x: 0, y: 0, width: 10, height: 10}, type: "TouchEventHandler"} |
| + ] |
| + } |
| + ]; |
| + var changedLayers = [ |
| + { |
| + layerId: "1", offsetX: 0, offsetY: 0, width: 0, height: 0, paintCount: 0 |
| + }, |
| + { |
| + layerId: "3", offsetX: 0, offsetY: 0, width: 50, height: 50, paintCount: 0, parentLayerId: "1", backendNodeId: -1, scrollRects: [ |
| + {rect: {x: 0, y: 0, width: 10, height: 10}, type: "WheelEventHandler"}, |
| + {rect: {x: 10, y: 0, width: 10, height: 10}, type: "TouchEventHandler"} |
| + ] |
| + }, |
| + { |
| + layerId: "4", offsetX: 0, offsetY: 0, width: 50, height: 50, paintCount: 0, parentLayerId: "3", backendNodeId: -2, scrollRects: [ |
| + {rect: {x: 0, y: 0, width: 10, height: 10}, type: "TouchEventHandler"}, |
| + {rect: {x: 10, y: 10, width: 10, height: 10}, type: "TouchEventHandler"} |
| + ] |
| + } |
| + ]; |
| + |
| + function markScrollRects() |
| + { |
| + var root = WebInspector.inspectorView.panel("layers")._layers3DView._rotatingContainerElement; |
| + Array.prototype.forEach.call(root.querySelectorAll('.scroll-rect'), function(element) { |
| + element.__unchanged = true; |
| + }); |
| + } |
| + |
| + function onGotLayers() |
| + { |
| + InspectorTest.layerTreeModel._backendNodeIdToNodeId = { |
| + "-1": 1, |
| + "-2": 2 |
| + }; |
| + |
| + InspectorTest.addResult("Initial scroll rectangles"); |
| + InspectorTest.layerTreeModel._repopulate(layers); |
| + InspectorTest.layerTreeModel.dispatchEventToListeners(WebInspector.LayerTreeModel.Events.LayerTreeChanged); |
| + markScrollRects(); |
| + InspectorTest.dumpViewScrollRects(); |
| + InspectorTest.dumpModelScrollRects(); |
| + |
| + InspectorTest.addResult("Updated scroll rectangles"); |
|
caseq
2014/03/20 15:29:10
Extract this block into a function?
malch
2014/03/21 07:55:46
Done.
|
| + InspectorTest.layerTreeModel._repopulate(changedLayers); |
| + InspectorTest.layerTreeModel.dispatchEventToListeners(WebInspector.LayerTreeModel.Events.LayerTreeChanged); |
| + InspectorTest.dumpViewScrollRects(); |
| + InspectorTest.dumpModelScrollRects(); |
| + |
| + InspectorTest.completeTest(); |
| + } |
| + |
| + WebInspector.inspectorView.showPanel("layers"); |
| + InspectorTest.requestLayers(onGotLayers); |
|
caseq
2014/03/20 15:29:10
Do we have to do this?
malch
2014/03/21 07:55:46
Done.
|
| +} |
| +</script> |
| +</head> |
| +<body onload="runTest()"> |
| +</body> |
| +</html> |