browser_cmd_addon.js 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. /* Any copyright is dedicated to the Public Domain.
  2. * http://creativecommons.org/publicdomain/zero/1.0/ */
  3. // Tests that the addon commands works as they should
  4. function test() {
  5. return Task.spawn(spawnTest).then(finish, helpers.handleError);
  6. }
  7. function* spawnTest() {
  8. let options = yield helpers.openTab("about:blank");
  9. yield helpers.openToolbar(options);
  10. yield helpers.audit(options, [
  11. {
  12. setup: "addon list dictionary",
  13. check: {
  14. input: "addon list dictionary",
  15. hints: "",
  16. markup: "VVVVVVVVVVVVVVVVVVVVV",
  17. status: "VALID"
  18. },
  19. exec: {
  20. output: "There are no add-ons of that type installed."
  21. }
  22. },
  23. {
  24. setup: "addon list extension",
  25. check: {
  26. input: "addon list extension",
  27. hints: "",
  28. markup: "VVVVVVVVVVVVVVVVVVVV",
  29. status: "VALID"
  30. },
  31. exec: {
  32. output: [/The following/, /Mochitest/, /Special Powers/]
  33. }
  34. },
  35. {
  36. setup: "addon list locale",
  37. check: {
  38. input: "addon list locale",
  39. hints: "",
  40. markup: "VVVVVVVVVVVVVVVVV",
  41. status: "VALID"
  42. },
  43. exec: {
  44. output: "There are no add-ons of that type installed."
  45. }
  46. },
  47. {
  48. setup: "addon list plugin",
  49. check: {
  50. input: "addon list plugin",
  51. hints: "",
  52. markup: "VVVVVVVVVVVVVVVVV",
  53. status: "VALID"
  54. },
  55. exec: {
  56. output: [/Test Plug-in/, /Second Test Plug-in/]
  57. }
  58. },
  59. {
  60. setup: "addon list theme",
  61. check: {
  62. input: "addon list theme",
  63. hints: "",
  64. markup: "VVVVVVVVVVVVVVVV",
  65. status: "VALID"
  66. },
  67. exec: {
  68. output: [/following themes/, /Default/]
  69. }
  70. },
  71. {
  72. setup: "addon list all",
  73. check: {
  74. input: "addon list all",
  75. hints: "",
  76. markup: "VVVVVVVVVVVVVV",
  77. status: "VALID"
  78. },
  79. exec: {
  80. output: [/The following/, /Default/, /Mochitest/, /Test Plug-in/,
  81. /Second Test Plug-in/, /Special Powers/]
  82. }
  83. },
  84. {
  85. setup: "addon disable Test_Plug-in_1.0.0.0",
  86. check: {
  87. input: "addon disable Test_Plug-in_1.0.0.0",
  88. hints: "",
  89. markup: "VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV",
  90. status: "VALID"
  91. },
  92. exec: {
  93. output: "Test Plug-in 1.0.0.0 disabled."
  94. }
  95. },
  96. {
  97. setup: "addon disable WRONG",
  98. check: {
  99. input: "addon disable WRONG",
  100. hints: "",
  101. markup: "VVVVVVVVVVVVVVEEEEE",
  102. status: "ERROR"
  103. }
  104. },
  105. {
  106. setup: "addon enable Test_Plug-in_1.0.0.0",
  107. check: {
  108. input: "addon enable Test_Plug-in_1.0.0.0",
  109. hints: "",
  110. markup: "VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV",
  111. status: "VALID",
  112. args: {
  113. command: { name: "addon enable" },
  114. addon: {
  115. value: function (addon) {
  116. is(addon.name, "Test Plug-in", "test plugin name");
  117. },
  118. status: "VALID"
  119. }
  120. }
  121. },
  122. exec: {
  123. output: "Test Plug-in 1.0.0.0 enabled."
  124. }
  125. },
  126. {
  127. setup: "addon ctp Test_Plug-in_1.0.0.0",
  128. check: {
  129. input: "addon ctp Test_Plug-in_1.0.0.0",
  130. hints: "",
  131. markup: "VVVVVVVVVVVVVVVVVVVVVVVVVVVVVV",
  132. status: "VALID",
  133. args: {
  134. command: { name: "addon ctp" },
  135. addon: {
  136. value: function (addon) {
  137. is(addon.name, "Test Plug-in", "test plugin name");
  138. },
  139. status: "VALID"
  140. }
  141. }
  142. },
  143. exec: {
  144. output: "Test Plug-in 1.0.0.0 set to click-to-play."
  145. }
  146. },
  147. {
  148. setup: "addon ctp OpenH264_Video_Codec_provided_by_Cisco_Systems,_Inc._null",
  149. check: {
  150. input: "addon ctp OpenH264_Video_Codec_provided_by_Cisco_Systems,_Inc._null",
  151. hints: "",
  152. status: "VALID",
  153. args: {
  154. command: { name: "addon ctp" },
  155. addon: {
  156. value: function (addon) {
  157. is(addon.name, "OpenH264 Video Codec provided by Cisco Systems, Inc.", "openh264");
  158. },
  159. status: "VALID"
  160. }
  161. }
  162. },
  163. exec: {
  164. output: "OpenH264 Video Codec provided by Cisco Systems, Inc. null cannot be set to click-to-play."
  165. }
  166. },
  167. {
  168. setup: "addon ctp Mochitest_1.0",
  169. check: {
  170. input: "addon ctp Mochitest_1.0",
  171. hints: "",
  172. status: "VALID",
  173. args: {
  174. command: { name: "addon ctp" },
  175. addon: {
  176. value: function (addon) {
  177. is(addon.name, "Mochitest", "mochitest");
  178. },
  179. status: "VALID"
  180. }
  181. }
  182. },
  183. exec: {
  184. output: "Mochitest 1.0 cannot be set to click-to-play because it is not a plugin."
  185. }
  186. }
  187. ]);
  188. yield helpers.closeToolbar(options);
  189. yield helpers.closeTab(options);
  190. }