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

Unified Diff: third_party/WebKit/LayoutTests/inspector-protocol/console/console-let-const-with-api.html

Issue 1617393002: [DevTools] Not use with statement for evaluated console command (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix $1-$4, $_ Created 4 years, 11 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 | third_party/WebKit/LayoutTests/inspector-protocol/console/console-let-const-with-api-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector-protocol/console/console-let-const-with-api-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698