2012-08-14 14:51:48 +00:00
|
|
|
/* Any copyright is dedicated to the Public Domain.
|
|
|
|
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
|
|
|
|
|
|
|
// Tests that the addon commands works as they should
|
|
|
|
|
|
|
|
function test() {
|
2014-04-13 06:47:27 +00:00
|
|
|
return Task.spawn(spawnTest).then(finish, helpers.handleError);
|
2012-08-14 14:51:48 +00:00
|
|
|
}
|
|
|
|
|
2015-04-23 09:24:49 +00:00
|
|
|
function* spawnTest() {
|
2014-04-13 06:47:27 +00:00
|
|
|
let options = yield helpers.openTab("about:blank");
|
|
|
|
yield helpers.openToolbar(options);
|
2012-08-24 15:04:45 +00:00
|
|
|
|
2014-04-13 06:47:27 +00:00
|
|
|
yield helpers.audit(options, [
|
|
|
|
{
|
|
|
|
setup: 'addon list dictionary',
|
|
|
|
check: {
|
|
|
|
input: 'addon list dictionary',
|
|
|
|
hints: '',
|
|
|
|
markup: 'VVVVVVVVVVVVVVVVVVVVV',
|
|
|
|
status: 'VALID'
|
2013-03-13 04:51:30 +00:00
|
|
|
},
|
2014-04-13 06:47:27 +00:00
|
|
|
exec: {
|
|
|
|
output: 'There are no add-ons of that type installed.'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
setup: 'addon list extension',
|
|
|
|
check: {
|
|
|
|
input: 'addon list extension',
|
|
|
|
hints: '',
|
|
|
|
markup: 'VVVVVVVVVVVVVVVVVVVV',
|
|
|
|
status: 'VALID'
|
2013-03-13 04:51:30 +00:00
|
|
|
},
|
2014-04-13 06:47:27 +00:00
|
|
|
exec: {
|
|
|
|
output: [/The following/, /Mochitest/, /Special Powers/]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
setup: 'addon list locale',
|
|
|
|
check: {
|
|
|
|
input: 'addon list locale',
|
|
|
|
hints: '',
|
|
|
|
markup: 'VVVVVVVVVVVVVVVVV',
|
|
|
|
status: 'VALID'
|
2013-03-13 04:51:30 +00:00
|
|
|
},
|
2014-04-13 06:47:27 +00:00
|
|
|
exec: {
|
|
|
|
output: 'There are no add-ons of that type installed.'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
setup: 'addon list plugin',
|
|
|
|
check: {
|
|
|
|
input: 'addon list plugin',
|
|
|
|
hints: '',
|
|
|
|
markup: 'VVVVVVVVVVVVVVVVV',
|
|
|
|
status: 'VALID'
|
2013-03-13 04:51:30 +00:00
|
|
|
},
|
2014-04-13 06:47:27 +00:00
|
|
|
exec: {
|
|
|
|
output: [/Test Plug-in/, /Second Test Plug-in/]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
setup: 'addon list theme',
|
|
|
|
check: {
|
|
|
|
input: 'addon list theme',
|
|
|
|
hints: '',
|
|
|
|
markup: 'VVVVVVVVVVVVVVVV',
|
|
|
|
status: 'VALID'
|
2013-03-13 04:51:30 +00:00
|
|
|
},
|
2014-04-13 06:47:27 +00:00
|
|
|
exec: {
|
|
|
|
output: [/following themes/, /Default/]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
setup: 'addon list all',
|
|
|
|
check: {
|
|
|
|
input: 'addon list all',
|
|
|
|
hints: '',
|
|
|
|
markup: 'VVVVVVVVVVVVVV',
|
|
|
|
status: 'VALID'
|
2013-03-13 04:51:30 +00:00
|
|
|
},
|
2014-04-13 06:47:27 +00:00
|
|
|
exec: {
|
|
|
|
output: [/The following/, /Default/, /Mochitest/, /Test Plug-in/,
|
|
|
|
/Second Test Plug-in/, /Special Powers/]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
setup: 'addon disable Test_Plug-in_1.0.0.0',
|
|
|
|
check: {
|
|
|
|
input: 'addon disable Test_Plug-in_1.0.0.0',
|
|
|
|
hints: '',
|
|
|
|
markup: 'VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV',
|
|
|
|
status: 'VALID'
|
2013-03-13 04:51:30 +00:00
|
|
|
},
|
2014-04-13 06:47:27 +00:00
|
|
|
exec: {
|
|
|
|
output: 'Test Plug-in 1.0.0.0 disabled.'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
setup: 'addon disable WRONG',
|
|
|
|
check: {
|
|
|
|
input: 'addon disable WRONG',
|
|
|
|
hints: '',
|
|
|
|
markup: 'VVVVVVVVVVVVVVEEEEE',
|
|
|
|
status: 'ERROR'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
setup: 'addon enable Test_Plug-in_1.0.0.0',
|
|
|
|
check: {
|
|
|
|
input: 'addon enable Test_Plug-in_1.0.0.0',
|
|
|
|
hints: '',
|
|
|
|
markup: 'VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV',
|
|
|
|
status: 'VALID',
|
|
|
|
args: {
|
|
|
|
command: { name: 'addon enable' },
|
|
|
|
addon: {
|
|
|
|
value: function(addon) {
|
|
|
|
is(addon.name, 'Test Plug-in', 'test plugin name');
|
|
|
|
},
|
|
|
|
status: 'VALID'
|
2013-03-13 04:51:30 +00:00
|
|
|
}
|
|
|
|
}
|
2014-04-13 06:47:27 +00:00
|
|
|
},
|
|
|
|
exec: {
|
|
|
|
output: 'Test Plug-in 1.0.0.0 enabled.'
|
2012-08-24 15:04:45 +00:00
|
|
|
}
|
2014-04-13 06:47:27 +00:00
|
|
|
}
|
|
|
|
]);
|
2012-09-04 11:43:58 +00:00
|
|
|
|
2014-04-13 06:47:27 +00:00
|
|
|
yield helpers.closeToolbar(options);
|
|
|
|
yield helpers.closeTab(options);
|
|
|
|
}
|