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/console-test.js"></script> | 4 <script src="../../../http/tests/inspector/console-test.js"></script> |
5 <script> | 5 <script> |
6 | 6 |
7 function jumpToMe() | 7 function jumpToMe() |
8 { | 8 { |
9 var result = 12345; | 9 var result = 12345; |
10 return window.foo || result; | 10 return window.foo || result; |
11 } | 11 } |
12 | 12 |
13 function test() | 13 function test() |
14 { | 14 { |
15 var panel = WebInspector.panels.sources; | 15 var panel = WebInspector.panels.sources; |
16 | 16 |
17 InspectorTest.runTestSuite([ | 17 InspectorTest.runTestSuite([ |
18 function testRevealFunctionDefinition(next) | 18 function testRevealFunctionDefinition(next) |
19 { | 19 { |
20 InspectorTest.addSniffer(panel, "showUISourceCode", showUISourceCode
Hook); | 20 InspectorTest.addSniffer(panel, "showUISourceCode", showUISourceCode
Hook); |
21 WebInspector.context.flavor(WebInspector.ExecutionContext).evaluate(
"jumpToMe", "", false, true, false, false, didGetFunction); | 21 WebInspector.context.flavor(WebInspector.ExecutionContext).evaluate(
"jumpToMe", "", false, true, false, false, false, didGetFunction); |
22 | 22 |
23 function didGetFunction(funcObject, wasThrown) | 23 function didGetFunction(funcObject, wasThrown) |
24 { | 24 { |
25 var error = !funcObject || wasThrown; | 25 var error = !funcObject || wasThrown; |
26 InspectorTest.assertTrue(!error); | 26 InspectorTest.assertTrue(!error); |
27 panel._showFunctionDefinition(funcObject); | 27 panel._showFunctionDefinition(funcObject); |
28 } | 28 } |
29 | 29 |
30 function showUISourceCodeHook(uiSourceCode, lineNumber, columnNumber
, forceShowInPanel) | 30 function showUISourceCodeHook(uiSourceCode, lineNumber, columnNumber
, forceShowInPanel) |
31 { | 31 { |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 </script> | 64 </script> |
65 </head> | 65 </head> |
66 | 66 |
67 <body onload="runTest()"> | 67 <body onload="runTest()"> |
68 <p> | 68 <p> |
69 Tests that "Show Function Definition" jumps to the correct location. | 69 Tests that "Show Function Definition" jumps to the correct location. |
70 </p> | 70 </p> |
71 | 71 |
72 </body> | 72 </body> |
73 </html> | 73 </html> |
OLD | NEW |