summaryrefslogtreecommitdiff
path: root/deps/v8/test/inspector/protocol-test.js
diff options
context:
space:
mode:
authorMichaël Zasso <targos@protonmail.com>2017-05-02 10:50:00 +0200
committerMichaël Zasso <targos@protonmail.com>2017-05-06 20:02:35 +0200
commit60d1aac8d225e844e68ae48e8f3d58802e635fbe (patch)
tree922f347dd054db18d88666fad7181e5a777f4022 /deps/v8/test/inspector/protocol-test.js
parent73d9c0f903ae371cd5011af64c3a6f69a1bda978 (diff)
downloadnode-new-60d1aac8d225e844e68ae48e8f3d58802e635fbe.tar.gz
deps: update V8 to 5.8.283.38
PR-URL: https://github.com/nodejs/node/pull/12784 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Diffstat (limited to 'deps/v8/test/inspector/protocol-test.js')
-rw-r--r--deps/v8/test/inspector/protocol-test.js34
1 files changed, 28 insertions, 6 deletions
diff --git a/deps/v8/test/inspector/protocol-test.js b/deps/v8/test/inspector/protocol-test.js
index 37e6447f79..d62c2e0c29 100644
--- a/deps/v8/test/inspector/protocol-test.js
+++ b/deps/v8/test/inspector/protocol-test.js
@@ -20,7 +20,8 @@ Protocol = new Proxy({}, {
var eventName = match[2];
eventName = eventName.charAt(0).toLowerCase() + eventName.slice(1);
if (match[1])
- return (args) => InspectorTest._waitForEventPromise(`${agentName}.${eventName}`, args || {});
+ return () => InspectorTest._waitForEventPromise(
+ `${agentName}.${eventName}`);
else
return (listener) => { InspectorTest._eventHandler[`${agentName}.${eventName}`] = listener };
}
@@ -112,6 +113,21 @@ InspectorTest.logCallFrames = function(callFrames)
}
}
+InspectorTest.logAsyncStackTrace = function(asyncStackTrace)
+{
+ while (asyncStackTrace) {
+ if (asyncStackTrace.promiseCreationFrame) {
+ var frame = asyncStackTrace.promiseCreationFrame;
+ InspectorTest.log(`-- ${asyncStackTrace.description} (${frame.url
+ }:${frame.lineNumber}:${frame.columnNumber})--`);
+ } else {
+ InspectorTest.log(`-- ${asyncStackTrace.description} --`);
+ }
+ InspectorTest.logCallFrames(asyncStackTrace.callFrames);
+ asyncStackTrace = asyncStackTrace.parent;
+ }
+}
+
InspectorTest.completeTest = function()
{
Protocol.Debugger.disable().then(() => quit());
@@ -119,13 +135,17 @@ InspectorTest.completeTest = function()
InspectorTest.completeTestAfterPendingTimeouts = function()
{
- Protocol.Runtime.evaluate({
- expression: "new Promise(resolve => setTimeout(resolve, 0))",
- awaitPromise: true }).then(InspectorTest.completeTest);
+ InspectorTest.waitPendingTasks().then(InspectorTest.completeTest);
+}
+
+InspectorTest.waitPendingTasks = function()
+{
+ return Protocol.Runtime.evaluate({ expression: "new Promise(r => setTimeout(r, 0))//# sourceURL=wait-pending-tasks.js", awaitPromise: true });
}
-InspectorTest.addScript = (string, lineOffset, columnOffset) => compileAndRunWithOrigin(string, "", lineOffset || 0, columnOffset || 0);
-InspectorTest.addScriptWithUrl = (string, url) => compileAndRunWithOrigin(string, url, 0, 0);
+InspectorTest.addScript = (string, lineOffset, columnOffset) => compileAndRunWithOrigin(string, "", lineOffset || 0, columnOffset || 0, false);
+InspectorTest.addScriptWithUrl = (string, url) => compileAndRunWithOrigin(string, url, 0, 0, false);
+InspectorTest.addModule = (string, url, lineOffset, columnOffset) => compileAndRunWithOrigin(string, url, lineOffset || 0, columnOffset || 0, true);
InspectorTest.startDumpingProtocolMessages = function()
{
@@ -213,6 +233,8 @@ InspectorTest._dispatchMessage = function(messageObject)
var eventHandler = InspectorTest._eventHandler[eventName];
if (InspectorTest._scriptMap && eventName === "Debugger.scriptParsed")
InspectorTest._scriptMap.set(messageObject.params.scriptId, JSON.parse(JSON.stringify(messageObject.params)));
+ if (eventName === "Debugger.scriptParsed" && messageObject.params.url === "wait-pending-tasks.js")
+ return;
if (eventHandler)
eventHandler(messageObject);
}