| <html> |
| <head> |
| <script src="../../http/tests/inspector/inspector-test.js"></script> |
| <script src="../../http/tests/inspector/console-test.js"></script> |
| <script src="../../http/tests/inspector/elements-test.js"></script> |
| <script> |
| |
| function assertNoBoundCommandLineAPI() |
| { |
| ["__commandLineAPI", "__scopeChainForEval"].forEach(function(name) { |
| console.assert(!(name in window), "FAIL: Should be no " + name); |
| }); |
| } |
| |
| var test = function() |
| { |
| var expressions = [ |
| "String($0)", |
| "$3", |
| "String(keys([3,4]))", |
| "String(values([3,4]))", |
| "String($('#foo'))", |
| "String($('#foo', document.body))", |
| "String($('#foo', 'non-node'))", |
| "String($('#foo', $('#bar')))", |
| "String($$('p'))", |
| "String($$('p', document.body))", |
| "String($('foo'))", |
| "console.assert(keys(window).indexOf('__commandLineAPI') === -1)" |
| ]; |
| |
| InspectorTest.selectNodeWithId("foo", step1); |
| |
| function step1(node) |
| { |
| var expression = expressions.shift(); |
| if (!expression) { |
| step2(); |
| return; |
| } |
| Common.console.log(""); |
| InspectorTest.evaluateInConsole(expression, step1); |
| } |
| |
| function step2() |
| { |
| InspectorTest.evaluateInPage("assertNoBoundCommandLineAPI()", step3); |
| } |
| |
| function step3() |
| { |
| InspectorTest.dumpConsoleMessages(); |
| InspectorTest.completeTest(); |
| } |
| } |
| |
| </script> |
| </head> |
| |
| <body onload="runTest()"> |
| <p id="foo"> |
| Tests that command line api works. |
| </p><p id="bar"></p> |
| |
| </body> |
| </html> |