OLD | NEW |
| (Empty) |
1 <html> | |
2 <head> | |
3 <script type="text/javascript" src="../../http/tests/inspector-protocol/resource
s/inspector-protocol-test.js"></script> | |
4 <script> | |
5 | |
6 function test() | |
7 { | |
8 InspectorTest.sendCommand("Runtime.evaluate", { expression: "let a = 42;" },
step2); | |
9 | |
10 function step2(response) | |
11 { | |
12 failIfError(response); | |
13 InspectorTest.log("first \"let a = 1;\" result: wasThrown = " + !!respon
se.result.exceptionDetails); | |
14 InspectorTest.sendCommand("Runtime.evaluate", { expression: "let a = 239
;" }, step3); | |
15 } | |
16 | |
17 function step3(response) | |
18 { | |
19 failIfError(response); | |
20 InspectorTest.log("second \"let a = 1;\" result: wasThrown = " + !!respo
nse.result.exceptionDetails); | |
21 if (response.result.exceptionDetails) | |
22 InspectorTest.log("exception message: " + response.result.exceptionD
etails.text + " " + response.result.exceptionDetails.exception.description); | |
23 InspectorTest.sendCommand("Runtime.evaluate", { expression: "a" }, step4
); | |
24 } | |
25 | |
26 function step4(response) | |
27 { | |
28 failIfError(response); | |
29 InspectorTest.log(JSON.stringify(response.result)); | |
30 checkMethod(null); | |
31 } | |
32 | |
33 var methods = [ "$", "$$", "$x", "dir", "dirxml", "keys", "values", "profile
", "profileEnd", | |
34 "monitorEvents", "unmonitorEvents", "inspect", "copy", "clear", "getEven
tListeners", | |
35 "debug", "undebug", "monitor", "unmonitor", "table" ]; | |
36 | |
37 function checkMethod(response) | |
38 { | |
39 failIfError(response); | |
40 | |
41 if (response) | |
42 InspectorTest.log(response.result.result.description); | |
43 | |
44 var method = methods.shift(); | |
45 if (!method) | |
46 InspectorTest.completeTest(); | |
47 | |
48 InspectorTest.sendCommand("Runtime.evaluate", { expression: method, incl
udeCommandLineAPI: true }, checkMethod); | |
49 } | |
50 | |
51 function failIfError(response) | |
52 { | |
53 if (response && response.error) { | |
54 InspectorTest.log("FAIL: " + JSON.stringify(response.error)); | |
55 } | |
56 } | |
57 } | |
58 | |
59 </script> | |
60 </head> | |
61 <body onload="runTest()"> | |
62 </body> | |
63 </html> | |
OLD | NEW |