| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <script src="../../http/tests/inspector/inspector-test.js"></script> | 2 <script src="../../http/tests/inspector/inspector-test.js"></script> |
| 3 <script src="../../http/tests/inspector/debugger-test.js"></script> | 3 <script src="../../http/tests/inspector/debugger-test.js"></script> |
| 4 | 4 |
| 5 <script type="application/dart" src="evaluate-in-console.dart"></script> | 5 <script type="application/dart" src="evaluate-in-console.dart"></script> |
| 6 | 6 |
| 7 <script> | 7 <script> |
| 8 if (window.navigator.webkitStartDart) | 8 if (window.navigator.webkitStartDart) |
| 9 navigator.webkitStartDart(); | 9 navigator.webkitStartDart(); |
| 10 </script> | 10 </script> |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 InspectorTest.waitUntilPaused(didPauseInDart); | 28 InspectorTest.waitUntilPaused(didPauseInDart); |
| 29 InspectorTest.evaluateInPage('postMessageToDart()'); | 29 InspectorTest.evaluateInPage('postMessageToDart()'); |
| 30 } | 30 } |
| 31 | 31 |
| 32 function didPauseInDart(callFrames) | 32 function didPauseInDart(callFrames) |
| 33 { | 33 { |
| 34 InspectorTest.captureStackTrace(callFrames); | 34 InspectorTest.captureStackTrace(callFrames); |
| 35 | 35 |
| 36 function evaluate(expression) | 36 function evaluate(expression) |
| 37 { | 37 { |
| 38 InspectorTest.evaluateInConsoleAndDump(expression, didEvalua
teInConsole); | 38 InspectorTest.evaluateInConsole(expression, didEvaluateInCon
sole); |
| 39 function didEvaluateInConsole(result) | 39 function didEvaluateInConsole(result) |
| 40 { | 40 { |
| 41 InspectorTest.addResult(expression + " = " + result.repl
ace(/\(dart:[^)]*\)/g, "(SOURCE_LOCATION)")); |
| 41 if (expressions.length) | 42 if (expressions.length) |
| 42 evaluate(expressions.shift()); | 43 evaluate(expressions.shift()); |
| 43 else | 44 else |
| 44 next(); | 45 next(); |
| 45 } | 46 } |
| 46 } | 47 } |
| 47 | 48 |
| 48 var expressions = [ | 49 var expressions = [ |
| 49 // Instance fields and methods. | 50 // Instance fields and methods. |
| 50 'test.instanceField', | 51 'test.instanceField', |
| 51 'test.instanceField = "new value"', | 52 'test.instanceField = "new value"', |
| 52 'test.foo', | 53 'test.foo', |
| 53 'test.foo = 3', | 54 'test.foo = 3', |
| 54 'test.foo', | 55 'test.foo', |
| 55 'test.toString()', | 56 'test.toString()', |
| 56 'test.toString(1)', | 57 'test.toString(1)', |
| 57 'test.create("x").instanceField', | 58 'test.create("x").instanceField', |
| 58 'test.concat(test.create("x"), test.create("y"))', | 59 'test.concat(test.create("x"), test.create("y"))', |
| 59 // Local variables and functions. | 60 // Local variables and functions. |
| 60 '_private', | 61 '_private', |
| 61 // Global fields and functions. | 62 // Global fields and functions. |
| 62 'globalField', | 63 'globalField', |
| 63 'calculateSquareRoot(25)', | 64 'calculateSquareRoot(25)', |
| 64 'document.$dom_createElement("div").tagName', | 65 'new Element.tag("div").outerHtml', |
| 66 'new Element.tag("div").tagName', |
| 65 ]; | 67 ]; |
| 66 evaluate(expressions.shift()); | 68 evaluate(expressions.shift()); |
| 67 } | 69 } |
| 68 }, | 70 }, |
| 69 | 71 |
| 70 function testPrint(next) | 72 function testPrint(next) |
| 71 { | 73 { |
| 72 // This shouldn't crash. | 74 // This shouldn't crash. |
| 73 InspectorTest.evaluateInConsole('print("foo")', function() | 75 InspectorTest.evaluateInConsole('print("foo")', function() |
| 74 { | 76 { |
| 75 InspectorTest.resumeExecution(next); | 77 InspectorTest.resumeExecution(next); |
| 76 }); | 78 }); |
| 77 } | 79 } |
| 78 ]); | 80 ]); |
| 79 }; | 81 }; |
| 80 </script> | 82 </script> |
| 81 | 83 |
| 82 <body onload="runTest()"> | 84 <body onload="runTest()"> |
| 83 </body> | 85 </body> |
| 84 </html> | 86 </html> |
| OLD | NEW |