| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../../http/tests/inspector/inspector-test.js"></script> |
| 4 <script src="../../../http/tests/inspector/debugger-test.js"></script> | 4 <script src="../../../http/tests/inspector/debugger-test.js"></script> |
| 5 <script> | 5 <script> |
| 6 | 6 |
| 7 function forward(iter, step) | 7 function forward(iter, step) |
| 8 { | 8 { |
| 9 while (step-- > 0) | 9 while (step-- > 0) |
| 10 iter.next(); | 10 iter.next(); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 | 35 |
| 36 var anonymousGenIter = (function*() { | 36 var anonymousGenIter = (function*() { |
| 37 yield 21; | 37 yield 21; |
| 38 yield 22; | 38 yield 22; |
| 39 yield 23; | 39 yield 23; |
| 40 })(); | 40 })(); |
| 41 forward(anonymousGenIter, 3); | 41 forward(anonymousGenIter, 3); |
| 42 | 42 |
| 43 function test() | 43 function test() |
| 44 { | 44 { |
| 45 function dumpGeneratorObjectDetails(details) | |
| 46 { | |
| 47 InspectorTest.addResult("functionName: \"" + details.functionName + "\""
); | |
| 48 InspectorTest.addResult("lineNumber: " + (details.location.lineNumber +
1)); | |
| 49 InspectorTest.addResult("columnNumber: " + details.location.columnNumber
); | |
| 50 InspectorTest.addResult("scriptId is valid: " + !!details.location.scrip
tId); | |
| 51 InspectorTest.addResult("status: " + details.status); | |
| 52 } | |
| 53 | |
| 54 function performStandardTestCase(pageExpression, next) | 45 function performStandardTestCase(pageExpression, next) |
| 55 { | 46 { |
| 56 InspectorTest.evaluateInPage(pageExpression, didEvaluate); | 47 InspectorTest.evaluateInPage(pageExpression, didEvaluate); |
| 57 | 48 |
| 58 function didEvaluate(remote) | 49 function didEvaluate(remote) |
| 59 { | 50 { |
| 60 InspectorTest.addResult(pageExpression + ": type = " + remote.type +
", subtype = " + remote.subtype); | 51 InspectorTest.addResult(pageExpression + ": type = " + remote.type +
", subtype = " + remote.subtype); |
| 61 InspectorTest.DebuggerAgent.getGeneratorObjectDetails(remote.objectI
d, didGetDetails); | 52 remote.getOwnPropertiesPromise().then(dumpInternalProperties.bind(nu
ll, remote)); |
| 62 } | 53 } |
| 63 | 54 |
| 64 function didGetDetails(error, response) | 55 function dumpInternalProperties(remote, properties) |
| 65 { | 56 { |
| 66 InspectorTest.assertTrue(!error, "FAIL: " + error); | 57 InspectorTest.assertTrue(properties && properties.internalProperties
, "FAIL: no properties"); |
| 67 dumpGeneratorObjectDetails(response); | 58 for (var prop of properties.internalProperties) |
| 59 InspectorTest.addResult(prop.name + " = " + prop.value.descripti
on); |
| 60 remote.debuggerModel().generatorObjectLocation(remote).then(dumpLoca
tion); |
| 61 } |
| 62 |
| 63 function dumpLocation(location) |
| 64 { |
| 65 InspectorTest.addResult("lineNumber = " + location.lineNumber); |
| 66 InspectorTest.addResult("columnNumber = " + location.columnNumber); |
| 67 InspectorTest.addResult("script is valid: " + (location.script() ? "
yes" : "no")); |
| 68 next(); | 68 next(); |
| 69 } | 69 } |
| 70 } | 70 } |
| 71 | 71 |
| 72 var expressions = [ | 72 var expressions = [ |
| 73 "iterNotStarted", | 73 "iterNotStarted", |
| 74 "iterSuspended", | 74 "iterSuspended", |
| 75 "iterClosed", | 75 "iterClosed", |
| 76 "iterObjGenerator", | 76 "iterObjGenerator", |
| 77 "anonymousGenIter", | 77 "anonymousGenIter", |
| (...skipping 14 matching lines...) Expand all Loading... |
| 92 </script> | 92 </script> |
| 93 | 93 |
| 94 </head> | 94 </head> |
| 95 | 95 |
| 96 <body onload="runTest()"> | 96 <body onload="runTest()"> |
| 97 <p> | 97 <p> |
| 98 Tests that Debugger.getGeneratorObjectDetails command returns correct result. | 98 Tests that Debugger.getGeneratorObjectDetails command returns correct result. |
| 99 </p> | 99 </p> |
| 100 </body> | 100 </body> |
| 101 </html> | 101 </html> |
| OLD | NEW |