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