browser/devtools/inspector/test/browser_inspector_cmd_inspect.js

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

michael@0 1 /* Any copyright is dedicated to the Public Domain.
michael@0 2 * http://creativecommons.org/publicdomain/zero/1.0/ */
michael@0 3
michael@0 4 // Tests that the inspect command works as it should
michael@0 5
michael@0 6 const TEST_URI = "http://example.com/browser/browser/devtools/inspector/" +
michael@0 7 "test/browser_inspector_cmd_inspect.html";
michael@0 8
michael@0 9 function test() {
michael@0 10 helpers.addTabWithToolbar(TEST_URI, function(options) {
michael@0 11 return helpers.audit(options, [
michael@0 12 {
michael@0 13 setup: "inspect",
michael@0 14 check: {
michael@0 15 input: 'inspect',
michael@0 16 hints: ' <selector>',
michael@0 17 markup: 'VVVVVVV',
michael@0 18 status: 'ERROR',
michael@0 19 args: {
michael@0 20 selector: {
michael@0 21 message: 'Value required for \'selector\'.'
michael@0 22 },
michael@0 23 }
michael@0 24 },
michael@0 25 },
michael@0 26 {
michael@0 27 setup: "inspect h1",
michael@0 28 check: {
michael@0 29 input: 'inspect h1',
michael@0 30 hints: '',
michael@0 31 markup: 'VVVVVVVVII',
michael@0 32 status: 'ERROR',
michael@0 33 args: {
michael@0 34 selector: { message: 'No matches' },
michael@0 35 }
michael@0 36 },
michael@0 37 },
michael@0 38 {
michael@0 39 setup: "inspect span",
michael@0 40 check: {
michael@0 41 input: 'inspect span',
michael@0 42 hints: '',
michael@0 43 markup: 'VVVVVVVVEEEE',
michael@0 44 status: 'ERROR',
michael@0 45 args: {
michael@0 46 selector: { message: 'Too many matches (2)' },
michael@0 47 }
michael@0 48 },
michael@0 49 },
michael@0 50 {
michael@0 51 setup: "inspect div",
michael@0 52 check: {
michael@0 53 input: 'inspect div',
michael@0 54 hints: '',
michael@0 55 markup: 'VVVVVVVVVVV',
michael@0 56 status: 'VALID',
michael@0 57 args: {
michael@0 58 selector: { message: '' },
michael@0 59 }
michael@0 60 },
michael@0 61 },
michael@0 62 {
michael@0 63 setup: "inspect .someclas",
michael@0 64 check: {
michael@0 65 input: 'inspect .someclas',
michael@0 66 hints: '',
michael@0 67 markup: 'VVVVVVVVIIIIIIIII',
michael@0 68 status: 'ERROR',
michael@0 69 args: {
michael@0 70 selector: { message: 'No matches' },
michael@0 71 }
michael@0 72 },
michael@0 73 },
michael@0 74 {
michael@0 75 setup: "inspect .someclass",
michael@0 76 check: {
michael@0 77 input: 'inspect .someclass',
michael@0 78 hints: '',
michael@0 79 markup: 'VVVVVVVVVVVVVVVVVV',
michael@0 80 status: 'VALID',
michael@0 81 args: {
michael@0 82 selector: { message: '' },
michael@0 83 }
michael@0 84 },
michael@0 85 },
michael@0 86 {
michael@0 87 setup: "inspect #someid",
michael@0 88 check: {
michael@0 89 input: 'inspect #someid',
michael@0 90 hints: '',
michael@0 91 markup: 'VVVVVVVVVVVVVVV',
michael@0 92 status: 'VALID',
michael@0 93 args: {
michael@0 94 selector: { message: '' },
michael@0 95 }
michael@0 96 },
michael@0 97 },
michael@0 98 {
michael@0 99 setup: "inspect button[disabled]",
michael@0 100 check: {
michael@0 101 input: 'inspect button[disabled]',
michael@0 102 hints: '',
michael@0 103 markup: 'VVVVVVVVVVVVVVVVVVVVVVVV',
michael@0 104 status: 'VALID',
michael@0 105 args: {
michael@0 106 selector: { message: '' },
michael@0 107 }
michael@0 108 },
michael@0 109 },
michael@0 110 {
michael@0 111 setup: "inspect p>strong",
michael@0 112 check: {
michael@0 113 input: 'inspect p>strong',
michael@0 114 hints: '',
michael@0 115 markup: 'VVVVVVVVVVVVVVVV',
michael@0 116 status: 'VALID',
michael@0 117 args: {
michael@0 118 selector: { message: '' },
michael@0 119 }
michael@0 120 },
michael@0 121 },
michael@0 122 {
michael@0 123 setup: "inspect :root",
michael@0 124 check: {
michael@0 125 input: 'inspect :root',
michael@0 126 hints: '',
michael@0 127 markup: 'VVVVVVVVVVVVV',
michael@0 128 status: 'VALID'
michael@0 129 },
michael@0 130 },
michael@0 131 ]);
michael@0 132 }).then(finish);
michael@0 133 }

mercurial