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

Unified Diff: LayoutTests/inspector-protocol/layers/layers-for-node.html

Issue 18729002: Enable message delivering in inspector-protocol tests when on pause (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 7 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/inspector-protocol/page/javascriptDialogEvents.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/inspector-protocol/layers/layers-for-node.html
diff --git a/LayoutTests/inspector-protocol/layers/layers-for-node.html b/LayoutTests/inspector-protocol/layers/layers-for-node.html
index 8d579543b217895536a2b745e1d872ebbbc9dae5..2c2591ad5a61090661b98362be99f5b3a3170984 100644
--- a/LayoutTests/inspector-protocol/layers/layers-for-node.html
+++ b/LayoutTests/inspector-protocol/layers/layers-for-node.html
@@ -39,7 +39,7 @@ function test()
name: "Get the Document",
command: "DOM.getDocument",
parameters: {},
- callback: getInitialLayerTree
+ callback: makeDeferredCallback(getInitialLayerTree)
});
};
@@ -64,7 +64,7 @@ function test()
name: "Message the page to add a new composited layer",
command: "Runtime.evaluate",
parameters: {"expression": "addCompositedLayer()"},
- callback: getModifiedLayerTree
+ callback: makeDeferredCallback(getModifiedLayerTree)
});
};
@@ -78,8 +78,6 @@ function test()
});
};
- var layerCount = 0;
-
function gotModifiedLayerTree(result)
{
dumpLayers(result.layers);
@@ -174,6 +172,16 @@ function test()
test.callback(messageObject.result);
});
};
+
+ // Makes next step deferred to let backend do its asynchronous processing and sending us all pending notifications.
+ // Scheduling on timer with no delay is enough deferring.
+ function makeDeferredCallback(callback)
+ {
+ return function(result)
+ {
+ setTimeout(callback.bind(this, result), 0);
+ };
+ }
function assert(name, actual, expected)
{
« no previous file with comments | « no previous file | LayoutTests/inspector-protocol/page/javascriptDialogEvents.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698