|
1 /* Any copyright is dedicated to the Public Domain. |
|
2 * http://creativecommons.org/publicdomain/zero/1.0/ */ |
|
3 |
|
4 // Tests that the addon commands works as they should |
|
5 |
|
6 function test() { |
|
7 return Task.spawn(spawnTest).then(finish, helpers.handleError); |
|
8 } |
|
9 |
|
10 function spawnTest() { |
|
11 let options = yield helpers.openTab("about:blank"); |
|
12 yield helpers.openToolbar(options); |
|
13 |
|
14 yield helpers.audit(options, [ |
|
15 { |
|
16 setup: 'addon list dictionary', |
|
17 check: { |
|
18 input: 'addon list dictionary', |
|
19 hints: '', |
|
20 markup: 'VVVVVVVVVVVVVVVVVVVVV', |
|
21 status: 'VALID' |
|
22 }, |
|
23 exec: { |
|
24 output: 'There are no add-ons of that type installed.' |
|
25 } |
|
26 }, |
|
27 { |
|
28 setup: 'addon list extension', |
|
29 check: { |
|
30 input: 'addon list extension', |
|
31 hints: '', |
|
32 markup: 'VVVVVVVVVVVVVVVVVVVV', |
|
33 status: 'VALID' |
|
34 }, |
|
35 exec: { |
|
36 output: [/The following/, /Mochitest/, /Special Powers/] |
|
37 } |
|
38 }, |
|
39 { |
|
40 setup: 'addon list locale', |
|
41 check: { |
|
42 input: 'addon list locale', |
|
43 hints: '', |
|
44 markup: 'VVVVVVVVVVVVVVVVV', |
|
45 status: 'VALID' |
|
46 }, |
|
47 exec: { |
|
48 output: 'There are no add-ons of that type installed.' |
|
49 } |
|
50 }, |
|
51 { |
|
52 setup: 'addon list plugin', |
|
53 check: { |
|
54 input: 'addon list plugin', |
|
55 hints: '', |
|
56 markup: 'VVVVVVVVVVVVVVVVV', |
|
57 status: 'VALID' |
|
58 }, |
|
59 exec: { |
|
60 output: [/Test Plug-in/, /Second Test Plug-in/] |
|
61 } |
|
62 }, |
|
63 { |
|
64 setup: 'addon list theme', |
|
65 check: { |
|
66 input: 'addon list theme', |
|
67 hints: '', |
|
68 markup: 'VVVVVVVVVVVVVVVV', |
|
69 status: 'VALID' |
|
70 }, |
|
71 exec: { |
|
72 output: [/following themes/, /Default/] |
|
73 } |
|
74 }, |
|
75 { |
|
76 setup: 'addon list all', |
|
77 check: { |
|
78 input: 'addon list all', |
|
79 hints: '', |
|
80 markup: 'VVVVVVVVVVVVVV', |
|
81 status: 'VALID' |
|
82 }, |
|
83 exec: { |
|
84 output: [/The following/, /Default/, /Mochitest/, /Test Plug-in/, |
|
85 /Second Test Plug-in/, /Special Powers/] |
|
86 } |
|
87 }, |
|
88 { |
|
89 setup: 'addon disable Test_Plug-in_1.0.0.0', |
|
90 check: { |
|
91 input: 'addon disable Test_Plug-in_1.0.0.0', |
|
92 hints: '', |
|
93 markup: 'VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV', |
|
94 status: 'VALID' |
|
95 }, |
|
96 exec: { |
|
97 output: 'Test Plug-in 1.0.0.0 disabled.' |
|
98 } |
|
99 }, |
|
100 { |
|
101 setup: 'addon disable WRONG', |
|
102 check: { |
|
103 input: 'addon disable WRONG', |
|
104 hints: '', |
|
105 markup: 'VVVVVVVVVVVVVVEEEEE', |
|
106 status: 'ERROR' |
|
107 } |
|
108 }, |
|
109 { |
|
110 setup: 'addon enable Test_Plug-in_1.0.0.0', |
|
111 check: { |
|
112 input: 'addon enable Test_Plug-in_1.0.0.0', |
|
113 hints: '', |
|
114 markup: 'VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV', |
|
115 status: 'VALID', |
|
116 args: { |
|
117 command: { name: 'addon enable' }, |
|
118 addon: { |
|
119 value: function(addon) { |
|
120 is(addon.name, 'Test Plug-in', 'test plugin name'); |
|
121 }, |
|
122 status: 'VALID' |
|
123 } |
|
124 } |
|
125 }, |
|
126 exec: { |
|
127 output: 'Test Plug-in 1.0.0.0 enabled.' |
|
128 } |
|
129 } |
|
130 ]); |
|
131 |
|
132 yield helpers.closeToolbar(options); |
|
133 yield helpers.closeTab(options); |
|
134 } |