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