| <html> |
| <head> |
| <script src="../../../http/tests/inspector/inspector-test.js"></script> |
| <script src="../../../http/tests/inspector/debugger-test.js"></script> |
| <script src="resources/resolve-expressions-compressed.js"></script> |
| <script> |
| function test() |
| { |
| Runtime.experiments.enableForTest("resolveVariableNames"); |
| InspectorTest.startDebuggerTest(step1); |
| |
| function step1() |
| { |
| InspectorTest.runTestFunctionAndWaitUntilPaused(step2); |
| } |
| |
| function step2() |
| { |
| InspectorTest.waitForScriptSource("resolve-expressions-origin.js", step3) |
| } |
| |
| function step3(uiSourceCode) |
| { |
| var positions = [ |
| new Position(7, 11, 23, "object.prop1"), |
| new Position(4, 4, 14, "this.prop2"), |
| new Position(5, 4, 19, "object[\"prop3\"]"), |
| new Position(2, 8, 14, "object"), //object |
| ]; |
| var promise = Promise.resolve(); |
| for (var position of positions) |
| promise = promise.then(testAtPosition.bind(null, uiSourceCode, position)); |
| |
| promise.then(() => InspectorTest.completeDebuggerTest()); |
| } |
| |
| function Position(line, startColumn, endColumn, originText) |
| { |
| this.line = line; |
| this.startColumn = startColumn; |
| this.endColumn = endColumn; |
| this.originText = originText; |
| } |
| |
| function testAtPosition(uiSourceCode, position) |
| { |
| return WebInspector.SourceMapNamesResolver.resolveExpression(InspectorTest.debuggerModel.selectedCallFrame(), position.originText, uiSourceCode, position.line, position.startColumn, position.endColumn) |
| .then(InspectorTest.evaluateOnCurrentCallFrame) |
| .then(remoteObject => InspectorTest.addResult(remoteObject.description)); |
| } |
| } |
| |
| </script> |
| </head> |
| |
| <body onload="runTest()"> |
| <p> |
| Tests evaluation in minified scripts. |
| </p> |
| </body> |
| </html> |