Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(178)

Unified Diff: LayoutTests/inspector/layer-scroll-rects.html

Issue 166273018: Added showing slow scroll rectangles in Layers panel. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added test. Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/inspector/layer-scroll-rects.html
diff --git a/LayoutTests/inspector/layer-scroll-rects.html b/LayoutTests/inspector/layer-scroll-rects.html
new file mode 100644
index 0000000000000000000000000000000000000000..9f40e30adbe41f5dfea2a8d8b38f14665e44e8a2
--- /dev/null
+++ b/LayoutTests/inspector/layer-scroll-rects.html
@@ -0,0 +1,72 @@
+<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},
caseq 2014/02/24 07:18:06 please make layerIds strings to match the protocol
malch 2014/02/24 13:59:15 Done.
+ {layerId: 2, offsetX: 0, offsetY: 0, width: 0, height: 0, paintCount: 0, parentLayerId: 1},
+ {layerId: 3, offsetX: 0, offsetY: 0, width: 50, height: 50, paintCount: 0, parentLayerId: 2, nodeId: 1}
+ ];
+ 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, nodeId: 1}
+ ];
+ var scrollRects = [
+ {layerId: 3, x: 10, y: 10, width: 10, height: 10, type: "WheelEventHandler", unchanged: true},
caseq 2014/02/24 07:18:06 unchanged?
malch 2014/02/24 13:59:15 Done.
+ {layerId: 2, x: 0, y: 10, width: 10, height: 10, type: "RepaintsOnScroll", unchanged: true},
+ {layerId: 3, x: 10, y: 0, width: 10, height: 10, type: "TouchEventHandler", unchanged: true}
+ ];
+ var changedScrollRects = [
+ {layerId: 3, x: 0, y: 0, width: 10, height: 10, type: "WheelEventHandler"},
+ {layerId: 3, x: 10, y: 0, width: 10, height: 10, type: "TouchEventHandler"}
+ ];
+
+ function dumpScrollRect(element)
+ {
+ InspectorTest.addResult("scrollRect: " + JSON.stringify(element.__scrollRect));
+ }
+
+ function dumpViewScrollRects()
+ {
+ InspectorTest.addResult("View elements dump");
+ var root = WebInspector.panel("layers")._layers3DView._rotatingContainerElement;
+ var layerElement = root.firstElementChild;
+ for (var element = layerElement.firstElementChild; element; element = element.nextSibling) {
caseq 2014/02/24 07:18:06 This does not seem to recurse into sub-layers.
malch 2014/02/24 13:59:15 Done.
+ if (element.className !== "scroll-rect")
caseq 2014/02/24 07:18:06 Use root.querySelectorAll(".scroll-rect")
malch 2014/02/24 13:59:15 Done.
+ continue;
+ dumpScrollRect(element);
+ }
+ }
+
+ function dumpModelScrollRects()
+ {
+ InspectorTest.addResult("Model elements dump");
+ InspectorTest.addResult("scrollRectsByLayerId: " + JSON.stringify(InspectorTest._layerTreeModel._scrollRectsByLayerId));
+ }
+
+ function onGotLayers()
+ {
+ InspectorTest.addResult("First dump");
caseq 2014/02/24 07:18:06 "Initial scroll rectangles"
malch 2014/02/24 13:59:15 Done.
+ InspectorTest._layerTreeModel._layerTreeChanged(layers, scrollRects);
+ dumpViewScrollRects();
+ dumpModelScrollRects();
+
+ InspectorTest.addResult("Second dump");
caseq 2014/02/24 07:18:06 "Updated scroll rectangles"
malch 2014/02/24 13:59:15 Done.
+ InspectorTest._layerTreeModel._layerTreeChanged(changedLayers, changedScrollRects);
+ dumpViewScrollRects();
+ dumpModelScrollRects();
+
+ InspectorTest.completeTest();
+ }
+
+ WebInspector.showPanel("layers");
+ InspectorTest.requestLayers(onGotLayers);
+}
+</script>
+</head>
+<body onload="runTest()">
+</body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/inspector/layer-scroll-rects-expected.txt » ('j') | Source/devtools/front_end/LayerTreeModel.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698