Chromium Code Reviews| 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 68 'test.toString()', | 68 'test.toString()', |
| 69 'test.toString(1)', | 69 'test.toString(1)', |
| 70 'test.create("x").instanceField', | 70 'test.create("x").instanceField', |
| 71 'test.concat(test.create("x"), test.create("y"))', | 71 'test.concat(test.create("x"), test.create("y"))', |
| 72 // Local variables and functions. | 72 // Local variables and functions. |
| 73 '_private', | 73 '_private', |
| 74 // Global fields and functions. | 74 // Global fields and functions. |
| 75 'globalField', | 75 'globalField', |
| 76 'calculateSquareRoot(25)', | 76 'calculateSquareRoot(25)', |
| 77 'new Element.tag("div").outerHtml', | 77 'new Element.tag("div").outerHtml', |
| 78 '(new Element.tag("div")..append(new Element.tag("h1"))).out erHtml', | |
| 78 'new Element.tag("div").tagName', | 79 'new Element.tag("div").tagName', |
| 79 'intList.toString()', | 80 'intList.toString()', |
| 80 'intList.__proto__.someMethodThatDoesNotExist()', | 81 '(LinkedList).toString()', |
|
Jacob
2013/09/11 23:45:46
Tweaked the test cases to make more sense given a
| |
| 81 'intList.__proto__.toString()', | 82 '$var.a=new List<int>()..add(4)..add(42)', |
| 82 // Verify that making a Dart object the prototype of a JS | 83 '$var.a.toString()', |
| 83 // object behaves correctly. Dart methods always act as if | 84 '$var.object={"foo": "bar", "baz": 42}', |
| 84 // they are bound to the Dart object they are associated | 85 '$var.object.toString()', |
| 85 // with unlike JS methods. | 86 '$var.keys()', |
|
Jacob
2013/09/11 23:45:46
$var is a hack to let you store temp variables in
vsm
2013/09/12 00:17:23
$var looks pretty magical.
Jacob
2013/09/17 21:44:43
Agreed. After this lands I'm going to send out a f
| |
| 86 'a=new List()', | 87 '$var.f = (x) => x*42', |
| 87 'jsObject={}', | 88 '$var.f(2)', |
| 88 'jsObject.__proto__=a', | 89 '[] is List', |
| 89 'jsObject.add(7)', | 90 '{} is List', |
| 90 'a.toString()' | 91 '"This should be an int: ${10000000000000000000000 - 1}"', |
| 92 '10000000000000000000000 is int', | |
| 93 '1.0 is int', | |
| 94 '1.0 is double', | |
| 95 '((x) => x * 2)(21)', | |
| 96 '((x) { var z = x * 4; return z; })(21)', | |
| 97 'print("Hello $window")', | |
| 91 ]; | 98 ]; |
| 92 evaluate(expressions.shift()); | 99 evaluate(expressions.shift()); |
| 93 } | 100 } |
| 94 }, | 101 }, |
| 95 | 102 |
| 96 function testPrint(next) | 103 function testPrint(next) |
| 97 { | 104 { |
| 98 // This shouldn't crash. | 105 // This shouldn't crash. |
| 99 InspectorTest.evaluateInConsole('print("foo")', function() | 106 InspectorTest.evaluateInConsole('print("foo")', function() |
| 100 { | 107 { |
| 101 InspectorTest.resumeExecution(next); | 108 InspectorTest.resumeExecution(next); |
| 102 }); | 109 }); |
| 103 } | 110 } |
| 104 ]); | 111 ]); |
| 105 }; | 112 }; |
| 106 </script> | 113 </script> |
| 107 | 114 |
| 108 <body onload="runTest()"> | 115 <body onload="runTest()"> |
| 109 </body> | 116 </body> |
| 110 </html> | 117 </html> |
| OLD | NEW |