summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/inspector/layers/layer-canvas-log.html
blob: f3596cb6e4a0e267c15b8a31be706eac18afca52 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<html>
<head>
<script src="../../http/tests/inspector/inspector-test.js"></script>
<script src="../../http/tests/inspector/layers-test.js"></script>
<script>
function test()
{
    function onSnapshotDone(snapshot)
    {
        var wrappedCallback = InspectorBackend.wrapClientCallback(onHistoryReceived, "LayerTreeAgent.snapshotCommandLog(): ");
        LayerTreeAgent.snapshotCommandLog(snapshot._id, wrappedCallback);
    }

    function onHistoryReceived(history)
    {
        InspectorTest.addResult("Canvas log:");
        InspectorTest.addObject(history, {"genID": "skip"});
        InspectorTest.completeTest();
    }

    function onGotLayers()
    {
        var layer = InspectorTest.findLayerByNodeIdAttribute("a");
        layer.requestSnapshot(onSnapshotDone);
    }

    InspectorTest.requestLayers(onGotLayers);
}
</script>
</head>
<body onload="runTest()">
<div id="a" style="transform: translateZ(0px); background-color:blue; width:100px; height:100px;">
    <div style="width:50px; height:50px; background-color:red;"></div>
    <img src="../timeline/resources/test.png">
    <svg>
        <rect x="0" y="0" width="10" height="10" style="opacity:0.5"/>
    </svg>
  </div>
</body>
</html>