1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/browser/devtools/commandline/test/browser_cmd_addon.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,134 @@ 1.4 +/* Any copyright is dedicated to the Public Domain. 1.5 + * http://creativecommons.org/publicdomain/zero/1.0/ */ 1.6 + 1.7 +// Tests that the addon commands works as they should 1.8 + 1.9 +function test() { 1.10 + return Task.spawn(spawnTest).then(finish, helpers.handleError); 1.11 +} 1.12 + 1.13 +function spawnTest() { 1.14 + let options = yield helpers.openTab("about:blank"); 1.15 + yield helpers.openToolbar(options); 1.16 + 1.17 + yield helpers.audit(options, [ 1.18 + { 1.19 + setup: 'addon list dictionary', 1.20 + check: { 1.21 + input: 'addon list dictionary', 1.22 + hints: '', 1.23 + markup: 'VVVVVVVVVVVVVVVVVVVVV', 1.24 + status: 'VALID' 1.25 + }, 1.26 + exec: { 1.27 + output: 'There are no add-ons of that type installed.' 1.28 + } 1.29 + }, 1.30 + { 1.31 + setup: 'addon list extension', 1.32 + check: { 1.33 + input: 'addon list extension', 1.34 + hints: '', 1.35 + markup: 'VVVVVVVVVVVVVVVVVVVV', 1.36 + status: 'VALID' 1.37 + }, 1.38 + exec: { 1.39 + output: [/The following/, /Mochitest/, /Special Powers/] 1.40 + } 1.41 + }, 1.42 + { 1.43 + setup: 'addon list locale', 1.44 + check: { 1.45 + input: 'addon list locale', 1.46 + hints: '', 1.47 + markup: 'VVVVVVVVVVVVVVVVV', 1.48 + status: 'VALID' 1.49 + }, 1.50 + exec: { 1.51 + output: 'There are no add-ons of that type installed.' 1.52 + } 1.53 + }, 1.54 + { 1.55 + setup: 'addon list plugin', 1.56 + check: { 1.57 + input: 'addon list plugin', 1.58 + hints: '', 1.59 + markup: 'VVVVVVVVVVVVVVVVV', 1.60 + status: 'VALID' 1.61 + }, 1.62 + exec: { 1.63 + output: [/Test Plug-in/, /Second Test Plug-in/] 1.64 + } 1.65 + }, 1.66 + { 1.67 + setup: 'addon list theme', 1.68 + check: { 1.69 + input: 'addon list theme', 1.70 + hints: '', 1.71 + markup: 'VVVVVVVVVVVVVVVV', 1.72 + status: 'VALID' 1.73 + }, 1.74 + exec: { 1.75 + output: [/following themes/, /Default/] 1.76 + } 1.77 + }, 1.78 + { 1.79 + setup: 'addon list all', 1.80 + check: { 1.81 + input: 'addon list all', 1.82 + hints: '', 1.83 + markup: 'VVVVVVVVVVVVVV', 1.84 + status: 'VALID' 1.85 + }, 1.86 + exec: { 1.87 + output: [/The following/, /Default/, /Mochitest/, /Test Plug-in/, 1.88 + /Second Test Plug-in/, /Special Powers/] 1.89 + } 1.90 + }, 1.91 + { 1.92 + setup: 'addon disable Test_Plug-in_1.0.0.0', 1.93 + check: { 1.94 + input: 'addon disable Test_Plug-in_1.0.0.0', 1.95 + hints: '', 1.96 + markup: 'VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV', 1.97 + status: 'VALID' 1.98 + }, 1.99 + exec: { 1.100 + output: 'Test Plug-in 1.0.0.0 disabled.' 1.101 + } 1.102 + }, 1.103 + { 1.104 + setup: 'addon disable WRONG', 1.105 + check: { 1.106 + input: 'addon disable WRONG', 1.107 + hints: '', 1.108 + markup: 'VVVVVVVVVVVVVVEEEEE', 1.109 + status: 'ERROR' 1.110 + } 1.111 + }, 1.112 + { 1.113 + setup: 'addon enable Test_Plug-in_1.0.0.0', 1.114 + check: { 1.115 + input: 'addon enable Test_Plug-in_1.0.0.0', 1.116 + hints: '', 1.117 + markup: 'VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV', 1.118 + status: 'VALID', 1.119 + args: { 1.120 + command: { name: 'addon enable' }, 1.121 + addon: { 1.122 + value: function(addon) { 1.123 + is(addon.name, 'Test Plug-in', 'test plugin name'); 1.124 + }, 1.125 + status: 'VALID' 1.126 + } 1.127 + } 1.128 + }, 1.129 + exec: { 1.130 + output: 'Test Plug-in 1.0.0.0 enabled.' 1.131 + } 1.132 + } 1.133 + ]); 1.134 + 1.135 + yield helpers.closeToolbar(options); 1.136 + yield helpers.closeTab(options); 1.137 +}