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 src="../../http/tests/inspector/elements-test.js"></script> | 5 <script src="../../http/tests/inspector/elements-test.js"></script> |
6 <script> | 6 <script> |
7 | 7 |
8 function assertNoBoundCommandLineAPI() | 8 function assertNoBoundCommandLineAPI() |
9 { | 9 { |
10 ["__commandLineAPI", "__scopeChainForEval"].forEach(function(name) { | 10 ["__commandLineAPI", "__scopeChainForEval"].forEach(function(name) { |
11 console.assert(!(name in window), "FAIL: Should be no " + name); | 11 console.assert(!(name in window), "FAIL: Should be no " + name); |
12 }); | 12 }); |
13 } | 13 } |
14 | 14 |
15 var test = function() | 15 var test = function() |
16 { | 16 { |
17 var expressions = [ | 17 var expressions = [ |
18 "String($0)", | 18 "String($0)", |
19 "$3", | 19 "$3", |
20 "String(keys([3,4]))", | 20 "String(keys([3,4]))", |
21 "String(values([3,4]))", | 21 "String(values([3,4]))", |
22 "String($('#foo'))", | 22 "String($('#foo'))", |
23 "String($('#foo', document.body))", | 23 "String($('#foo', document.body))", |
24 "String($('#foo', 'non-node'))", | 24 "String($('#foo', 'non-node'))", |
25 "String($('#foo', $('#bar')))", | 25 "String($('#foo', $('#bar')))", |
26 "String($$('p#foo'))", | 26 "String($$('p'))", |
27 "String($$('p#foo', document.body))", | 27 "String($$('p', document.body))", |
28 "String($('foo'))", | 28 "String($('foo'))", |
29 "console.assert(keys(window).indexOf('__commandLineAPI') === -1)" | 29 "console.assert(keys(window).indexOf('__commandLineAPI') === -1)" |
30 ]; | 30 ]; |
31 | 31 |
32 InspectorTest.selectNodeWithId("foo", step1); | 32 InspectorTest.selectNodeWithId("foo", step1); |
33 | 33 |
34 function step1(node) | 34 function step1(node) |
35 { | 35 { |
36 var expression = expressions.shift(); | 36 var expression = expressions.shift(); |
37 if (!expression) { | 37 if (!expression) { |
(...skipping 19 matching lines...) Expand all Loading... |
57 </script> | 57 </script> |
58 </head> | 58 </head> |
59 | 59 |
60 <body onload="runTest()"> | 60 <body onload="runTest()"> |
61 <p id="foo"> | 61 <p id="foo"> |
62 Tests that command line api works. | 62 Tests that command line api works. |
63 </p><p id="bar"></p> | 63 </p><p id="bar"></p> |
64 | 64 |
65 </body> | 65 </body> |
66 </html> | 66 </html> |
OLD | NEW |