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

Unified Diff: test/inspector/debugger/script-parsed-for-runtime-evaluate.js

Issue 2499273003: [inspector] introduced Script::TYPE_INSPECTOR (Closed)
Patch Set: rebased Created 4 years, 1 month 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 | « src/objects.h ('k') | test/inspector/debugger/script-parsed-for-runtime-evaluate-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/inspector/debugger/script-parsed-for-runtime-evaluate.js
diff --git a/test/inspector/debugger/script-parsed-for-runtime-evaluate.js b/test/inspector/debugger/script-parsed-for-runtime-evaluate.js
new file mode 100644
index 0000000000000000000000000000000000000000..f5a935942dd44cb9295ddfee4c258b3c061929f8
--- /dev/null
+++ b/test/inspector/debugger/script-parsed-for-runtime-evaluate.js
@@ -0,0 +1,49 @@
+// 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("Checks that inspector reports script compiled in Runtime.evaluate," +
+ "Runtime.callFunctionOn and Runtime.compileScript");
+
+Promise.prototype.thenLog = function log(message) {
+ return this.then(() => InspectorTest.log(message));
+}
+
+var objectId;
+Protocol.Runtime.enable();
+Protocol.Debugger.enable()
+ .then(() => Protocol.Debugger.onScriptParsed(InspectorTest.logMessage))
+ .then(() => Protocol.Debugger.onScriptFailedToParse(InspectorTest.logMessage))
+
+ .thenLog('Runtime.evaluate with valid expression')
+ .then(() => Protocol.Runtime.evaluate({
+ expression: "({})//# sourceURL=evaluate.js"}))
+ .then(msg => objectId = msg.result.result.objectId)
+
+ .thenLog('Runtime.evaluate with syntax error')
+ .then(() => Protocol.Runtime.evaluate({
+ expression: "}//# sourceURL=evaluate-syntax-error.js"}))
+
+ .thenLog('Runtime.callFunctionOn with valid functionDeclaration')
+ .then(() => Protocol.Runtime.callFunctionOn({ objectId: objectId,
+ functionDeclaration: "function foo(){}"}))
+
+ .thenLog('Runtime.callFunctionOn with syntax error')
+ .then(() => Protocol.Runtime.callFunctionOn({ objectId: objectId,
+ functionDeclaration: "}"}))
+
+ .thenLog('Runtime.compileScript with valid expression')
+ .then(() => Protocol.Runtime.compileScript({ expression: "({})",
+ sourceURL: "compile-script.js", persistScript: true }))
+
+ .thenLog('Runtime.compileScript with syntax error')
+ .then(() => Protocol.Runtime.compileScript({ expression: "}",
+ sourceURL: "compile-script-syntax-error.js", persistScript: true }))
+
+ .thenLog('Runtime.compileScript persistScript: false (should be no script events)')
+ .then(() => Protocol.Runtime.compileScript({ expression: "({})",
+ sourceURL: "compile-script-syntax-error.js", persistScript: false }))
+ .then(() => Protocol.Runtime.compileScript({ expression: "}",
+ sourceURL: "compile-script-syntax-error.js", persistScript: false }))
+
+ .then(InspectorTest.completeTest);
« no previous file with comments | « src/objects.h ('k') | test/inspector/debugger/script-parsed-for-runtime-evaluate-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698