michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: * http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: // Tests that the inspect command works as it should michael@0: michael@0: const TEST_URI = "http://example.com/browser/browser/devtools/inspector/" + michael@0: "test/browser_inspector_cmd_inspect.html"; michael@0: michael@0: function test() { michael@0: helpers.addTabWithToolbar(TEST_URI, function(options) { michael@0: return helpers.audit(options, [ michael@0: { michael@0: setup: "inspect", michael@0: check: { michael@0: input: 'inspect', michael@0: hints: ' ', michael@0: markup: 'VVVVVVV', michael@0: status: 'ERROR', michael@0: args: { michael@0: selector: { michael@0: message: 'Value required for \'selector\'.' michael@0: }, michael@0: } michael@0: }, michael@0: }, michael@0: { michael@0: setup: "inspect h1", michael@0: check: { michael@0: input: 'inspect h1', michael@0: hints: '', michael@0: markup: 'VVVVVVVVII', michael@0: status: 'ERROR', michael@0: args: { michael@0: selector: { message: 'No matches' }, michael@0: } michael@0: }, michael@0: }, michael@0: { michael@0: setup: "inspect span", michael@0: check: { michael@0: input: 'inspect span', michael@0: hints: '', michael@0: markup: 'VVVVVVVVEEEE', michael@0: status: 'ERROR', michael@0: args: { michael@0: selector: { message: 'Too many matches (2)' }, michael@0: } michael@0: }, michael@0: }, michael@0: { michael@0: setup: "inspect div", michael@0: check: { michael@0: input: 'inspect div', michael@0: hints: '', michael@0: markup: 'VVVVVVVVVVV', michael@0: status: 'VALID', michael@0: args: { michael@0: selector: { message: '' }, michael@0: } michael@0: }, michael@0: }, michael@0: { michael@0: setup: "inspect .someclas", michael@0: check: { michael@0: input: 'inspect .someclas', michael@0: hints: '', michael@0: markup: 'VVVVVVVVIIIIIIIII', michael@0: status: 'ERROR', michael@0: args: { michael@0: selector: { message: 'No matches' }, michael@0: } michael@0: }, michael@0: }, michael@0: { michael@0: setup: "inspect .someclass", michael@0: check: { michael@0: input: 'inspect .someclass', michael@0: hints: '', michael@0: markup: 'VVVVVVVVVVVVVVVVVV', michael@0: status: 'VALID', michael@0: args: { michael@0: selector: { message: '' }, michael@0: } michael@0: }, michael@0: }, michael@0: { michael@0: setup: "inspect #someid", michael@0: check: { michael@0: input: 'inspect #someid', michael@0: hints: '', michael@0: markup: 'VVVVVVVVVVVVVVV', michael@0: status: 'VALID', michael@0: args: { michael@0: selector: { message: '' }, michael@0: } michael@0: }, michael@0: }, michael@0: { michael@0: setup: "inspect button[disabled]", michael@0: check: { michael@0: input: 'inspect button[disabled]', michael@0: hints: '', michael@0: markup: 'VVVVVVVVVVVVVVVVVVVVVVVV', michael@0: status: 'VALID', michael@0: args: { michael@0: selector: { message: '' }, michael@0: } michael@0: }, michael@0: }, michael@0: { michael@0: setup: "inspect p>strong", michael@0: check: { michael@0: input: 'inspect p>strong', michael@0: hints: '', michael@0: markup: 'VVVVVVVVVVVVVVVV', michael@0: status: 'VALID', michael@0: args: { michael@0: selector: { message: '' }, michael@0: } michael@0: }, michael@0: }, michael@0: { michael@0: setup: "inspect :root", michael@0: check: { michael@0: input: 'inspect :root', michael@0: hints: '', michael@0: markup: 'VVVVVVVVVVVVV', michael@0: status: 'VALID' michael@0: }, michael@0: }, michael@0: ]); michael@0: }).then(finish); michael@0: }