3 <script src=
"../../../http/tests/inspector/inspector-test.js"></script>
4 <script src=
"../../../http/tests/inspector/console-test.js"></script>
7 function forward(iter
, step
)
21 var iterNotStarted
= gen();
22 var iterSuspended1
= forward(gen(), 1);
23 var iterSuspended2
= forward(gen(), 2);
24 var iterSuspended3
= forward(gen(), 3);
25 var iterClosed
= forward(gen(), 4);
29 var panel
= WebInspector
.panels
.sources
;
31 function performStandardTestCase(pageExpression
, next
)
33 InspectorTest
.addSniffer(panel
, "showUISourceCode", showUISourceCodeHook
);
34 InspectorTest
.evaluateInPage(pageExpression
, didEvaluate
);
36 function didEvaluate(remote
)
38 panel
._showGeneratorLocation(remote
);
41 function showUISourceCodeHook(uiSourceCode
, lineNumber
, columnNumber
, forceShowInPanel
)
43 // lineNumber and columnNumber are 0-based
46 InspectorTest
.addResult("Generator location revealed: [" + lineNumber
+ ":" + columnNumber
+ "]");
59 function createTestSuiteFunction(expression
)
61 var functionName
= "test" + expression
.toTitleCase();
62 return eval("function " + functionName
+ "(next)\n" +
64 " performStandardTestCase('" + expression
+ "', next);\n" +
65 "}; " + functionName
);
68 InspectorTest
.runTestSuite(expressions
.map(createTestSuiteFunction
));
74 <body onload=
"runTest()">
76 Tests that
"Show Generator Location" jumps to the correct location.