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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector-protocol/layers/layer-protocol-test.js

Issue 2942573003: [DevTools] New harness for inspector-protocol layout tests (Closed)
Patch Set: Protocol -> dp Created 3 years, 6 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 function initialize_layersTest()
2 {
3
4 var layers;
5 var layerTreeChangeCallback;
6
7 InspectorTest.step = function(test)
8 {
9 InspectorTest.sendCommand(test.command, test.parameters, function(messageObj ect) {
10 if (messageObject.hasOwnProperty("error")) {
11 InspectorTest.log("FAIL: " + messageObject.error.message + " (" + me ssageObject.error.code + ")");
12 InspectorTest.completeTest();
13 return;
14 }
15 if (test.callback)
16 test.callback(messageObject.result);
17 });
18 };
19
20 function onLayerTreeChanged(message)
21 {
22 layers = message.params.layers;
23 if (layerTreeChangeCallback) {
24 var callback = layerTreeChangeCallback;
25 layerTreeChangeCallback = null;
26 callback(layers);
27 }
28 }
29
30 InspectorTest.setLayerTreeChangeCallback = function(callback)
31 {
32 layerTreeChangeCallback = callback;
33 }
34
35 InspectorTest.enableLayerTreeAgent = function(callback)
36 {
37 if (layers) {
38 callback(layers);
39 return;
40 }
41 InspectorTest.eventHandler["LayerTree.layerTreeDidChange"] = onLayerTreeChan ged;
42 InspectorTest.setLayerTreeChangeCallback(callback);
43 InspectorTest.sendCommand("DOM.getDocument", {}, function() {
44 InspectorTest.sendCommand("LayerTree.enable", {}, function() { });
45 });
46 }
47
48 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698