Index: third_party/WebKit/LayoutTests/inspector-protocol/console/console-let-const-with-api.html |
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/console/console-let-const-with-api.html b/third_party/WebKit/LayoutTests/inspector-protocol/console/console-let-const-with-api.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c6c0b0da8997902acf5551a21fecb5d2ddec94f5 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/inspector-protocol/console/console-let-const-with-api.html |
@@ -0,0 +1,63 @@ |
+<html> |
+<head> |
+<script type="text/javascript" src="../../http/tests/inspector-protocol/inspector-protocol-test.js"></script> |
+<script> |
+ |
+function test() |
+{ |
+ InspectorTest.sendCommand("Runtime.evaluate", { expression: "let a = 42;" }, step2); |
+ |
+ function step2(response) |
+ { |
+ failIfError(response); |
+ InspectorTest.log("first \"let a = 1;\" result: wasThrown = " + response.result.wasThrown); |
+ InspectorTest.sendCommand("Runtime.evaluate", { expression: "let a = 239;" }, step3); |
+ } |
+ |
+ function step3(response) |
+ { |
+ failIfError(response); |
+ InspectorTest.log("second \"let a = 1;\" result: wasThrown = " + response.result.wasThrown); |
+ if (response.result.wasThrown) |
+ InspectorTest.log("exception message: " + response.result.exceptionDetails.text); |
+ InspectorTest.sendCommand("Runtime.evaluate", { expression: "a" }, step4); |
+ } |
+ |
+ function step4(response) |
+ { |
+ failIfError(response); |
+ InspectorTest.log(JSON.stringify(response.result)); |
+ checkMethod(null); |
+ } |
+ |
+ var methods = [ "$", "$$", "$x", "dir", "dirxml", "keys", "values", "profile", "profileEnd", |
+ "monitorEvents", "unmonitorEvents", "inspect", "copy", "clear", "getEventListeners", |
+ "debug", "undebug", "monitor", "unmonitor", "table" ]; |
+ |
+ function checkMethod(response) |
+ { |
+ failIfError(response); |
+ |
+ if (response) |
+ InspectorTest.log(response.result.result.description); |
+ |
+ var method = methods.shift(); |
+ if (!method) |
+ InspectorTest.completeTest(); |
+ |
+ InspectorTest.sendCommand("Runtime.evaluate", { expression: method, includeCommandLineAPI: true }, checkMethod); |
+ } |
+ |
+ function failIfError(response) |
+ { |
+ if (response && response.error) { |
+ InspectorTest.log("FAIL: " + JSON.stringify(response.error)); |
+ } |
+ } |
+} |
+ |
+</script> |
+</head> |
+<body onload="runTest()"> |
+</body> |
+</html> |