Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(178)

Side by Side Diff: LayoutTests/inspector/sources/debugger/show-generator-location.html

Issue 1153923005: DevTools: shard inspector/debugger tests for faster execution. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script src="../../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../../http/tests/inspector/console-test.js"></script>
5 <script>
6
7 function forward(iter, step)
8 {
9 while (step-- > 0)
10 iter.next();
11 return iter;
12 }
13
14 function* gen()
15 {
16 yield 1;
17 yield 2;
18 yield 3;
19 }
20
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);
26
27 function test()
28 {
29 var panel = WebInspector.panels.sources;
30
31 function performStandardTestCase(pageExpression, next)
32 {
33 InspectorTest.addSniffer(panel, "showUISourceCode", showUISourceCodeHook );
34 InspectorTest.evaluateInPage(pageExpression, didEvaluate);
35
36 function didEvaluate(remote)
37 {
38 panel._showGeneratorLocation(remote);
39 }
40
41 function showUISourceCodeHook(uiSourceCode, lineNumber, columnNumber, fo rceShowInPanel)
42 {
43 // lineNumber and columnNumber are 0-based
44 ++lineNumber;
45 ++columnNumber;
46 InspectorTest.addResult("Generator location revealed: [" + lineNumbe r + ":" + columnNumber + "]");
47 next();
48 }
49 }
50
51 var expressions = [
52 "iterNotStarted",
53 "iterSuspended1",
54 "iterSuspended2",
55 "iterSuspended3",
56 "iterClosed",
57 ];
58
59 function createTestSuiteFunction(expression)
60 {
61 var functionName = "test" + expression.toTitleCase();
62 return eval("function " + functionName + "(next)\n" +
63 "{\n" +
64 " performStandardTestCase('" + expression + "', next);\n" +
65 "}; " + functionName);
66 }
67
68 InspectorTest.runTestSuite(expressions.map(createTestSuiteFunction));
69 }
70
71 </script>
72 </head>
73
74 <body onload="runTest()">
75 <p>
76 Tests that "Show Generator Location" jumps to the correct location.
77 </p>
78 </body>
79 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698