1 function initialize_layersTest()
5 var layerTreeChangeCallback;
7 InspectorTest.step = function(test)
9 InspectorTest.sendCommand(test.command, test.parameters, function(messageObject) {
10 if (messageObject.hasOwnProperty("error")) {
11 InspectorTest.log("FAIL: " + messageObject.error.message + " (" + messageObject.error.code + ")");
12 InspectorTest.completeTest();
16 test.callback(messageObject.result);
20 function onLayerTreeChanged(message)
22 layers = message.params.layers;
23 if (layerTreeChangeCallback) {
24 var callback = layerTreeChangeCallback;
25 layerTreeChangeCallback = null;
30 InspectorTest.setLayerTreeChangeCallback = function(callback)
32 layerTreeChangeCallback = callback;
35 InspectorTest.enableLayerTreeAgent = function(callback)
41 InspectorTest.eventHandler["LayerTree.layerTreeDidChange"] = onLayerTreeChanged;
42 InspectorTest.setLayerTreeChangeCallback(callback);
43 InspectorTest.sendCommand("DOM.getDocument", {}, function() {
44 InspectorTest.sendCommand("LayerTree.enable", {}, function() { });