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

Side by Side Diff: LayoutTests/inspector/layers/layer-scroll-rects-update.html

Issue 166273018: Added showing slow scroll rectangles in Layers panel. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed layer nodeId issue. Created 6 years, 9 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 unified diff | Download patch
OLDNEW
(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 onGotLayers()
57 {
58 InspectorTest.layerTreeModel._backendNodeIdToNodeId = {
59 "-1": 1,
60 "-2": 2
61 };
62
63 InspectorTest.addResult("Initial scroll rectangles");
64 InspectorTest.layerTreeModel._repopulate(layers);
65 InspectorTest.layerTreeModel.dispatchEventToListeners(WebInspector.Layer TreeModel.Events.LayerTreeChanged);
66 markScrollRects();
67 InspectorTest.dumpViewScrollRects();
68 InspectorTest.dumpModelScrollRects();
69
70 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.
71 InspectorTest.layerTreeModel._repopulate(changedLayers);
72 InspectorTest.layerTreeModel.dispatchEventToListeners(WebInspector.Layer TreeModel.Events.LayerTreeChanged);
73 InspectorTest.dumpViewScrollRects();
74 InspectorTest.dumpModelScrollRects();
75
76 InspectorTest.completeTest();
77 }
78
79 WebInspector.inspectorView.showPanel("layers");
80 InspectorTest.requestLayers(onGotLayers);
caseq 2014/03/20 15:29:10 Do we have to do this?
malch 2014/03/21 07:55:46 Done.
81 }
82 </script>
83 </head>
84 <body onload="runTest()">
85 </body>
86 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698