michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: * http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: // Tests that the addon commands works as they should michael@0: michael@0: function test() { michael@0: return Task.spawn(spawnTest).then(finish, helpers.handleError); michael@0: } michael@0: michael@0: function spawnTest() { michael@0: let options = yield helpers.openTab("about:blank"); michael@0: yield helpers.openToolbar(options); michael@0: michael@0: yield helpers.audit(options, [ michael@0: { michael@0: setup: 'addon list dictionary', michael@0: check: { michael@0: input: 'addon list dictionary', michael@0: hints: '', michael@0: markup: 'VVVVVVVVVVVVVVVVVVVVV', michael@0: status: 'VALID' michael@0: }, michael@0: exec: { michael@0: output: 'There are no add-ons of that type installed.' michael@0: } michael@0: }, michael@0: { michael@0: setup: 'addon list extension', michael@0: check: { michael@0: input: 'addon list extension', michael@0: hints: '', michael@0: markup: 'VVVVVVVVVVVVVVVVVVVV', michael@0: status: 'VALID' michael@0: }, michael@0: exec: { michael@0: output: [/The following/, /Mochitest/, /Special Powers/] michael@0: } michael@0: }, michael@0: { michael@0: setup: 'addon list locale', michael@0: check: { michael@0: input: 'addon list locale', michael@0: hints: '', michael@0: markup: 'VVVVVVVVVVVVVVVVV', michael@0: status: 'VALID' michael@0: }, michael@0: exec: { michael@0: output: 'There are no add-ons of that type installed.' michael@0: } michael@0: }, michael@0: { michael@0: setup: 'addon list plugin', michael@0: check: { michael@0: input: 'addon list plugin', michael@0: hints: '', michael@0: markup: 'VVVVVVVVVVVVVVVVV', michael@0: status: 'VALID' michael@0: }, michael@0: exec: { michael@0: output: [/Test Plug-in/, /Second Test Plug-in/] michael@0: } michael@0: }, michael@0: { michael@0: setup: 'addon list theme', michael@0: check: { michael@0: input: 'addon list theme', michael@0: hints: '', michael@0: markup: 'VVVVVVVVVVVVVVVV', michael@0: status: 'VALID' michael@0: }, michael@0: exec: { michael@0: output: [/following themes/, /Default/] michael@0: } michael@0: }, michael@0: { michael@0: setup: 'addon list all', michael@0: check: { michael@0: input: 'addon list all', michael@0: hints: '', michael@0: markup: 'VVVVVVVVVVVVVV', michael@0: status: 'VALID' michael@0: }, michael@0: exec: { michael@0: output: [/The following/, /Default/, /Mochitest/, /Test Plug-in/, michael@0: /Second Test Plug-in/, /Special Powers/] michael@0: } michael@0: }, michael@0: { michael@0: setup: 'addon disable Test_Plug-in_1.0.0.0', michael@0: check: { michael@0: input: 'addon disable Test_Plug-in_1.0.0.0', michael@0: hints: '', michael@0: markup: 'VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV', michael@0: status: 'VALID' michael@0: }, michael@0: exec: { michael@0: output: 'Test Plug-in 1.0.0.0 disabled.' michael@0: } michael@0: }, michael@0: { michael@0: setup: 'addon disable WRONG', michael@0: check: { michael@0: input: 'addon disable WRONG', michael@0: hints: '', michael@0: markup: 'VVVVVVVVVVVVVVEEEEE', michael@0: status: 'ERROR' michael@0: } michael@0: }, michael@0: { michael@0: setup: 'addon enable Test_Plug-in_1.0.0.0', michael@0: check: { michael@0: input: 'addon enable Test_Plug-in_1.0.0.0', michael@0: hints: '', michael@0: markup: 'VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV', michael@0: status: 'VALID', michael@0: args: { michael@0: command: { name: 'addon enable' }, michael@0: addon: { michael@0: value: function(addon) { michael@0: is(addon.name, 'Test Plug-in', 'test plugin name'); michael@0: }, michael@0: status: 'VALID' michael@0: } michael@0: } michael@0: }, michael@0: exec: { michael@0: output: 'Test Plug-in 1.0.0.0 enabled.' michael@0: } michael@0: } michael@0: ]); michael@0: michael@0: yield helpers.closeToolbar(options); michael@0: yield helpers.closeTab(options); michael@0: }