| 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 <script src="../../http/tests/inspector/console-test.js"></script> |
| 4 | 5 |
| 5 <script type="application/dart" src="evaluate-in-console.dart"></script> | 6 <script type="application/dart" src="evaluate-in-console.dart"></script> |
| 6 | 7 |
| 7 <script> | 8 <script> |
| 8 function postMessageToDart() | 9 function postMessageToDart() |
| 9 { | 10 { |
| 10 window.postMessage('fromJS', '*'); | 11 window.postMessage('fromJS', '*'); |
| 11 } | 12 } |
| 12 | 13 |
| 13 function testFunction() { | 14 function testFunction() { |
| 14 postMessageToDart(); | 15 postMessageToDart(); |
| 15 } | 16 } |
| 16 | 17 |
| 17 function test() | 18 function test() |
| 18 { | 19 { |
| 20 realAddResult = InspectorTest.addResult; |
| 21 InspectorTest.addResult = function(text) { |
| 22 text = text.replace(/(file:\/\/\/\w):/g, "$1"); |
| 23 text = text.replace(/file:\/\/\/?[^: )]*([.]dart|[$]script|[$]trampoline
)/g, "(SOURCE_LOCATION)"); |
| 24 text = text.replace(/\(file:\/\/\/?[^)]*\)/g, "(SOURCE_LOCATION)"); |
| 25 text = text.replace(/@\d+/g, "(VM_PRIVATE_MANGLING)"); |
| 26 text = text.replace(/\$main\-[0-9]*/g, "(DEFAULT_ISOLATE_NAME_SUFFIX)"); |
| 27 text = text.replace(/:\d\d\d+/g, ":xxxx"); |
| 28 return realAddResult.call(this, text); |
| 29 }; |
| 30 |
| 19 var panel = WebInspector.inspectorView.showPanel("sources"); | 31 var panel = WebInspector.inspectorView.showPanel("sources"); |
| 20 InspectorTest.runDebuggerTestSuite([ | 32 InspectorTest.runDebuggerTestSuite([ |
| 21 function testScopeChain(next) | 33 function testScopeChain(next) |
| 22 { | 34 { |
| 23 InspectorTest.showScriptSource('evaluate-in-console.dart', didShowSc
riptSource); | 35 InspectorTest.showScriptSource('evaluate-in-console.dart', didShowSc
riptSource); |
| 24 | 36 |
| 25 function didShowScriptSource(sourceFrame) | 37 function didShowScriptSource(sourceFrame) |
| 26 { | 38 { |
| 27 setBreakpointAndWaitUntilPaused(sourceFrame, 12, didPauseInDart)
; | 39 setBreakpointAndWaitUntilPaused(sourceFrame, 12, didPauseInDart)
; |
| 28 InspectorTest.runTestFunction(); | 40 InspectorTest.runTestFunction(); |
| 29 } | 41 } |
| 30 | 42 |
| 31 function didPauseInDart(callFrames) | 43 function didPauseInDart(callFrames) |
| 32 { | 44 { |
| 33 InspectorTest.captureStackTrace(callFrames); | 45 InspectorTest.captureStackTrace(callFrames); |
| 34 | 46 |
| 35 function evaluate(expression) | 47 function evaluate(expression) |
| 36 { | 48 { |
| 37 InspectorTest.evaluateInConsole(expression, didEvaluateInCon
sole); | 49 InspectorTest.evaluateInConsole(expression, didEvaluateInCon
sole); |
| 38 function didEvaluateInConsole(result) | 50 function didEvaluateInConsole(result) |
| 39 { | 51 { |
| 40 // For file urls we leave the file name and line # | 52 // For file urls we leave the file name and line # |
| 41 // information in the url as these file urls are from | 53 // information in the url as these file urls are from |
| 42 // the test files themselves so will not be broken by | 54 // the test files themselves so will not be broken by |
| 43 // external changes. | 55 // external changes. |
| 44 result = result.replace(/\(file:[^.)]*(\/[^\/]*[.]dart[0
-9:]*)\)/g, | 56 result = result.replace(/\(file:[^.)]*(\/[^\/]*[.]dart[0
-9:]*)\)/g, |
| 45 "(FILE_SOURCE_LOCATION$1)"); | 57 "(FILE_SOURCE_LOCATION$1)"); |
| 58 result = result.replace(/VM\d+:\d+/g, |
| 59 "(VM:LOCATION)"); |
| 60 |
| 46 // For dart: urls we remove all file name and line # | 61 // For dart: urls we remove all file name and line # |
| 47 // information as the tests shouldn't break when | 62 // information as the tests shouldn't break when |
| 48 // dart:core changes. | 63 // dart:core changes. |
| 49 result = result.replace(/\(dart:[^)]*\)/g, | 64 result = result.replace(/\(dart:[^)]*\)/g, |
| 50 "(DART_CORE_LIBRARY_SOURCE_LOCAT
ION)"); | 65 "(DART_CORE_LIBRARY_SOURCE_LOCAT
ION)"); |
| 51 InspectorTest.addResult(expression + " = " + result); | 66 InspectorTest.addResult(expression + " = " + result); |
| 52 if (expressions.length) | 67 if (expressions.length) |
| 53 evaluate(expressions.shift()); | 68 evaluate(expressions.shift()); |
| 54 else | 69 else |
| 55 next(); | 70 next(); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 | 142 |
| 128 pausedCallback(callFrames); | 143 pausedCallback(callFrames); |
| 129 } | 144 } |
| 130 } | 145 } |
| 131 }; | 146 }; |
| 132 </script> | 147 </script> |
| 133 | 148 |
| 134 <body onload="runTest()"> | 149 <body onload="runTest()"> |
| 135 </body> | 150 </body> |
| 136 </html> | 151 </html> |
| OLD | NEW |