Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/function-details.html |
| diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/function-details.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/function-details.html |
| index 10d9760378fbf64ee81b8d7d271c05d8c08de3fc..fcee1600647cfe519a2e93b37b2f12c558108986 100644 |
| --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/function-details.html |
| +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/function-details.html |
| @@ -45,14 +45,15 @@ var bigClosure = (function(p) { |
| function test() |
| { |
| - function dumpFunctionDetails(details) |
| + function dumpFunctionDetails(properties) |
| { |
| + var location = properties.get("[[FunctionLocation]]").value.value; |
| InspectorTest.addResult("Function details: "); |
| - InspectorTest.addResult("lineNumber: " + details.location.lineNumber); |
| - InspectorTest.addResult("columnNumber: " + details.location.columnNumber); |
| - InspectorTest.addResult("scriptId is valid: " + !!details.location.scriptId); |
| - InspectorTest.addResult("functionName: " + details.functionName); |
| - InspectorTest.addResult("isGenerator: " + details.isGenerator); |
| + InspectorTest.addResult("lineNumber: " + location.lineNumber); |
| + InspectorTest.addResult("columnNumber: " + location.columnNumber); |
| + InspectorTest.addResult("scriptId is valid: " + !!location.scriptId); |
| + InspectorTest.addResult("functionName: " + properties.get("[[FunctionName]]").value.value); |
| + InspectorTest.addResult("isGenerator: " + properties.get("[[IsGenerator]]").value.value); |
| } |
| function dumpFunctionNoScopes() |
| @@ -63,7 +64,7 @@ function test() |
| function dumpFunctionScope(pos, type, propertyDescriptors) |
| { |
| var variables; |
| - if (type == "global") { |
| + if (type == "Global") { |
| variables = "<global object properties omitted>"; |
| } else { |
| var varArray = []; |
| @@ -88,28 +89,37 @@ function test() |
| function loadAndDumpScopeObjects(scopeChain, end) |
| { |
| + var scopes = []; |
| function loadScopeObject(pos, next) |
| { |
| - if (pos >= scopeChain.length) { |
| + if (pos >= scopes.length) { |
| next(); |
| return; |
| } |
| - var scopeJson = scopeChain[pos]; |
| - InspectorTest.RuntimeAgent.getProperties(scopeJson.object.objectId, true, didGetProperties); |
| + InspectorTest.RuntimeAgent.getProperties(scopes[pos].objectId, true, didGetProperties); |
| function didGetProperties(error, propertyDescriptors) |
| { |
| - dumpFunctionScope(pos, scopeJson.type, propertyDescriptors); |
| + dumpFunctionScope(pos, scopes[pos].description, propertyDescriptors); |
| loadScopeObject(pos + 1, next); |
| } |
| } |
| if (scopeChain) { |
| - loadScopeObject(0, end); |
| + InspectorTest.RuntimeAgent.getProperties(scopeChain.value.objectId, true, didGetScopes); |
| } else { |
| dumpFunctionNoScopes(); |
| end(); |
| } |
| + |
| + function didGetScopes(error, properties) |
| + { |
| + for (var prop of properties) { |
| + if (String(prop.name >>> 0) === prop.name) |
| + scopes.push(prop.value); |
| + } |
| + loadScopeObject(0, end); |
| + } |
| } |
| function performStandardTestCase(pageExpression, next) |
| @@ -119,12 +129,15 @@ function test() |
| function didEvaluate(remote) |
| { |
| InspectorTest.addResult(pageExpression + " type = " + remote.type); |
| - InspectorTest.DebuggerAgent.getFunctionDetails(remote.objectId, didGetDetails); |
| + InspectorTest.RuntimeAgent.getProperties(remote.objectId, /* isOwnProperty */ false, didGetDetails); |
| } |
| - function didGetDetails(error, response) |
| + function didGetDetails(error, properties, internalProperties) |
| { |
| - dumpFunctionDetails(response); |
| - loadAndDumpScopeObjects(response.scopeChain, next); |
| + var properties = internalProperties.reduce((map, object) => map.set(object.name, object), new Map()); |
|
dgozman
2016/07/07 19:59:23
For-loop.
kozy
2016/07/07 22:59:07
Done.
|
| + // InspectorTest.addResult(properties); |
|
dgozman
2016/07/07 19:59:23
Commented code.
kozy
2016/07/07 22:59:07
Done.
|
| + // InspectorTest.completeTest(); |
| + dumpFunctionDetails(properties); |
| + loadAndDumpScopeObjects(properties.get("[[Scopes]]"), next); |
| } |
| } |