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