summaryrefslogtreecommitdiff
path: root/deps/v8/test/inspector/runtime
diff options
context:
space:
mode:
authorMichaël Zasso <targos@protonmail.com>2016-12-23 16:30:57 +0100
committerMichaël Zasso <targos@protonmail.com>2017-01-26 22:46:17 +0100
commit2739185b790e040c3b044c577327f5d44bffad4a (patch)
tree29a466999212f4c85958379d9d400eec8a185ba5 /deps/v8/test/inspector/runtime
parenta67a04d7654faaa04c8da00e42981ebc9fd0911c (diff)
downloadnode-new-2739185b790e040c3b044c577327f5d44bffad4a.tar.gz
deps: update V8 to 5.5.372.40
PR-URL: https://github.com/nodejs/node/pull/9618 Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'deps/v8/test/inspector/runtime')
-rw-r--r--deps/v8/test/inspector/runtime/await-promise-expected.txt119
-rw-r--r--deps/v8/test/inspector/runtime/await-promise.js116
-rw-r--r--deps/v8/test/inspector/runtime/call-function-on-async-expected.txt141
-rw-r--r--deps/v8/test/inspector/runtime/call-function-on-async.js129
-rw-r--r--deps/v8/test/inspector/runtime/clear-of-command-line-api-expected.txt177
-rw-r--r--deps/v8/test/inspector/runtime/clear-of-command-line-api.js117
-rw-r--r--deps/v8/test/inspector/runtime/compile-script-expected.txt66
-rw-r--r--deps/v8/test/inspector/runtime/compile-script.js50
-rw-r--r--deps/v8/test/inspector/runtime/console-api-repeated-in-console-expected.txt6
-rw-r--r--deps/v8/test/inspector/runtime/console-api-repeated-in-console.js37
-rw-r--r--deps/v8/test/inspector/runtime/console-deprecated-methods-expected.txt5
-rw-r--r--deps/v8/test/inspector/runtime/console-deprecated-methods.js28
-rw-r--r--deps/v8/test/inspector/runtime/console-line-and-column-expected.txt52
-rw-r--r--deps/v8/test/inspector/runtime/console-line-and-column.js18
-rw-r--r--deps/v8/test/inspector/runtime/console-log-doesnt-run-microtasks-expected.txt21
-rw-r--r--deps/v8/test/inspector/runtime/console-log-doesnt-run-microtasks.js26
-rw-r--r--deps/v8/test/inspector/runtime/console-timestamp-expected.txt9
-rw-r--r--deps/v8/test/inspector/runtime/console-timestamp.js23
-rw-r--r--deps/v8/test/inspector/runtime/evaluate-async-expected.txt95
-rw-r--r--deps/v8/test/inspector/runtime/evaluate-async-with-wrap-error-expected.txt8
-rw-r--r--deps/v8/test/inspector/runtime/evaluate-async-with-wrap-error.js15
-rw-r--r--deps/v8/test/inspector/runtime/evaluate-async.js58
-rw-r--r--deps/v8/test/inspector/runtime/evaluate-with-context-id-equal-zero-expected.txt9
-rw-r--r--deps/v8/test/inspector/runtime/evaluate-with-context-id-equal-zero.js9
-rw-r--r--deps/v8/test/inspector/runtime/exception-thrown-expected.txt117
-rw-r--r--deps/v8/test/inspector/runtime/exception-thrown.js12
-rw-r--r--deps/v8/test/inspector/runtime/get-properties-expected.txt39
-rw-r--r--deps/v8/test/inspector/runtime/get-properties-on-proxy-expected.txt11
-rw-r--r--deps/v8/test/inspector/runtime/get-properties-on-proxy.js101
-rw-r--r--deps/v8/test/inspector/runtime/get-properties-preview-expected.txt32
-rw-r--r--deps/v8/test/inspector/runtime/get-properties-preview.js25
-rw-r--r--deps/v8/test/inspector/runtime/get-properties.js221
-rw-r--r--deps/v8/test/inspector/runtime/property-on-console-proto-expected.txt12
-rw-r--r--deps/v8/test/inspector/runtime/property-on-console-proto.js25
-rw-r--r--deps/v8/test/inspector/runtime/protocol-works-with-different-locale-expected.txt138
-rw-r--r--deps/v8/test/inspector/runtime/protocol-works-with-different-locale.js40
-rw-r--r--deps/v8/test/inspector/runtime/run-script-async-expected.txt191
-rw-r--r--deps/v8/test/inspector/runtime/run-script-async.js110
-rw-r--r--deps/v8/test/inspector/runtime/set-or-map-entries-expected.txt9
-rw-r--r--deps/v8/test/inspector/runtime/set-or-map-entries.js52
40 files changed, 2469 insertions, 0 deletions
diff --git a/deps/v8/test/inspector/runtime/await-promise-expected.txt b/deps/v8/test/inspector/runtime/await-promise-expected.txt
new file mode 100644
index 0000000000..e23ead86cd
--- /dev/null
+++ b/deps/v8/test/inspector/runtime/await-promise-expected.txt
@@ -0,0 +1,119 @@
+Tests that Runtime.awaitPromise works.
+
+Running test: testResolvedPromise
+{
+ id : <messageId>
+ result : {
+ result : {
+ description : 239
+ type : number
+ value : 239
+ }
+ }
+}
+
+Running test: testRejectedPromise
+{
+ id : <messageId>
+ result : {
+ exceptionDetails : {
+ columnNumber : 0
+ exception : {
+ type : object
+ value : {
+ a : 1
+ }
+ }
+ exceptionId : <exceptionId>
+ lineNumber : 0
+ stackTrace : {
+ callFrames : [
+ ]
+ }
+ text : Uncaught (in promise)
+ }
+ result : {
+ type : object
+ value : {
+ a : 1
+ }
+ }
+ }
+}
+
+Running test: testRejectedPromiseWithStack
+{
+ id : <messageId>
+ result : {
+ exceptionDetails : {
+ columnNumber : 0
+ exception : {
+ description : 239
+ type : number
+ value : 239
+ }
+ exceptionId : <exceptionId>
+ lineNumber : 0
+ stackTrace : {
+ callFrames : [
+ ]
+ parent : {
+ callFrames : [
+ [0] : {
+ columnNumber : 4
+ functionName : rejectPromise
+ lineNumber : 17
+ scriptId : <scriptId>
+ url : test.js
+ }
+ [1] : {
+ columnNumber : 0
+ functionName :
+ lineNumber : 0
+ scriptId : <scriptId>
+ url :
+ }
+ ]
+ description : Promise.reject
+ }
+ }
+ text : Uncaught (in promise)
+ }
+ result : {
+ description : 239
+ type : number
+ value : 239
+ }
+ }
+}
+
+Running test: testPendingPromise
+{
+ id : <messageId>
+ result : {
+ result : {
+ description : 239
+ type : number
+ value : 239
+ }
+ }
+}
+
+Running test: testResolvedWithoutArgsPromise
+{
+ id : <messageId>
+ result : {
+ result : {
+ type : undefined
+ }
+ }
+}
+
+Running test: testGarbageCollectedPromise
+{
+ error : {
+ code : -32000
+ message : Promise was collected
+ }
+ id : <messageId>
+}
diff --git a/deps/v8/test/inspector/runtime/await-promise.js b/deps/v8/test/inspector/runtime/await-promise.js
new file mode 100644
index 0000000000..dc0c132bab
--- /dev/null
+++ b/deps/v8/test/inspector/runtime/await-promise.js
@@ -0,0 +1,116 @@
+// Copyright 2016 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+// Flags: --expose_gc
+
+print("Tests that Runtime.awaitPromise works.");
+
+InspectorTest.addScript(
+`
+var resolveCallback;
+var rejectCallback;
+function createPromise()
+{
+ return new Promise((resolve, reject) => { resolveCallback = resolve; rejectCallback = reject });
+}
+
+function resolvePromise()
+{
+ resolveCallback(239);
+ resolveCallback = undefined;
+ rejectCallback = undefined;
+}
+
+function rejectPromise()
+{
+ rejectCallback(239);
+ resolveCallback = undefined;
+ rejectCallback = undefined;
+}
+
+//# sourceURL=test.js`);
+
+Protocol.Debugger.enable()
+ .then(() => Protocol.Debugger.setAsyncCallStackDepth({ maxDepth: 128 }))
+ .then(() => testSuite());
+
+function testSuite()
+{
+ InspectorTest.runTestSuite([
+ function testResolvedPromise(next)
+ {
+ Protocol.Runtime.evaluate({ expression: "Promise.resolve(239)"})
+ .then(result => Protocol.Runtime.awaitPromise({ promiseObjectId: result.result.result.objectId, returnByValue: false, generatePreview: true }))
+ .then(result => InspectorTest.logMessage(result))
+ .then(() => next());
+ },
+
+ function testRejectedPromise(next)
+ {
+ Protocol.Runtime.evaluate({ expression: "Promise.reject({ a : 1 })"})
+ .then(result => Protocol.Runtime.awaitPromise({ promiseObjectId: result.result.result.objectId, returnByValue: true, generatePreview: false }))
+ .then(result => InspectorTest.logMessage(result))
+ .then(() => next());
+ },
+
+ function testRejectedPromiseWithStack(next)
+ {
+ Protocol.Runtime.evaluate({ expression: "createPromise()"})
+ .then(result => scheduleRejectAndAwaitPromise(result))
+ .then(result => InspectorTest.logMessage(result))
+ .then(() => next());
+
+ function scheduleRejectAndAwaitPromise(result)
+ {
+ var promise = Protocol.Runtime.awaitPromise({ promiseObjectId: result.result.result.objectId });
+ Protocol.Runtime.evaluate({ expression: "rejectPromise()" });
+ return promise;
+ }
+ },
+
+ function testPendingPromise(next)
+ {
+ Protocol.Runtime.evaluate({ expression: "createPromise()"})
+ .then(result => scheduleFulfillAndAwaitPromise(result))
+ .then(result => InspectorTest.logMessage(result))
+ .then(() => next());
+
+ function scheduleFulfillAndAwaitPromise(result)
+ {
+ var promise = Protocol.Runtime.awaitPromise({ promiseObjectId: result.result.result.objectId });
+ Protocol.Runtime.evaluate({ expression: "resolvePromise()" });
+ return promise;
+ }
+ },
+
+ function testResolvedWithoutArgsPromise(next)
+ {
+ Protocol.Runtime.evaluate({ expression: "Promise.resolve()"})
+ .then(result => Protocol.Runtime.awaitPromise({ promiseObjectId: result.result.result.objectId, returnByValue: true, generatePreview: false }))
+ .then(result => InspectorTest.logMessage(result))
+ .then(() => next());
+ },
+
+ function testGarbageCollectedPromise(next)
+ {
+ Protocol.Runtime.evaluate({ expression: "new Promise(() => undefined)" })
+ .then(result => scheduleGCAndawaitPromise(result))
+ .then(result => InspectorTest.logMessage(result))
+ .then(() => next());
+
+ function scheduleGCAndawaitPromise(result)
+ {
+ var objectId = result.result.result.objectId;
+ var promise = Protocol.Runtime.awaitPromise({ promiseObjectId: objectId });
+ gcPromise(objectId);
+ return promise;
+ }
+
+ function gcPromise(objectId)
+ {
+ Protocol.Runtime.releaseObject({ objectId: objectId})
+ .then(() => Protocol.Runtime.evaluate({ expression: "gc()" }));
+ }
+ }
+ ]);
+}
diff --git a/deps/v8/test/inspector/runtime/call-function-on-async-expected.txt b/deps/v8/test/inspector/runtime/call-function-on-async-expected.txt
new file mode 100644
index 0000000000..2d558b85dd
--- /dev/null
+++ b/deps/v8/test/inspector/runtime/call-function-on-async-expected.txt
@@ -0,0 +1,141 @@
+Tests that Runtime.callFunctionOn works with awaitPromise flag.
+
+Running test: testArguments
+{
+ id : <messageId>
+ result : {
+ result : {
+ type : string
+ value : undefined|NaN|[object Object]|[object Object]
+ }
+ }
+}
+
+Running test: testSyntaxErrorInFunction
+{
+ id : <messageId>
+ result : {
+ exceptionDetails : {
+ columnNumber : 2
+ exception : {
+ className : SyntaxError
+ description : SyntaxError: Unexpected token }
+ objectId : <objectId>
+ subtype : error
+ type : object
+ }
+ exceptionId : <exceptionId>
+ lineNumber : 1
+ scriptId : <scriptId>
+ text : Uncaught
+ }
+ result : {
+ className : SyntaxError
+ description : SyntaxError: Unexpected token }
+ objectId : <objectId>
+ subtype : error
+ type : object
+ }
+ }
+}
+
+Running test: testExceptionInFunctionExpression
+{
+ id : <messageId>
+ result : {
+ exceptionDetails : {
+ columnNumber : 15
+ exception : {
+ className : Error
+ description : Error at <anonymous>:1:22 at <anonymous>:1:36
+ objectId : <objectId>
+ subtype : error
+ type : object
+ }
+ exceptionId : <exceptionId>
+ lineNumber : 0
+ scriptId : <scriptId>
+ text : Uncaught
+ }
+ result : {
+ className : Error
+ description : Error at <anonymous>:1:22 at <anonymous>:1:36
+ objectId : <objectId>
+ subtype : error
+ type : object
+ }
+ }
+}
+
+Running test: testFunctionReturnNotPromise
+{
+ code : -32000
+ message : Result of the function call is not a promise
+}
+
+Running test: testFunctionReturnResolvedPromiseReturnByValue
+{
+ id : <messageId>
+ result : {
+ result : {
+ type : object
+ value : {
+ a : 3
+ }
+ }
+ }
+}
+
+Running test: testFunctionReturnResolvedPromiseWithPreview
+{
+ id : <messageId>
+ result : {
+ result : {
+ className : Object
+ description : Object
+ objectId : <objectId>
+ preview : {
+ description : Object
+ overflow : false
+ properties : [
+ [0] : {
+ name : a
+ type : number
+ value : 3
+ }
+ ]
+ type : object
+ }
+ type : object
+ }
+ }
+}
+
+Running test: testFunctionReturnRejectedPromise
+{
+ id : <messageId>
+ result : {
+ exceptionDetails : {
+ columnNumber : 0
+ exception : {
+ type : object
+ value : {
+ a : 3
+ }
+ }
+ exceptionId : <exceptionId>
+ lineNumber : 0
+ stackTrace : {
+ callFrames : [
+ ]
+ }
+ text : Uncaught (in promise)
+ }
+ result : {
+ type : object
+ value : {
+ a : 3
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/deps/v8/test/inspector/runtime/call-function-on-async.js b/deps/v8/test/inspector/runtime/call-function-on-async.js
new file mode 100644
index 0000000000..4a72bbd40f
--- /dev/null
+++ b/deps/v8/test/inspector/runtime/call-function-on-async.js
@@ -0,0 +1,129 @@
+// Copyright 2016 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+print("Tests that Runtime.callFunctionOn works with awaitPromise flag.");
+
+InspectorTest.runTestSuite([
+ function testArguments(next)
+ {
+ callFunctionOn(
+ "({a : 1})",
+ "function(arg1, arg2, arg3, arg4) { return \"\" + arg1 + \"|\" + arg2 + \"|\" + arg3 + \"|\" + arg4; }",
+ [ "undefined", "NaN", "({a:2})", "this"],
+ /* returnByValue */ true,
+ /* generatePreview */ false,
+ /* awaitPromise */ false)
+ .then((result) => InspectorTest.logMessage(result))
+ .then(() => next());
+ },
+
+ function testSyntaxErrorInFunction(next)
+ {
+ callFunctionOn(
+ "({a : 1})",
+ "\n }",
+ [],
+ /* returnByValue */ false,
+ /* generatePreview */ false,
+ /* awaitPromise */ true)
+ .then((result) => InspectorTest.logMessage(result))
+ .then(() => next());
+ },
+
+ function testExceptionInFunctionExpression(next)
+ {
+ callFunctionOn(
+ "({a : 1})",
+ "(function() { throw new Error() })()",
+ [],
+ /* returnByValue */ false,
+ /* generatePreview */ false,
+ /* awaitPromise */ true)
+ .then((result) => InspectorTest.logMessage(result))
+ .then(() => next());
+ },
+
+ function testFunctionReturnNotPromise(next)
+ {
+ callFunctionOn(
+ "({a : 1})",
+ "(function() { return 239; })",
+ [],
+ /* returnByValue */ false,
+ /* generatePreview */ false,
+ /* awaitPromise */ true)
+ .then((result) => InspectorTest.logMessage(result.error))
+ .then(() => next());
+ },
+
+ function testFunctionReturnResolvedPromiseReturnByValue(next)
+ {
+ callFunctionOn(
+ "({a : 1})",
+ "(function(arg) { return Promise.resolve({a : this.a + arg.a}); })",
+ [ "({a:2})" ],
+ /* returnByValue */ true,
+ /* generatePreview */ false,
+ /* awaitPromise */ true)
+ .then((result) => InspectorTest.logMessage(result))
+ .then(() => next());
+ },
+
+ function testFunctionReturnResolvedPromiseWithPreview(next)
+ {
+ callFunctionOn(
+ "({a : 1})",
+ "(function(arg) { return Promise.resolve({a : this.a + arg.a}); })",
+ [ "({a:2})" ],
+ /* returnByValue */ false,
+ /* generatePreview */ true,
+ /* awaitPromise */ true)
+ .then((result) => InspectorTest.logMessage(result))
+ .then(() => next());
+ },
+
+ function testFunctionReturnRejectedPromise(next)
+ {
+ callFunctionOn(
+ "({a : 1})",
+ "(function(arg) { return Promise.reject({a : this.a + arg.a}); })",
+ [ "({a:2})" ],
+ /* returnByValue */ true,
+ /* generatePreview */ false,
+ /* awaitPromise */ true)
+ .then((result) => InspectorTest.logMessage(result))
+ .then(() => next());
+ }
+]);
+
+function callFunctionOn(objectExpression, functionDeclaration, argumentExpressions, returnByValue, generatePreview, awaitPromise)
+{
+ var objectId;
+ var callArguments = [];
+ var promise = Protocol.Runtime.evaluate({ expression: objectExpression })
+ .then((result) => objectId = result.result.result.objectId)
+ for (let argumentExpression of argumentExpressions) {
+ promise = promise
+ .then(() => Protocol.Runtime.evaluate({ expression: argumentExpression }))
+ .then((result) => addArgument(result.result.result));
+ }
+ return promise.then(() => Protocol.Runtime.callFunctionOn({ objectId: objectId, functionDeclaration: functionDeclaration, arguments: callArguments, returnByValue: returnByValue, generatePreview: generatePreview, awaitPromise: awaitPromise }));
+
+ function addArgument(result)
+ {
+ if (result.objectId) {
+ callArguments.push({ objectId: result.objectId });
+ } else if (result.value) {
+ callArguments.push({ value: result.value })
+ } else if (result.unserializableValue) {
+ callArguments.push({ unserializableValue: result.unserializableValue });
+ } else if (result.type === "undefined") {
+ callArguments.push({});
+ } else {
+ InspectorTest.log("Unexpected argument object:");
+ InspectorTest.logMessage(result);
+ InspectorTest.completeTest();
+ }
+ }
+}
diff --git a/deps/v8/test/inspector/runtime/clear-of-command-line-api-expected.txt b/deps/v8/test/inspector/runtime/clear-of-command-line-api-expected.txt
new file mode 100644
index 0000000000..142989b731
--- /dev/null
+++ b/deps/v8/test/inspector/runtime/clear-of-command-line-api-expected.txt
@@ -0,0 +1,177 @@
+Tests that CommandLineAPI is presented only while evaluation.
+
+{
+ id : <messageId>
+ result : {
+ result : {
+ description : 15
+ type : number
+ value : 15
+ }
+ }
+}
+{
+ id : <messageId>
+ result : {
+ result : {
+ description : 0
+ type : number
+ value : 0
+ }
+ }
+}
+setPropertyForMethod()
+{
+ id : <messageId>
+ result : {
+ result : {
+ description : 14
+ type : number
+ value : 14
+ }
+ }
+}
+{
+ id : <messageId>
+ result : {
+ result : {
+ description : 0
+ type : number
+ value : 0
+ }
+ }
+}
+{
+ id : <messageId>
+ result : {
+ result : {
+ description : 42
+ type : number
+ value : 42
+ }
+ }
+}
+defineValuePropertyForMethod()
+{
+ id : <messageId>
+ result : {
+ result : {
+ description : 14
+ type : number
+ value : 14
+ }
+ }
+}
+{
+ id : <messageId>
+ result : {
+ result : {
+ description : 0
+ type : number
+ value : 0
+ }
+ }
+}
+{
+ id : <messageId>
+ result : {
+ result : {
+ description : 42
+ type : number
+ value : 42
+ }
+ }
+}
+definePropertiesForMethod()
+{
+ id : <messageId>
+ result : {
+ result : {
+ description : 14
+ type : number
+ value : 14
+ }
+ }
+}
+{
+ id : <messageId>
+ result : {
+ result : {
+ description : 0
+ type : number
+ value : 0
+ }
+ }
+}
+{
+ id : <messageId>
+ result : {
+ result : {
+ description : 42
+ type : number
+ value : 42
+ }
+ }
+}
+defineAccessorPropertyForMethod()
+{
+ id : <messageId>
+ result : {
+ result : {
+ description : 14
+ type : number
+ value : 14
+ }
+ }
+}
+{
+ id : <messageId>
+ result : {
+ result : {
+ description : 0
+ type : number
+ value : 0
+ }
+ }
+}
+{
+ id : <messageId>
+ result : {
+ result : {
+ description : 42
+ type : number
+ value : 42
+ }
+ }
+}
+redefineGetOwnPropertyDescriptors()
+{
+ id : <messageId>
+ result : {
+ result : {
+ description : 14
+ type : number
+ value : 14
+ }
+ }
+}
+{
+ id : <messageId>
+ result : {
+ result : {
+ description : 0
+ type : number
+ value : 0
+ }
+ }
+}
+{
+ id : <messageId>
+ result : {
+ result : {
+ description : 42
+ type : number
+ value : 42
+ }
+ }
+} \ No newline at end of file
diff --git a/deps/v8/test/inspector/runtime/clear-of-command-line-api.js b/deps/v8/test/inspector/runtime/clear-of-command-line-api.js
new file mode 100644
index 0000000000..2af2f4917f
--- /dev/null
+++ b/deps/v8/test/inspector/runtime/clear-of-command-line-api.js
@@ -0,0 +1,117 @@
+// Copyright 2016 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+print("Tests that CommandLineAPI is presented only while evaluation.");
+
+InspectorTest.addScript(
+`
+var methods = ["dir","dirxml","profile","profileEnd","clear","table","keys","values","debug","undebug","monitor","unmonitor","inspect","copy"];
+var window = this;
+function presentedAPIMethods()
+{
+ var methodCount = 0;
+ for (var method of methods) {
+ try {
+ if (eval("window." + method + "&&" + method + ".toString ? " + method + ".toString().indexOf(\\"[Command Line API]\\") !== -1 : false"))
+ ++methodCount;
+ } catch (e) {
+ }
+ }
+ methodCount += eval("\\"$_\\" in window ? $_ === 239 : false") ? 1 : 0;
+ return methodCount;
+}
+
+function setPropertyForMethod()
+{
+ window.dir = 42;
+}
+
+function defineValuePropertyForMethod()
+{
+ Object.defineProperty(window, "dir", { value: 42 });
+}
+
+function defineAccessorPropertyForMethod()
+{
+ Object.defineProperty(window, "dir", { set: function() {}, get: function(){ return 42 } });
+}
+
+function definePropertiesForMethod()
+{
+ Object.defineProperties(window, { "dir": { set: function() {}, get: function(){ return 42 } }});
+}
+
+var builtinGetOwnPropertyDescriptorOnObject;
+var builtinGetOwnPropertyDescriptorOnObjectPrototype;
+var builtinGetOwnPropertyDescriptorOnWindow;
+
+function redefineGetOwnPropertyDescriptors()
+{
+ builtinGetOwnPropertyDescriptorOnObject = Object.getOwnPropertyDescriptor;
+ Object.getOwnPropertyDescriptor = function() {}
+ builtinGetOwnPropertyDescriptorOnObjectPrototype = Object.prototype.getOwnPropertyDescriptor;
+ Object.prototype.getOwnPropertyDescriptor = function() {}
+ builtinGetOwnPropertyDescriptorOnWindow = window.getOwnPropertyDescriptor;
+ window.getOwnPropertyDescriptor = function() {}
+}
+
+function restoreGetOwnPropertyDescriptors()
+{
+ Object.getOwnPropertyDescriptor = builtinGetOwnPropertyDescriptorOnObject;
+ Object.prototype.getOwnPropertyDescriptor = builtinGetOwnPropertyDescriptorOnObjectPrototype;
+ window.getOwnPropertyDescriptor = builtinGetOwnPropertyDescriptorOnWindow;
+}`);
+
+runExpressionAndDumpPresentedMethods("")
+ .then(dumpLeftMethods)
+ .then(() => runExpressionAndDumpPresentedMethods("setPropertyForMethod()"))
+ .then(dumpLeftMethods)
+ .then(dumpDir)
+ .then(() => runExpressionAndDumpPresentedMethods("defineValuePropertyForMethod()"))
+ .then(dumpLeftMethods)
+ .then(dumpDir)
+ .then(() => runExpressionAndDumpPresentedMethods("definePropertiesForMethod()"))
+ .then(dumpLeftMethods)
+ .then(dumpDir)
+ .then(() => runExpressionAndDumpPresentedMethods("defineAccessorPropertyForMethod()"))
+ .then(dumpLeftMethods)
+ .then(dumpDir)
+ .then(() => runExpressionAndDumpPresentedMethods("redefineGetOwnPropertyDescriptors()"))
+ .then(dumpLeftMethods)
+ .then(dumpDir)
+ .then(() => evaluate("restoreGetOwnPropertyDescriptors()", false))
+ .then(InspectorTest.completeTest);
+
+function evaluate(expression, includeCommandLineAPI)
+{
+ return Protocol.Runtime.evaluate({ expression: expression, objectGroup: "console", includeCommandLineAPI: includeCommandLineAPI });
+}
+
+function setLastEvaluationResultTo239()
+{
+ return evaluate("239", false);
+}
+
+function runExpressionAndDumpPresentedMethods(expression)
+{
+ InspectorTest.log(expression);
+ return setLastEvaluationResultTo239()
+ .then(() => evaluate(expression + "; var a = presentedAPIMethods(); a", true))
+ .then((result) => InspectorTest.logMessage(result));
+}
+
+function dumpLeftMethods()
+{
+ // Should always be zero.
+ return setLastEvaluationResultTo239()
+ .then(() => evaluate("presentedAPIMethods()", false))
+ .then((result) => InspectorTest.logMessage(result));
+}
+
+function dumpDir()
+{
+ // Should always be presented.
+ return evaluate("dir", false)
+ .then((result) => InspectorTest.logMessage(result));
+}
diff --git a/deps/v8/test/inspector/runtime/compile-script-expected.txt b/deps/v8/test/inspector/runtime/compile-script-expected.txt
new file mode 100644
index 0000000000..3d6d580487
--- /dev/null
+++ b/deps/v8/test/inspector/runtime/compile-script-expected.txt
@@ -0,0 +1,66 @@
+Compiling script: foo1.js
+ persist: false
+compilation result:
+{
+ id : <messageId>
+ result : {
+ exceptionDetails : {
+ columnNumber : 2
+ exception : {
+ className : SyntaxError
+ description : SyntaxError: Unexpected end of input
+ objectId : <objectId>
+ subtype : error
+ type : object
+ }
+ exceptionId : <exceptionId>
+ lineNumber : 1
+ scriptId : <scriptId>
+ text : Uncaught
+ }
+ }
+}
+-----
+Compiling script: foo2.js
+ persist: true
+Debugger.scriptParsed: foo2.js
+compilation result:
+{
+ id : <messageId>
+ result : {
+ scriptId : <scriptId>
+ }
+}
+-----
+Compiling script: foo3.js
+ persist: false
+compilation result:
+{
+ id : <messageId>
+ result : {
+ }
+}
+-----
+Compiling script: foo4.js
+ persist: false
+compilation result:
+{
+ id : <messageId>
+ result : {
+ exceptionDetails : {
+ columnNumber : 13
+ exception : {
+ className : SyntaxError
+ description : SyntaxError: Unexpected identifier
+ objectId : <objectId>
+ subtype : error
+ type : object
+ }
+ exceptionId : <exceptionId>
+ lineNumber : 0
+ scriptId : <scriptId>
+ text : Uncaught
+ }
+ }
+}
+----- \ No newline at end of file
diff --git a/deps/v8/test/inspector/runtime/compile-script.js b/deps/v8/test/inspector/runtime/compile-script.js
new file mode 100644
index 0000000000..4f1c6468e1
--- /dev/null
+++ b/deps/v8/test/inspector/runtime/compile-script.js
@@ -0,0 +1,50 @@
+// Copyright 2016 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+var executionContextId;
+
+Protocol.Debugger.enable().then(onDebuggerEnabled);
+
+function onDebuggerEnabled()
+{
+ Protocol.Runtime.enable();
+ Protocol.Debugger.onScriptParsed(onScriptParsed);
+ Protocol.Runtime.onExecutionContextCreated(onExecutionContextCreated);
+}
+
+function onScriptParsed(messageObject)
+{
+ if (!messageObject.params.url)
+ return;
+ InspectorTest.log("Debugger.scriptParsed: " + messageObject.params.url);
+}
+
+function onExecutionContextCreated(messageObject)
+{
+ executionContextId = messageObject.params.context.id;
+ testCompileScript("\n (", false, "foo1.js")
+ .then(() => testCompileScript("239", true, "foo2.js"))
+ .then(() => testCompileScript("239", false, "foo3.js"))
+ .then(() => testCompileScript("testfunction f()\n{\n return 0;\n}\n", false, "foo4.js"))
+ .then(() => InspectorTest.completeTest());
+}
+
+function testCompileScript(expression, persistScript, sourceURL)
+{
+ InspectorTest.log("Compiling script: " + sourceURL);
+ InspectorTest.log(" persist: " + persistScript);
+ return Protocol.Runtime.compileScript({
+ expression: expression,
+ sourceURL: sourceURL,
+ persistScript: persistScript,
+ executionContextId: executionContextId
+ }).then(onCompiled);
+
+ function onCompiled(messageObject)
+ {
+ InspectorTest.log("compilation result: ");
+ InspectorTest.logMessage(messageObject);
+ InspectorTest.log("-----");
+ }
+}
diff --git a/deps/v8/test/inspector/runtime/console-api-repeated-in-console-expected.txt b/deps/v8/test/inspector/runtime/console-api-repeated-in-console-expected.txt
new file mode 100644
index 0000000000..04d2d90265
--- /dev/null
+++ b/deps/v8/test/inspector/runtime/console-api-repeated-in-console-expected.txt
@@ -0,0 +1,6 @@
+Check that console.log is reported through Console domain as well.
+api call: 42
+api call: abc
+console message: 42
+console message: abc
+
diff --git a/deps/v8/test/inspector/runtime/console-api-repeated-in-console.js b/deps/v8/test/inspector/runtime/console-api-repeated-in-console.js
new file mode 100644
index 0000000000..ec4b34d8ad
--- /dev/null
+++ b/deps/v8/test/inspector/runtime/console-api-repeated-in-console.js
@@ -0,0 +1,37 @@
+// Copyright 2016 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+print("Check that console.log is reported through Console domain as well.");
+
+var expectedMessages = 4;
+var messages = [];
+
+Protocol.Runtime.onConsoleAPICalled(consoleAPICalled);
+Protocol.Console.onMessageAdded(messageAdded);
+Protocol.Runtime.enable();
+Protocol.Console.enable();
+Protocol.Runtime.evaluate({ "expression": "console.log(42)" });
+Protocol.Runtime.evaluate({ "expression": "console.error('abc')" });
+
+function consoleAPICalled(result)
+{
+ messages.push("api call: " + result.params.args[0].value);
+ if (!(--expectedMessages))
+ done();
+}
+
+function messageAdded(result)
+{
+ messages.push("console message: " + result.params.message.text);
+ if (!(--expectedMessages))
+ done();
+}
+
+function done()
+{
+ messages.sort();
+ for (var message of messages)
+ InspectorTest.log(message);
+ InspectorTest.completeTest();
+}
diff --git a/deps/v8/test/inspector/runtime/console-deprecated-methods-expected.txt b/deps/v8/test/inspector/runtime/console-deprecated-methods-expected.txt
new file mode 100644
index 0000000000..1b8e4aa2ce
--- /dev/null
+++ b/deps/v8/test/inspector/runtime/console-deprecated-methods-expected.txt
@@ -0,0 +1,5 @@
+Tests checks that deprecation messages for console.
+'console.timeline' is deprecated. Please use 'console.time' instead.
+'console.timelineEnd' is deprecated. Please use 'console.timeEnd' instead.
+'console.markTimeline' is deprecated. Please use 'console.timeStamp' instead.
+
diff --git a/deps/v8/test/inspector/runtime/console-deprecated-methods.js b/deps/v8/test/inspector/runtime/console-deprecated-methods.js
new file mode 100644
index 0000000000..2705cb083f
--- /dev/null
+++ b/deps/v8/test/inspector/runtime/console-deprecated-methods.js
@@ -0,0 +1,28 @@
+// Copyright 2016 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+print("Tests checks that deprecation messages for console.")
+
+Protocol.Runtime.onConsoleAPICalled(messageAdded);
+Protocol.Runtime.enable();
+
+var deprecatedMethods = [
+ "console.timeline(\"42\")",
+ "console.timeline(\"42\")",
+ "console.timeline(\"42\")", // three calls should produce one warning message
+ "console.timelineEnd(\"42\")",
+ "console.markTimeline(\"42\")",
+];
+Protocol.Runtime.evaluate({ expression: deprecatedMethods.join(";") });
+
+var messagesLeft = 3;
+function messageAdded(data)
+{
+ var text = data.params.args[0].value;
+ if (text.indexOf("deprecated") === -1)
+ return;
+ InspectorTest.log(text);
+ if (!--messagesLeft)
+ InspectorTest.completeTest();
+}
diff --git a/deps/v8/test/inspector/runtime/console-line-and-column-expected.txt b/deps/v8/test/inspector/runtime/console-line-and-column-expected.txt
new file mode 100644
index 0000000000..4eab60af0d
--- /dev/null
+++ b/deps/v8/test/inspector/runtime/console-line-and-column-expected.txt
@@ -0,0 +1,52 @@
+{
+ method : Runtime.consoleAPICalled
+ params : {
+ args : [
+ [0] : {
+ description : 239
+ type : number
+ value : 239
+ }
+ ]
+ executionContextId : <executionContextId>
+ stackTrace : {
+ callFrames : [
+ [0] : {
+ columnNumber : 8
+ functionName :
+ lineNumber : 0
+ scriptId : <scriptId>
+ url :
+ }
+ ]
+ }
+ timestamp : <timestamp>
+ type : log
+ }
+}
+{
+ method : Runtime.consoleAPICalled
+ params : {
+ args : [
+ [0] : {
+ description : 239
+ type : number
+ value : 239
+ }
+ ]
+ executionContextId : <executionContextId>
+ stackTrace : {
+ callFrames : [
+ [0] : {
+ columnNumber : 2
+ functionName :
+ lineNumber : 1
+ scriptId : <scriptId>
+ url :
+ }
+ ]
+ }
+ timestamp : <timestamp>
+ type : log
+ }
+} \ No newline at end of file
diff --git a/deps/v8/test/inspector/runtime/console-line-and-column.js b/deps/v8/test/inspector/runtime/console-line-and-column.js
new file mode 100644
index 0000000000..fe5c24f27c
--- /dev/null
+++ b/deps/v8/test/inspector/runtime/console-line-and-column.js
@@ -0,0 +1,18 @@
+// Copyright 2016 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+Protocol.Runtime.enable();
+
+addConsoleMessagePromise("console.log(239)")
+ .then(message => InspectorTest.logMessage(message))
+ .then(() => addConsoleMessagePromise("var l = console.log;\n l(239)"))
+ .then(message => InspectorTest.logMessage(message))
+ .then(() => InspectorTest.completeTest());
+
+function addConsoleMessagePromise(expression)
+{
+ var wait = Protocol.Runtime.onceConsoleAPICalled();
+ Protocol.Runtime.evaluate({ expression: expression });
+ return wait;
+}
diff --git a/deps/v8/test/inspector/runtime/console-log-doesnt-run-microtasks-expected.txt b/deps/v8/test/inspector/runtime/console-log-doesnt-run-microtasks-expected.txt
new file mode 100644
index 0000000000..5a234ec78c
--- /dev/null
+++ b/deps/v8/test/inspector/runtime/console-log-doesnt-run-microtasks-expected.txt
@@ -0,0 +1,21 @@
+Check that console.log doesn't run microtasks.
+{
+ description : 42
+ type : number
+ value : 42
+}
+{
+ description : 43
+ type : number
+ value : 43
+}
+{
+ description : 239
+ type : number
+ value : 239
+}
+{
+ type : string
+ value : finished
+}
+
diff --git a/deps/v8/test/inspector/runtime/console-log-doesnt-run-microtasks.js b/deps/v8/test/inspector/runtime/console-log-doesnt-run-microtasks.js
new file mode 100644
index 0000000000..b7a87391e0
--- /dev/null
+++ b/deps/v8/test/inspector/runtime/console-log-doesnt-run-microtasks.js
@@ -0,0 +1,26 @@
+// Copyright 2016 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+print("Check that console.log doesn't run microtasks.");
+
+InspectorTest.addScript(
+`
+function testFunction()
+{
+ Promise.resolve().then(function(){ console.log(239); });
+ console.log(42);
+ console.log(43);
+}`);
+
+Protocol.Runtime.enable();
+Protocol.Runtime.onConsoleAPICalled(messageAdded);
+Protocol.Runtime.evaluate({ "expression": "testFunction()" });
+Protocol.Runtime.evaluate({ "expression": "setTimeout(() => console.log(\"finished\"), 0)" });
+
+function messageAdded(result)
+{
+ InspectorTest.logObject(result.params.args[0]);
+ if (result.params.args[0].value === "finished")
+ InspectorTest.completeTest();
+}
diff --git a/deps/v8/test/inspector/runtime/console-timestamp-expected.txt b/deps/v8/test/inspector/runtime/console-timestamp-expected.txt
new file mode 100644
index 0000000000..5e4d7b5ada
--- /dev/null
+++ b/deps/v8/test/inspector/runtime/console-timestamp-expected.txt
@@ -0,0 +1,9 @@
+Message has timestamp: true
+Message timestamp doesn't differ too much from current time (one minute interval): true
+Message 1 has non-decreasing timestamp: true
+Message has timestamp: true
+Message timestamp doesn't differ too much from current time (one minute interval): true
+Message 2 has non-decreasing timestamp: true
+Message has timestamp: true
+Message timestamp doesn't differ too much from current time (one minute interval): true
+
diff --git a/deps/v8/test/inspector/runtime/console-timestamp.js b/deps/v8/test/inspector/runtime/console-timestamp.js
new file mode 100644
index 0000000000..0dceaed23f
--- /dev/null
+++ b/deps/v8/test/inspector/runtime/console-timestamp.js
@@ -0,0 +1,23 @@
+// Copyright 2016 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+var messages = [];
+
+function messageAdded(data)
+{
+ var payload = data.params;
+ if (messages.length > 0)
+ InspectorTest.log("Message " + messages.length + " has non-decreasing timestamp: " + (payload.timestamp >= messages[messages.length - 1].timestamp));
+
+ messages.push(payload);
+ InspectorTest.log("Message has timestamp: " + !!payload.timestamp);
+
+ InspectorTest.log("Message timestamp doesn't differ too much from current time (one minute interval): " + (Math.abs(new Date().getTime() - payload.timestamp) < 60000));
+ if (messages.length === 3)
+ InspectorTest.completeTest();
+}
+
+Protocol.Runtime.onConsoleAPICalled(messageAdded);
+Protocol.Runtime.enable();
+Protocol.Runtime.evaluate({ expression: "console.log('testUnique'); for (var i = 0; i < 2; ++i) console.log('testDouble');" });
diff --git a/deps/v8/test/inspector/runtime/evaluate-async-expected.txt b/deps/v8/test/inspector/runtime/evaluate-async-expected.txt
new file mode 100644
index 0000000000..c03dd7a409
--- /dev/null
+++ b/deps/v8/test/inspector/runtime/evaluate-async-expected.txt
@@ -0,0 +1,95 @@
+Tests that Runtime.evaluate works with awaitPromise flag.
+
+Running test: testResolvedPromise
+{
+ id : <messageId>
+ result : {
+ result : {
+ description : 239
+ type : number
+ value : 239
+ }
+ }
+}
+
+Running test: testRejectedPromise
+{
+ id : <messageId>
+ result : {
+ exceptionDetails : {
+ columnNumber : 0
+ exception : {
+ description : 239
+ type : number
+ value : 239
+ }
+ exceptionId : <exceptionId>
+ lineNumber : 0
+ stackTrace : {
+ callFrames : [
+ ]
+ }
+ text : Uncaught (in promise)
+ }
+ result : {
+ description : 239
+ type : number
+ value : 239
+ }
+ }
+}
+
+Running test: testPrimitiveValueInsteadOfPromise
+{
+ error : {
+ code : -32000
+ message : Result of the evaluation is not a promise
+ }
+ id : <messageId>
+}
+
+Running test: testObjectInsteadOfPromise
+{
+ error : {
+ code : -32000
+ message : Result of the evaluation is not a promise
+ }
+ id : <messageId>
+}
+
+Running test: testPendingPromise
+{
+ id : <messageId>
+ result : {
+ result : {
+ type : object
+ value : {
+ a : 239
+ }
+ }
+ }
+}
+
+Running test: testExceptionInEvaluate
+{
+ id : <messageId>
+ result : {
+ exceptionDetails : {
+ columnNumber : 0
+ exception : {
+ description : 239
+ type : number
+ value : 239
+ }
+ exceptionId : <exceptionId>
+ lineNumber : 0
+ scriptId : <scriptId>
+ text : Uncaught
+ }
+ result : {
+ description : 239
+ type : number
+ value : 239
+ }
+ }
+}
diff --git a/deps/v8/test/inspector/runtime/evaluate-async-with-wrap-error-expected.txt b/deps/v8/test/inspector/runtime/evaluate-async-with-wrap-error-expected.txt
new file mode 100644
index 0000000000..743acdbc08
--- /dev/null
+++ b/deps/v8/test/inspector/runtime/evaluate-async-with-wrap-error-expected.txt
@@ -0,0 +1,8 @@
+Test that Runtime.evaluate correctly process errors during wrapping async result.
+{
+ error : {
+ code : -32000
+ message : Object couldn't be returned by value
+ }
+ id : <messageId>
+}
diff --git a/deps/v8/test/inspector/runtime/evaluate-async-with-wrap-error.js b/deps/v8/test/inspector/runtime/evaluate-async-with-wrap-error.js
new file mode 100644
index 0000000000..e5da89ecfc
--- /dev/null
+++ b/deps/v8/test/inspector/runtime/evaluate-async-with-wrap-error.js
@@ -0,0 +1,15 @@
+// Copyright 2016 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+print("Test that Runtime.evaluate correctly process errors during wrapping \
+async result.");
+
+var evaluateArguments = {
+ expression: "Promise.resolve(Symbol(123))",
+ returnByValue: true,
+ awaitPromise: true
+};
+Protocol.Runtime.evaluate(evaluateArguments)
+ .then(message => InspectorTest.logMessage(message))
+ .then(() => InspectorTest.completeTest());
diff --git a/deps/v8/test/inspector/runtime/evaluate-async.js b/deps/v8/test/inspector/runtime/evaluate-async.js
new file mode 100644
index 0000000000..ed4b6e30e2
--- /dev/null
+++ b/deps/v8/test/inspector/runtime/evaluate-async.js
@@ -0,0 +1,58 @@
+// Copyright 2016 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+print("Tests that Runtime.evaluate works with awaitPromise flag.");
+
+InspectorTest.addScript(`
+function createPromiseAndScheduleResolve()
+{
+ var resolveCallback;
+ var promise = new Promise((resolve) => resolveCallback = resolve);
+ setTimeout(resolveCallback.bind(null, { a : 239 }), 0);
+ return promise;
+}`);
+
+InspectorTest.runTestSuite([
+ function testResolvedPromise(next)
+ {
+ Protocol.Runtime.evaluate({ expression: "Promise.resolve(239)", awaitPromise: true, generatePreview: true })
+ .then(result => InspectorTest.logMessage(result))
+ .then(() => next());
+ },
+
+ function testRejectedPromise(next)
+ {
+ Protocol.Runtime.evaluate({ expression: "Promise.reject(239)", awaitPromise: true })
+ .then(result => InspectorTest.logMessage(result))
+ .then(() => next());
+ },
+
+ function testPrimitiveValueInsteadOfPromise(next)
+ {
+ Protocol.Runtime.evaluate({ expression: "true", awaitPromise: true })
+ .then(result => InspectorTest.logMessage(result))
+ .then(() => next());
+ },
+
+ function testObjectInsteadOfPromise(next)
+ {
+ Protocol.Runtime.evaluate({ expression: "({})", awaitPromise: true })
+ .then(result => InspectorTest.logMessage(result))
+ .then(() => next());
+ },
+
+ function testPendingPromise(next)
+ {
+ Protocol.Runtime.evaluate({ expression: "createPromiseAndScheduleResolve()", awaitPromise: true, returnByValue: true })
+ .then(result => InspectorTest.logMessage(result))
+ .then(() => next());
+ },
+
+ function testExceptionInEvaluate(next)
+ {
+ Protocol.Runtime.evaluate({ expression: "throw 239", awaitPromise: true })
+ .then(result => InspectorTest.logMessage(result))
+ .then(() => next());
+ }
+]);
diff --git a/deps/v8/test/inspector/runtime/evaluate-with-context-id-equal-zero-expected.txt b/deps/v8/test/inspector/runtime/evaluate-with-context-id-equal-zero-expected.txt
new file mode 100644
index 0000000000..9521a06c06
--- /dev/null
+++ b/deps/v8/test/inspector/runtime/evaluate-with-context-id-equal-zero-expected.txt
@@ -0,0 +1,9 @@
+Tests that DevTools doesn't crash on Runtime.evaluate with contextId equals 0.
+{
+ error : {
+ code : -32000
+ message : Cannot find context with specified id
+ }
+ id : <messageId>
+}
+
diff --git a/deps/v8/test/inspector/runtime/evaluate-with-context-id-equal-zero.js b/deps/v8/test/inspector/runtime/evaluate-with-context-id-equal-zero.js
new file mode 100644
index 0000000000..d37a00ce37
--- /dev/null
+++ b/deps/v8/test/inspector/runtime/evaluate-with-context-id-equal-zero.js
@@ -0,0 +1,9 @@
+// Copyright 2016 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+print("Tests that DevTools doesn't crash on Runtime.evaluate with contextId equals 0.");
+
+Protocol.Runtime.evaluate({ "contextId": 0, "expression": "" })
+ .then(message => InspectorTest.logMessage(message))
+ .then(() => InspectorTest.completeTest());
diff --git a/deps/v8/test/inspector/runtime/exception-thrown-expected.txt b/deps/v8/test/inspector/runtime/exception-thrown-expected.txt
new file mode 100644
index 0000000000..228c348298
--- /dev/null
+++ b/deps/v8/test/inspector/runtime/exception-thrown-expected.txt
@@ -0,0 +1,117 @@
+Check that exceptionThrown is supported by test runner.
+{
+ method : Runtime.exceptionThrown
+ params : {
+ exceptionDetails : {
+ columnNumber : 2
+ exception : {
+ className : Error
+ description : Error at setTimeout (<anonymous>:2:9)
+ objectId : <objectId>
+ preview : {
+ description : Error at setTimeout (<anonymous>:2:9)
+ overflow : false
+ properties : [
+ [0] : {
+ name : stack
+ type : string
+ value : Error at setTimeout (<anonymous>:2:9)
+ }
+ ]
+ subtype : error
+ type : object
+ }
+ subtype : error
+ type : object
+ }
+ exceptionId : <exceptionId>
+ executionContextId : <executionContextId>
+ lineNumber : 1
+ stackTrace : {
+ callFrames : [
+ [0] : {
+ columnNumber : 8
+ functionName : setTimeout
+ lineNumber : 1
+ scriptId : <scriptId>
+ url :
+ }
+ ]
+ }
+ text : Uncaught Error
+ }
+ timestamp : <timestamp>
+ }
+}
+{
+ method : Runtime.exceptionThrown
+ params : {
+ exceptionDetails : {
+ columnNumber : 1
+ exception : {
+ className : SyntaxError
+ description : SyntaxError: Unexpected token }
+ objectId : <objectId>
+ preview : {
+ description : SyntaxError: Unexpected token }
+ overflow : false
+ properties : [
+ [0] : {
+ name : stack
+ type : string
+ value : SyntaxError: Unexpected token }
+ }
+ [1] : {
+ name : message
+ type : string
+ value : Unexpected token }
+ }
+ ]
+ subtype : error
+ type : object
+ }
+ subtype : error
+ type : object
+ }
+ exceptionId : <exceptionId>
+ executionContextId : <executionContextId>
+ lineNumber : 0
+ scriptId : <scriptId>
+ stackTrace : {
+ callFrames : [
+ ]
+ }
+ text : Uncaught SyntaxError: Unexpected token }
+ }
+ timestamp : <timestamp>
+ }
+}
+{
+ method : Runtime.exceptionThrown
+ params : {
+ exceptionDetails : {
+ columnNumber : 2
+ exception : {
+ description : 239
+ type : number
+ value : 239
+ }
+ exceptionId : <exceptionId>
+ executionContextId : <executionContextId>
+ lineNumber : 1
+ stackTrace : {
+ callFrames : [
+ [0] : {
+ columnNumber : 2
+ functionName : setTimeout
+ lineNumber : 1
+ scriptId : <scriptId>
+ url :
+ }
+ ]
+ }
+ text : Uncaught 239
+ }
+ timestamp : <timestamp>
+ }
+}
diff --git a/deps/v8/test/inspector/runtime/exception-thrown.js b/deps/v8/test/inspector/runtime/exception-thrown.js
new file mode 100644
index 0000000000..76752f9d3b
--- /dev/null
+++ b/deps/v8/test/inspector/runtime/exception-thrown.js
@@ -0,0 +1,12 @@
+// Copyright 2016 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+print("Check that exceptionThrown is supported by test runner.")
+
+Protocol.Runtime.enable();
+Protocol.Runtime.onExceptionThrown(message => InspectorTest.logMessage(message));
+Protocol.Runtime.evaluate({ expression: "setTimeout(() => { \n throw new Error() }, 0)" });
+Protocol.Runtime.evaluate({ expression: "setTimeout(\" }\", 0)" });
+Protocol.Runtime.evaluate({ expression: "setTimeout(() => { \n throw 239; }, 0)" });
+InspectorTest.completeTestAfterPendingTimeouts();
diff --git a/deps/v8/test/inspector/runtime/get-properties-expected.txt b/deps/v8/test/inspector/runtime/get-properties-expected.txt
new file mode 100644
index 0000000000..bb74386de8
--- /dev/null
+++ b/deps/v8/test/inspector/runtime/get-properties-expected.txt
@@ -0,0 +1,39 @@
+Properties of Object(5)
+ __proto__ own object undefined
+ foo own string cat
+Internal properties
+ [[PrimitiveValue]] number 5
+Properties of Not own properties
+ __defineGetter__ inherited function undefined
+ __defineSetter__ inherited function undefined
+ __lookupGetter__ inherited function undefined
+ __lookupSetter__ inherited function undefined
+ __proto__ inherited no value, getter, setter
+ a own number 2
+ b own no value, getter, setter
+ c inherited number 4
+ constructor inherited function undefined
+ d inherited no value, getter
+ hasOwnProperty inherited function undefined
+ isPrototypeOf inherited function undefined
+ propertyIsEnumerable inherited function undefined
+ toLocaleString inherited function undefined
+ toString inherited function undefined
+ valueOf inherited function undefined
+Properties of Accessor only properties
+ b own no value, getter, setter
+ d own no value, setter
+Properties of array
+ 0 own string red
+ 1 own string green
+ 2 own string blue
+ __proto__ own object undefined
+ length own number 3
+Properties of Bound function
+ __proto__ own function undefined
+ length own number 0
+ name own string bound Number
+Internal properties
+ [[BoundArgs]] object undefined
+ [[BoundThis]] object undefined
+ [[TargetFunction]] function undefined
diff --git a/deps/v8/test/inspector/runtime/get-properties-on-proxy-expected.txt b/deps/v8/test/inspector/runtime/get-properties-on-proxy-expected.txt
new file mode 100644
index 0000000000..b36c811771
--- /dev/null
+++ b/deps/v8/test/inspector/runtime/get-properties-on-proxy-expected.txt
@@ -0,0 +1,11 @@
+Check that while Runtime.getProperties call on proxy object no user defined trap will be executed.
+{
+ id : <messageId>
+ result : {
+ result : {
+ description : 0
+ type : number
+ value : 0
+ }
+ }
+} \ No newline at end of file
diff --git a/deps/v8/test/inspector/runtime/get-properties-on-proxy.js b/deps/v8/test/inspector/runtime/get-properties-on-proxy.js
new file mode 100644
index 0000000000..40e2a96107
--- /dev/null
+++ b/deps/v8/test/inspector/runtime/get-properties-on-proxy.js
@@ -0,0 +1,101 @@
+// Copyright 2016 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+print("Check that while Runtime.getProperties call on proxy object no user defined trap will be executed.");
+
+InspectorTest.addScript(`
+var self = this;
+function testFunction()
+{
+ self.counter = 0;
+ var handler = {
+ get: function(target, name){
+ self.counter++;
+ return Reflect.get.apply(this, arguments);
+ },
+ set: function(target, name){
+ self.counter++;
+ return Reflect.set.apply(this, arguments);
+ },
+ getPrototypeOf: function(target) {
+ self.counter++;
+ return Reflect.getPrototypeOf.apply(this, arguments);
+ },
+ setPrototypeOf: function(target) {
+ self.counter++;
+ return Reflect.setPrototypeOf.apply(this, arguments);
+ },
+ isExtensible: function(target) {
+ self.counter++;
+ return Reflect.isExtensible.apply(this, arguments);
+ },
+ isExtensible: function(target) {
+ self.counter++;
+ return Reflect.isExtensible.apply(this, arguments);
+ },
+ isExtensible: function(target) {
+ self.counter++;
+ return Reflect.isExtensible.apply(this, arguments);
+ },
+ preventExtensions: function() {
+ self.counter++;
+ return Reflect.preventExtensions.apply(this, arguments);
+ },
+ getOwnPropertyDescriptor: function() {
+ self.counter++;
+ return Reflect.getOwnPropertyDescriptor.apply(this, arguments);
+ },
+ defineProperty: function() {
+ self.counter++;
+ return Reflect.defineProperty.apply(this, arguments);
+ },
+ has: function() {
+ self.counter++;
+ return Reflect.has.apply(this, arguments);
+ },
+ get: function() {
+ self.counter++;
+ return Reflect.get.apply(this, arguments);
+ },
+ set: function() {
+ self.counter++;
+ return Reflect.set.apply(this, arguments);
+ },
+ deleteProperty: function() {
+ self.counter++;
+ return Reflect.deleteProperty.apply(this, arguments);
+ },
+ ownKeys: function() {
+ self.counter++;
+ return Reflect.ownKeys.apply(this, arguments);
+ },
+ apply: function() {
+ self.counter++;
+ return Reflect.apply.apply(this, arguments);
+ },
+ construct: function() {
+ self.counter++;
+ return Reflect.construct.apply(this, arguments);
+ }
+ };
+ return new Proxy({ a : 1}, handler);
+}`);
+
+Protocol.Runtime.evaluate({ expression: "testFunction()"}).then(requestProperties);
+
+function requestProperties(result)
+{
+ Protocol.Runtime.getProperties({ objectId: result.result.objectId, generatePreview: true }).then(checkCounter);
+}
+
+function checkCounter(result)
+{
+ Protocol.Runtime.evaluate({ expression: "self.counter" }).then(dumpCounter);
+}
+
+function dumpCounter(result)
+{
+ InspectorTest.logMessage(result);
+ InspectorTest.completeTest();
+}
diff --git a/deps/v8/test/inspector/runtime/get-properties-preview-expected.txt b/deps/v8/test/inspector/runtime/get-properties-preview-expected.txt
new file mode 100644
index 0000000000..fd1f31a4c2
--- /dev/null
+++ b/deps/v8/test/inspector/runtime/get-properties-preview-expected.txt
@@ -0,0 +1,32 @@
+p1 : Object
+p2 : Object
+p1 : {
+ "type": "object",
+ "description": "Object",
+ "overflow": false,
+ "properties": [
+ {
+ "name": "a",
+ "type": "number",
+ "value": "1"
+ }
+ ]
+}
+p2 : {
+ "type": "object",
+ "description": "Object",
+ "overflow": false,
+ "properties": [
+ {
+ "name": "b",
+ "type": "string",
+ "value": "foo"
+ },
+ {
+ "name": "bb",
+ "type": "string",
+ "value": "bar"
+ }
+ ]
+}
+
diff --git a/deps/v8/test/inspector/runtime/get-properties-preview.js b/deps/v8/test/inspector/runtime/get-properties-preview.js
new file mode 100644
index 0000000000..7cc81bc486
--- /dev/null
+++ b/deps/v8/test/inspector/runtime/get-properties-preview.js
@@ -0,0 +1,25 @@
+// Copyright 2016 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+Protocol.Runtime.evaluate({ "expression": "({p1: {a:1}, p2: {b:'foo', bb:'bar'}})" }).then(callbackEvaluate);
+
+function callbackEvaluate(result)
+{
+ Protocol.Runtime.getProperties({ "objectId": result.result.result.objectId, "ownProperties": true }).then(callbackGetProperties.bind(null, false));
+ Protocol.Runtime.getProperties({ "objectId": result.result.result.objectId, "ownProperties": true, "generatePreview": true }).then(callbackGetProperties.bind(null, true));
+}
+
+function callbackGetProperties(completeTest, result)
+{
+ for (var property of result.result.result) {
+ if (!property.value || property.name === "__proto__")
+ continue;
+ if (property.value.preview)
+ InspectorTest.log(property.name + " : " + JSON.stringify(property.value.preview, null, 4));
+ else
+ InspectorTest.log(property.name + " : " + property.value.description);
+ }
+ if (completeTest)
+ InspectorTest.completeTest();
+}
diff --git a/deps/v8/test/inspector/runtime/get-properties.js b/deps/v8/test/inspector/runtime/get-properties.js
new file mode 100644
index 0000000000..579e5422d9
--- /dev/null
+++ b/deps/v8/test/inspector/runtime/get-properties.js
@@ -0,0 +1,221 @@
+// Copyright 2016 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// A general-purpose engine for sending a sequence of protocol commands.
+// The clients provide requests and response handlers, while the engine catches
+// errors and makes sure that once there's nothing to do completeTest() is called.
+// @param step is an object with command, params and callback fields
+function runRequestSeries(step)
+{
+ processStep(step);
+
+ function processStep(s)
+ {
+ try {
+ processStepOrFail(s);
+ } catch (e) {
+ InspectorTest.log(e.stack);
+ InspectorTest.completeTest();
+ }
+ }
+
+ function processStepOrFail(s)
+ {
+ if (!s) {
+ InspectorTest.completeTest();
+ return;
+ }
+ if (!s.command) {
+ // A simple loopback step.
+ var next = s.callback();
+ processStep(next);
+ return;
+ }
+
+ var innerCallback = function(response)
+ {
+ if ("error" in response) {
+ InspectorTest.log(response.error.message);
+ InspectorTest.completeTest();
+ return;
+ }
+ var next;
+ try {
+ next = s.callback(response.result);
+ } catch (e) {
+ InspectorTest.log(e.stack);
+ InspectorTest.completeTest();
+ return;
+ }
+ processStep(next);
+ }
+ var command = s.command.split(".");
+ Protocol[command[0]][command[1]](s.params).then(innerCallback);
+ }
+}
+
+var firstStep = { callback: callbackStart5 };
+
+runRequestSeries(firstStep);
+
+// 'Object5' section -- check properties of '5' wrapped as object (has an internal property).
+
+function callbackStart5()
+{
+ // Create an wrapper object with additional property.
+ var expression = "(function(){var r = Object(5); r.foo = 'cat';return r;})()";
+
+ return { command: "Runtime.evaluate", params: {expression: expression}, callback: callbackEval5 };
+}
+function callbackEval5(result)
+{
+ var id = result.result.objectId;
+ if (id === undefined)
+ throw new Error("objectId is expected");
+ return {
+ command: "Runtime.getProperties", params: {objectId: id, ownProperties: true}, callback: callbackProperties5
+ };
+}
+function callbackProperties5(result)
+{
+ logGetPropertiesResult("Object(5)", result);
+ return { callback: callbackStartNotOwn };
+}
+
+
+// 'Not own' section -- check all properties of the object, including ones from it prototype chain.
+
+function callbackStartNotOwn()
+{
+ // Create an wrapper object with additional property.
+ var expression = "({ a: 2, set b(_) {}, get b() {return 5;}, __proto__: { a: 3, c: 4, get d() {return 6;} }})";
+
+ return { command: "Runtime.evaluate", params: {expression: expression}, callback: callbackEvalNotOwn };
+}
+function callbackEvalNotOwn(result)
+{
+ var id = result.result.objectId;
+ if (id === undefined)
+ throw new Error("objectId is expected");
+ return {
+ command: "Runtime.getProperties", params: {objectId: id, ownProperties: false}, callback: callbackPropertiesNotOwn
+ };
+}
+function callbackPropertiesNotOwn(result)
+{
+ logGetPropertiesResult("Not own properties", result);
+ return { callback: callbackStartAccessorsOnly };
+}
+
+
+// 'Accessors only' section -- check only accessor properties of the object.
+
+function callbackStartAccessorsOnly()
+{
+ // Create an wrapper object with additional property.
+ var expression = "({ a: 2, set b(_) {}, get b() {return 5;}, c: 'c', set d(_){} })";
+
+ return { command: "Runtime.evaluate", params: {expression: expression}, callback: callbackEvalAccessorsOnly };
+}
+function callbackEvalAccessorsOnly(result)
+{
+ var id = result.result.objectId;
+ if (id === undefined)
+ throw new Error("objectId is expected");
+ return {
+ command: "Runtime.getProperties", params: {objectId: id, ownProperties: true, accessorPropertiesOnly: true}, callback: callbackPropertiesAccessorsOnly
+ };
+}
+function callbackPropertiesAccessorsOnly(result)
+{
+ logGetPropertiesResult("Accessor only properties", result);
+ return { callback: callbackStartArray };
+}
+
+
+// 'Array' section -- check properties of an array.
+
+function callbackStartArray()
+{
+ var expression = "['red', 'green', 'blue']";
+ return { command: "Runtime.evaluate", params: {expression: expression}, callback: callbackEvalArray };
+}
+function callbackEvalArray(result)
+{
+ var id = result.result.objectId;
+ if (id === undefined)
+ throw new Error("objectId is expected");
+ return {
+ command: "Runtime.getProperties", params: {objectId: id, ownProperties: true}, callback: callbackPropertiesArray
+ };
+}
+function callbackPropertiesArray(result)
+{
+ logGetPropertiesResult("array", result);
+ return { callback: callbackStartBound };
+}
+
+
+// 'Bound' section -- check properties of a bound function (has a bunch of internal properties).
+
+function callbackStartBound()
+{
+ var expression = "Number.bind({}, 5)";
+ return { command: "Runtime.evaluate", params: {expression: expression}, callback: callbackEvalBound };
+}
+function callbackEvalBound(result)
+{
+ var id = result.result.objectId;
+ if (id === undefined)
+ throw new Error("objectId is expected");
+ return {
+ command: "Runtime.getProperties", params: {objectId: id, ownProperties: true}, callback: callbackPropertiesBound
+ };
+}
+function callbackPropertiesBound(result)
+{
+ logGetPropertiesResult("Bound function", result);
+ return; // End of test
+}
+
+// A helper function that dumps object properties and internal properties in sorted order.
+function logGetPropertiesResult(title, protocolResult)
+{
+ function hasGetterSetter(property, fieldName)
+ {
+ var v = property[fieldName];
+ if (!v)
+ return false;
+ return v.type !== "undefined"
+ }
+
+ InspectorTest.log("Properties of " + title);
+ var propertyArray = protocolResult.result;
+ propertyArray.sort(NamedThingComparator);
+ for (var i = 0; i < propertyArray.length; i++) {
+ var p = propertyArray[i];
+ var v = p.value;
+ var own = p.isOwn ? "own" : "inherited";
+ if (v)
+ InspectorTest.log(" " + p.name + " " + own + " " + v.type + " " + v.value);
+ else
+ InspectorTest.log(" " + p.name + " " + own + " no value" +
+ (hasGetterSetter(p, "get") ? ", getter" : "") + (hasGetterSetter(p, "set") ? ", setter" : ""));
+ }
+ var internalPropertyArray = protocolResult.internalProperties;
+ if (internalPropertyArray) {
+ InspectorTest.log("Internal properties");
+ internalPropertyArray.sort(NamedThingComparator);
+ for (var i = 0; i < internalPropertyArray.length; i++) {
+ var p = internalPropertyArray[i];
+ var v = p.value;
+ InspectorTest.log(" " + p.name + " " + v.type + " " + v.value);
+ }
+ }
+
+ function NamedThingComparator(o1, o2)
+ {
+ return o1.name === o2.name ? 0 : (o1.name < o2.name ? -1 : 1);
+ }
+}
diff --git a/deps/v8/test/inspector/runtime/property-on-console-proto-expected.txt b/deps/v8/test/inspector/runtime/property-on-console-proto-expected.txt
new file mode 100644
index 0000000000..6e75294e82
--- /dev/null
+++ b/deps/v8/test/inspector/runtime/property-on-console-proto-expected.txt
@@ -0,0 +1,12 @@
+Tests that property defined on console.__proto__ doesn't observable on other Objects.
+{
+ id : <messageId>
+ result : {
+ result : {
+ description : 0
+ type : number
+ value : 0
+ }
+ }
+}
+
diff --git a/deps/v8/test/inspector/runtime/property-on-console-proto.js b/deps/v8/test/inspector/runtime/property-on-console-proto.js
new file mode 100644
index 0000000000..001dd00291
--- /dev/null
+++ b/deps/v8/test/inspector/runtime/property-on-console-proto.js
@@ -0,0 +1,25 @@
+// Copyright 2016 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+print("Tests that property defined on console.__proto__ doesn't observable on other Objects.");
+
+InspectorTest.addScript(`
+function testFunction()
+{
+ var amountOfProperties = 0;
+ for (var p in {})
+ ++amountOfProperties;
+ console.__proto__.debug = 239;
+ for (var p in {})
+ --amountOfProperties;
+ return amountOfProperties;
+}`);
+
+Protocol.Runtime.evaluate({ "expression": "testFunction()" }).then(dumpResult);
+
+function dumpResult(result)
+{
+ InspectorTest.logMessage(result);
+ InspectorTest.completeTest();
+}
diff --git a/deps/v8/test/inspector/runtime/protocol-works-with-different-locale-expected.txt b/deps/v8/test/inspector/runtime/protocol-works-with-different-locale-expected.txt
new file mode 100644
index 0000000000..d526d5d447
--- /dev/null
+++ b/deps/v8/test/inspector/runtime/protocol-works-with-different-locale-expected.txt
@@ -0,0 +1,138 @@
+Running test: consoleLogWithDefaultLocale
+{
+ method : Runtime.consoleAPICalled
+ params : {
+ args : [
+ [0] : {
+ description : 239
+ type : number
+ value : 239
+ }
+ ]
+ executionContextId : <executionContextId>
+ stackTrace : {
+ callFrames : [
+ [0] : {
+ columnNumber : 8
+ functionName :
+ lineNumber : 0
+ scriptId : <scriptId>
+ url :
+ }
+ ]
+ }
+ timestamp : <timestamp>
+ type : log
+ }
+}
+
+Running test: consoleTimeWithCommaAsSeparator
+set locale to fr_CA.UTF-8 (has comma as separator)
+{
+ method : Runtime.consoleAPICalled
+ params : {
+ args : [
+ [0] : {
+ type : string
+ value : a: x.xms
+ }
+ ]
+ executionContextId : <executionContextId>
+ stackTrace : {
+ callFrames : [
+ [0] : {
+ columnNumber : 27
+ functionName :
+ lineNumber : 0
+ scriptId : <scriptId>
+ url :
+ }
+ ]
+ }
+ timestamp : <timestamp>
+ type : debug
+ }
+}
+
+Running test: consoleLogWithCommaAsSeparator
+set locale to fr_CA.UTF-8 (has comma as separator)
+{
+ method : Runtime.consoleAPICalled
+ params : {
+ args : [
+ [0] : {
+ description : 239
+ type : number
+ value : 239
+ }
+ ]
+ executionContextId : <executionContextId>
+ stackTrace : {
+ callFrames : [
+ [0] : {
+ columnNumber : 8
+ functionName :
+ lineNumber : 0
+ scriptId : <scriptId>
+ url :
+ }
+ ]
+ }
+ timestamp : <timestamp>
+ type : log
+ }
+}
+
+Running test: consoleTimeWithCommaAfterConsoleLog
+set locale to fr_CA.UTF-8 (has comma as separator)
+{
+ method : Runtime.consoleAPICalled
+ params : {
+ args : [
+ [0] : {
+ description : 239
+ type : number
+ value : 239
+ }
+ ]
+ executionContextId : <executionContextId>
+ stackTrace : {
+ callFrames : [
+ [0] : {
+ columnNumber : 8
+ functionName :
+ lineNumber : 0
+ scriptId : <scriptId>
+ url :
+ }
+ ]
+ }
+ timestamp : <timestamp>
+ type : log
+ }
+}
+{
+ method : Runtime.consoleAPICalled
+ params : {
+ args : [
+ [0] : {
+ type : string
+ value : a: x.xms
+ }
+ ]
+ executionContextId : <executionContextId>
+ stackTrace : {
+ callFrames : [
+ [0] : {
+ columnNumber : 27
+ functionName :
+ lineNumber : 0
+ scriptId : <scriptId>
+ url :
+ }
+ ]
+ }
+ timestamp : <timestamp>
+ type : debug
+ }
+}
diff --git a/deps/v8/test/inspector/runtime/protocol-works-with-different-locale.js b/deps/v8/test/inspector/runtime/protocol-works-with-different-locale.js
new file mode 100644
index 0000000000..381dfab31e
--- /dev/null
+++ b/deps/v8/test/inspector/runtime/protocol-works-with-different-locale.js
@@ -0,0 +1,40 @@
+// Copyright 2016 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+Protocol.Runtime.enable();
+
+Protocol.Runtime.onConsoleAPICalled(dumpConsoleApiCalled);
+
+InspectorTest.runTestSuite([
+ function consoleLogWithDefaultLocale(next) {
+ Protocol.Runtime.evaluate({ expression: "console.log(239) "}).then(next);
+ },
+
+ function consoleTimeWithCommaAsSeparator(next) {
+ InspectorTest.log("set locale to fr_CA.UTF-8 (has comma as separator)");
+ setlocale("fr_CA.UTF-8");
+ Protocol.Runtime.evaluate({ expression: "console.time(\"a\"); console.timeEnd(\"a\")"}).then(next);
+ },
+
+ function consoleLogWithCommaAsSeparator(next) {
+ InspectorTest.log("set locale to fr_CA.UTF-8 (has comma as separator)");
+ setlocale("fr_CA.UTF-8");
+ Protocol.Runtime.evaluate({ expression: "console.log(239) "}).then(next);
+ },
+
+ function consoleTimeWithCommaAfterConsoleLog(next) {
+ InspectorTest.log("set locale to fr_CA.UTF-8 (has comma as separator)");
+ setlocale("fr_CA.UTF-8");
+ Protocol.Runtime.evaluate({ expression: "console.log(239) "})
+ .then(() => Protocol.Runtime.evaluate({ expression: "console.time(\"a\"); console.timeEnd(\"a\")"}))
+ .then(next);
+ }
+]);
+
+function dumpConsoleApiCalled(message) {
+ var firstArg = message.params.args[0];
+ if (firstArg.type === "string")
+ firstArg.value = firstArg.value.replace(/[0-9]+/g, "x");
+ InspectorTest.logMessage(message);
+}
diff --git a/deps/v8/test/inspector/runtime/run-script-async-expected.txt b/deps/v8/test/inspector/runtime/run-script-async-expected.txt
new file mode 100644
index 0000000000..c6a53caee6
--- /dev/null
+++ b/deps/v8/test/inspector/runtime/run-script-async-expected.txt
@@ -0,0 +1,191 @@
+Tests that Runtime.compileScript and Runtime.runScript work with awaitPromise flag.
+
+Running test: testRunAndCompileWithoutAgentEnable
+{
+ error : {
+ code : -32000
+ message : Runtime agent is not enabled
+ }
+ id : <messageId>
+}
+{
+ error : {
+ code : -32000
+ message : Runtime agent is not enabled
+ }
+ id : <messageId>
+}
+
+Running test: testSyntaxErrorInScript
+{
+ id : <messageId>
+ result : {
+ exceptionDetails : {
+ columnNumber : 1
+ exception : {
+ className : SyntaxError
+ description : SyntaxError: Unexpected token }
+ objectId : <objectId>
+ subtype : error
+ type : object
+ }
+ exceptionId : <exceptionId>
+ lineNumber : 1
+ scriptId : <scriptId>
+ text : Uncaught
+ }
+ }
+}
+
+Running test: testSyntaxErrorInEvalInScript
+{
+ id : <messageId>
+ result : {
+ exceptionDetails : {
+ columnNumber : 0
+ exception : {
+ className : SyntaxError
+ description : SyntaxError: Unexpected token } at boo.js:2:2
+ objectId : <objectId>
+ subtype : error
+ type : object
+ }
+ exceptionId : <exceptionId>
+ lineNumber : 0
+ scriptId : <scriptId>
+ stackTrace : {
+ callFrames : [
+ [0] : {
+ columnNumber : 1
+ functionName :
+ lineNumber : 1
+ scriptId : <scriptId>
+ url : boo.js
+ }
+ ]
+ }
+ text : Uncaught
+ }
+ result : {
+ className : SyntaxError
+ description : SyntaxError: Unexpected token } at boo.js:2:2
+ objectId : <objectId>
+ subtype : error
+ type : object
+ }
+ }
+}
+
+Running test: testRunNotCompiledScript
+{
+ error : {
+ code : -32000
+ message : No script with given id
+ }
+ id : <messageId>
+}
+
+Running test: testRunCompiledScriptAfterAgentWasReenabled
+{
+ error : {
+ code : -32000
+ message : Runtime agent is not enabled
+ }
+ id : <messageId>
+}
+{
+ error : {
+ code : -32000
+ message : No script with given id
+ }
+ id : <messageId>
+}
+
+Running test: testRunScriptWithPreview
+{
+ id : <messageId>
+ result : {
+ result : {
+ className : Object
+ description : Object
+ objectId : <objectId>
+ preview : {
+ description : Object
+ overflow : false
+ properties : [
+ [0] : {
+ name : a
+ type : number
+ value : 1
+ }
+ ]
+ type : object
+ }
+ type : object
+ }
+ }
+}
+
+Running test: testRunScriptReturnByValue
+{
+ id : <messageId>
+ result : {
+ result : {
+ type : object
+ value : {
+ a : 1
+ }
+ }
+ }
+}
+
+Running test: testAwaitNotPromise
+{
+ error : {
+ code : -32000
+ message : Result of the script execution is not a promise
+ }
+ id : <messageId>
+}
+
+Running test: testAwaitResolvedPromise
+{
+ id : <messageId>
+ result : {
+ result : {
+ type : object
+ value : {
+ a : 1
+ }
+ }
+ }
+}
+
+Running test: testAwaitRejectedPromise
+{
+ id : <messageId>
+ result : {
+ exceptionDetails : {
+ columnNumber : 0
+ exception : {
+ type : object
+ value : {
+ a : 1
+ }
+ }
+ exceptionId : <exceptionId>
+ lineNumber : 0
+ stackTrace : {
+ callFrames : [
+ ]
+ }
+ text : Uncaught (in promise)
+ }
+ result : {
+ type : object
+ value : {
+ a : 1
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/deps/v8/test/inspector/runtime/run-script-async.js b/deps/v8/test/inspector/runtime/run-script-async.js
new file mode 100644
index 0000000000..0aa90962a5
--- /dev/null
+++ b/deps/v8/test/inspector/runtime/run-script-async.js
@@ -0,0 +1,110 @@
+// Copyright 2016 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+print("Tests that Runtime.compileScript and Runtime.runScript work with awaitPromise flag.");
+
+InspectorTest.runTestSuite([
+ function testRunAndCompileWithoutAgentEnable(next)
+ {
+ Protocol.Runtime.compileScript({ expression: "", sourceURL: "", persistScript: true })
+ .then((result) => InspectorTest.logMessage(result))
+ .then(() => Protocol.Runtime.runScript({ scriptId: "1" }))
+ .then((result) => InspectorTest.logMessage(result))
+ .then(() => next());
+ },
+
+ function testSyntaxErrorInScript(next)
+ {
+ Protocol.Runtime.enable()
+ .then(() => Protocol.Runtime.compileScript({ expression: "\n }", sourceURL: "boo.js", persistScript: true }))
+ .then((result) => InspectorTest.logMessage(result))
+ .then(() => Protocol.Runtime.disable())
+ .then(() => next());
+ },
+
+ function testSyntaxErrorInEvalInScript(next)
+ {
+ Protocol.Runtime.enable()
+ .then(() => Protocol.Runtime.compileScript({ expression: "{\n eval(\"\\\n}\")\n}", sourceURL: "boo.js", persistScript: true }))
+ .then((result) => Protocol.Runtime.runScript({ scriptId: result.result.scriptId }))
+ .then((result) => InspectorTest.logMessage(result))
+ .then(() => Protocol.Runtime.disable())
+ .then(() => next());
+ },
+
+ function testRunNotCompiledScript(next)
+ {
+ Protocol.Runtime.enable()
+ .then((result) => Protocol.Runtime.runScript({ scriptId: "1" }))
+ .then((result) => InspectorTest.logMessage(result))
+ .then(() => Protocol.Runtime.disable())
+ .then(() => next());
+ },
+
+ function testRunCompiledScriptAfterAgentWasReenabled(next)
+ {
+ var scriptId;
+ Protocol.Runtime.enable()
+ .then(() => Protocol.Runtime.compileScript({ expression: "{\n eval(\"\\\n}\")\n}", sourceURL: "boo.js", persistScript: true }))
+ .then((result) => scriptId = result.result.scriptId)
+ .then(() => Protocol.Runtime.disable())
+ .then((result) => Protocol.Runtime.runScript({ scriptId: scriptId }))
+ .then((result) => InspectorTest.logMessage(result))
+ .then(() => Protocol.Runtime.enable())
+ .then((result) => Protocol.Runtime.runScript({ scriptId: scriptId }))
+ .then((result) => InspectorTest.logMessage(result))
+ .then(() => Protocol.Runtime.disable())
+ .then(() => next());
+ },
+
+ function testRunScriptWithPreview(next)
+ {
+ Protocol.Runtime.enable()
+ .then(() => Protocol.Runtime.compileScript({ expression: "({a:1})", sourceURL: "boo.js", persistScript: true }))
+ .then((result) => Protocol.Runtime.runScript({ scriptId: result.result.scriptId, generatePreview: true }))
+ .then((result) => InspectorTest.logMessage(result))
+ .then(() => Protocol.Runtime.disable())
+ .then(() => next());
+ },
+
+ function testRunScriptReturnByValue(next)
+ {
+ Protocol.Runtime.enable()
+ .then(() => Protocol.Runtime.compileScript({ expression: "({a:1})", sourceURL: "boo.js", persistScript: true }))
+ .then((result) => Protocol.Runtime.runScript({ scriptId: result.result.scriptId, returnByValue: true }))
+ .then((result) => InspectorTest.logMessage(result))
+ .then(() => Protocol.Runtime.disable())
+ .then(() => next());
+ },
+
+ function testAwaitNotPromise(next)
+ {
+ Protocol.Runtime.enable()
+ .then(() => Protocol.Runtime.compileScript({ expression: "({a:1})", sourceURL: "boo.js", persistScript: true }))
+ .then((result) => Protocol.Runtime.runScript({ scriptId: result.result.scriptId, awaitPromise: true }))
+ .then((result) => InspectorTest.logMessage(result))
+ .then(() => Protocol.Runtime.disable())
+ .then(() => next());
+ },
+
+ function testAwaitResolvedPromise(next)
+ {
+ Protocol.Runtime.enable()
+ .then(() => Protocol.Runtime.compileScript({ expression: "Promise.resolve({a:1})", sourceURL: "boo.js", persistScript: true }))
+ .then((result) => Protocol.Runtime.runScript({ scriptId: result.result.scriptId, awaitPromise: true, returnByValue: true }))
+ .then((result) => InspectorTest.logMessage(result))
+ .then(() => Protocol.Runtime.disable())
+ .then(() => next());
+ },
+
+ function testAwaitRejectedPromise(next)
+ {
+ Protocol.Runtime.enable()
+ .then(() => Protocol.Runtime.compileScript({ expression: "Promise.reject({a:1})", sourceURL: "boo.js", persistScript: true }))
+ .then((result) => Protocol.Runtime.runScript({ scriptId: result.result.scriptId, awaitPromise: true, returnByValue: true }))
+ .then((result) => InspectorTest.logMessage(result))
+ .then(() => Protocol.Runtime.disable())
+ .then(() => next());
+ }
+]);
diff --git a/deps/v8/test/inspector/runtime/set-or-map-entries-expected.txt b/deps/v8/test/inspector/runtime/set-or-map-entries-expected.txt
new file mode 100644
index 0000000000..05f6d972f1
--- /dev/null
+++ b/deps/v8/test/inspector/runtime/set-or-map-entries-expected.txt
@@ -0,0 +1,9 @@
+Test that Runtime.getProperties doesn't truncate set and map entries in internalProperties.
+Entries for "createSet(10)"
+Array[10]
+Entries for "createSet(1000)"
+Array[1000]
+Entries for "createMap(10)"
+Array[10]
+Entries for "createMap(1000)"
+Array[1000]
diff --git a/deps/v8/test/inspector/runtime/set-or-map-entries.js b/deps/v8/test/inspector/runtime/set-or-map-entries.js
new file mode 100644
index 0000000000..33ba7c0547
--- /dev/null
+++ b/deps/v8/test/inspector/runtime/set-or-map-entries.js
@@ -0,0 +1,52 @@
+// Copyright 2016 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+print("Test that Runtime.getProperties doesn't truncate set and map entries in internalProperties.")
+
+InspectorTest.addScript(`
+ function createSet(size) {
+ var s = new Set();
+ var a = {};
+ a.a = a;
+ for (var i = 0; i < size; ++i) s.add({ wrapper: a});
+ return s;
+ }
+
+ function createMap(size) {
+ var m = new Map();
+ var a = {};
+ a.a = a;
+ for (var i = 0; i < size; ++i) m.set(i, { wrapper: a});
+ return m;
+ }
+`);
+
+Protocol.Debugger.enable();
+Protocol.Runtime.enable();
+
+testExpression("createSet(10)")
+ .then(() => testExpression("createSet(1000)"))
+ .then(() => testExpression("createMap(10)"))
+ .then(() => testExpression("createMap(1000)"))
+ .then(() => InspectorTest.completeTest());
+
+function testExpression(expression)
+{
+ return Protocol.Runtime.evaluate({ "expression": expression})
+ .then(result => Protocol.Runtime.getProperties({ ownProperties: true, objectId: result.result.result.objectId }))
+ .then(message => dumpEntriesDescription(expression, message));
+}
+
+function dumpEntriesDescription(expression, message)
+{
+ InspectorTest.log(`Entries for "${expression}"`);
+ var properties = message.result.internalProperties;
+ var property;
+ if (properties)
+ property = properties.find(property => property.name === "[[Entries]]");
+ if (!property)
+ InspectorTest.log("[[Entries]] not found");
+ else
+ InspectorTest.log(property.value.description);
+}