Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector-protocol / layers / layer-protocol-test.js
blob16454eaeafb09ba49f5ac06cf39682dfd07d9ebe
1 function initialize_layersTest()
4 var layers;
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();
13             return;
14         }
15         if (test.callback)
16             test.callback(messageObject.result);
17     });
20 function onLayerTreeChanged(message)
22     layers = message.params.layers;
23     if (layerTreeChangeCallback) {
24         var callback = layerTreeChangeCallback;
25         layerTreeChangeCallback = null;
26         callback(layers);
27     }
30 InspectorTest.setLayerTreeChangeCallback = function(callback)
32     layerTreeChangeCallback = callback;
35 InspectorTest.enableLayerTreeAgent = function(callback)
37     if (layers) {
38         callback(layers);
39         return;
40     }
41     InspectorTest.eventHandler["LayerTree.layerTreeDidChange"] = onLayerTreeChanged;
42     InspectorTest.setLayerTreeChangeCallback(callback);
43     InspectorTest.sendCommand("DOM.getDocument", {}, function() {
44         InspectorTest.sendCommand("LayerTree.enable", {}, function() { });
45     });