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 slave(x) | 7 function slave(x) |
8 { | 8 { |
9 var y = 20; | 9 var y = 20; |
10 debugger; | 10 debugger; |
11 } | 11 } |
12 | 12 |
13 function testFunction() | 13 function testFunction() |
14 { | 14 { |
15 var localObject = { a: 310 }; | 15 var localObject = { a: 310 }; |
16 slave(4000); | 16 slave(4000); |
17 } | 17 } |
18 | 18 |
19 var test = function() | 19 var test = function() |
20 { | 20 { |
21 InspectorTest.startDebuggerTest(step1); | 21 InspectorTest.startDebuggerTest(step1); |
22 | 22 |
| 23 var localScope; |
| 24 |
| 25 function doSetPropertyValue(name, value, evalInConsole, next) |
| 26 { |
| 27 localScope.setPropertyValue(name, value, callback); |
| 28 function callback(error) |
| 29 { |
| 30 if (error) |
| 31 InspectorTest.addResult("Set property value error: " + error); |
| 32 InspectorTest.evaluateInConsole(evalInConsole, next); |
| 33 } |
| 34 } |
| 35 |
23 function step1() | 36 function step1() |
24 { | 37 { |
25 InspectorTest.runTestFunctionAndWaitUntilPaused(step2); | 38 InspectorTest.runTestFunctionAndWaitUntilPaused(step2); |
26 } | 39 } |
27 | 40 |
28 function step2(callFrames) | 41 function step2(callFrames) |
29 { | 42 { |
30 var pane = WebInspector.panels.sources.sidebarPanes.callstack; | 43 var pane = WebInspector.panels.sources.sidebarPanes.callstack; |
31 pane._placardSelected(pane.placards[1]); | 44 pane._placardSelected(pane.placards[1]); |
32 InspectorTest.runAfterPendingDispatches(step3); | 45 InspectorTest.runAfterPendingDispatches(step3); |
33 } | 46 } |
34 | 47 |
35 function step3() | 48 function step3() |
36 { | 49 { |
37 InspectorTest.evaluateInConsole("localObject.a", step4); | 50 InspectorTest.evaluateInConsole("localObject.a", step4); |
38 } | 51 } |
39 | 52 |
40 function step4(result) | 53 function step4(result) |
41 { | 54 { |
42 InspectorTest.addResult("Evaluated script on the calling frame: " + resu
lt); | 55 InspectorTest.addResult("Evaluated script on the calling frame: " + resu
lt); |
43 | 56 |
44 var pane = WebInspector.panels.sources.sidebarPanes.scopechain; | 57 var pane = WebInspector.panels.sources.sidebarPanes.scopechain; |
45 var localsSection = pane._sections[0]; | 58 localScope = pane._sections[0].object; |
46 localsSection.object.setPropertyValue("localObject", "({ a: -290})", ste
p5); | 59 doSetPropertyValue("localObject", "({ a: -290})", "localObject.a", step5
); |
47 } | 60 } |
48 | 61 |
49 function step5(error) | 62 function step5(result) |
50 { | 63 { |
51 if (error) | 64 InspectorTest.addResult("Evaluated script on the calling frame (after va
lue modification): " + result); |
52 InspectorTest.addResult("Set property value error: " + error); | 65 doSetPropertyValue("localObject", "NaN", "localObject", step6); |
53 | |
54 InspectorTest.evaluateInConsole("localObject.a", step6); | |
55 } | 66 } |
56 | 67 |
57 function step6(result) | 68 function step6(result) |
58 { | 69 { |
59 InspectorTest.addResult("Evaluated script on the calling frame (after va
lue modification): " + result); | 70 InspectorTest.addResult("Expecting NaN: " + result); |
| 71 doSetPropertyValue("localObject", "1/-Infinity", "1/localObject", step7)
; |
| 72 } |
| 73 |
| 74 function step7(result) |
| 75 { |
| 76 InspectorTest.addResult("Negative zero test. 1/-0 = " + result); |
60 InspectorTest.completeDebuggerTest(); | 77 InspectorTest.completeDebuggerTest(); |
61 } | 78 } |
62 } | 79 } |
63 | 80 |
64 </script> | 81 </script> |
65 </head> | 82 </head> |
66 | 83 |
67 <body onload="runTest()"> | 84 <body onload="runTest()"> |
68 <p> | 85 <p> |
69 Tests that modifying local variables works fine. | 86 Tests that modifying local variables works fine. |
70 </p> | 87 </p> |
71 | 88 |
72 </body> | 89 </body> |
73 </html> | 90 </html> |
OLD | NEW |