Bug 1330598 - Skip Marionette's addon unit tests for Fennec." draft
authorHenrik Skupin <mail@hskupin.info>
Thu, 12 Jan 2017 13:11:15 +0100
changeset 460688 bcd130587482626f1308dde7a08c196846afcf42
parent 460673 de67fccc4c64a49f261aea29141357b94c7b3b9c
child 542119 448df8e5c7cfcbba71ebd75e0a3975f789cdaba8
push id41468
push userbmo:hskupin@gmail.com
push dateFri, 13 Jan 2017 17:06:36 +0000
bugs1330598
milestone53.0a1
Bug 1330598 - Skip Marionette's addon unit tests for Fennec." The tests have to be skipped because Marionette server only allows the installation of add-ons for Firefox. Once Fennec gets white-listed, it would be still necessary to copy the to install XPI to the device file system. MozReview-Commit-ID: Jr53iCzkZvo
testing/marionette/harness/marionette_harness/tests/unit/test_addons.py
testing/marionette/harness/marionette_harness/tests/unit/unit-tests.ini
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_addons.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_addons.py
@@ -1,29 +1,27 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 import os
-import unittest
 
 from marionette_driver.addons import Addons, AddonInstallException
-
-from marionette_harness import MarionetteTestCase
+from marionette_harness import MarionetteTestCase, skip
 
 
 here = os.path.abspath(os.path.dirname(__file__))
 
 
 class TestAddons(MarionetteTestCase):
+
     def setUp(self):
         MarionetteTestCase.setUp(self)
         self.addons = Addons(self.marionette)
 
-
     @property
     def all_addon_ids(self):
         with self.marionette.using_context('chrome'):
             addons = self.marionette.execute_async_script("""
               Components.utils.import("resource://gre/modules/AddonManager.jsm");
               AddonManager.getAllAddons(function(addons){
                 let ids = addons.map(function(x) {
                   return x.id;
@@ -44,17 +42,17 @@ class TestAddons(MarionetteTestCase):
         self.assertNotIn(addon_id, self.all_addon_ids)
 
     def test_install_unsigned_addon(self):
         addon_path = os.path.join(here, 'mn-restartless-unsigned.xpi')
 
         with self.assertRaises(AddonInstallException):
             self.addons.install(addon_path)
 
-    @unittest.skip("need to get the test extension signed")
+    @skip("Need to get the test extension signed")
     def test_install_and_remove_signed_addon(self):
         addon_path = os.path.join(here, 'mn-restartless-signed.xpi')
 
         addon_id = self.addons.install(addon_path)
         self.assertIn(addon_id, self.all_addon_ids)
 
         self.addons.uninstall(addon_id)
         self.assertNotIn(addon_id, self.all_addon_ids)
--- a/testing/marionette/harness/marionette_harness/tests/unit/unit-tests.ini
+++ b/testing/marionette/harness/marionette_harness/tests/unit/unit-tests.ini
@@ -119,13 +119,14 @@ skip-if = appname == 'fennec' || os == "
 [test_prefs.py]
 
 [test_shadow_dom.py]
 
 [test_chrome.py]
 skip-if = appname == 'fennec'
 
 [test_addons.py]
+skip-if = appname == 'fennec' # Bug 1330598
 
 [test_select.py]
 [test_crash.py]
 skip-if = manage_instance == false || appname == 'fennec' # Bug 1298921 and bug 1322993
 [test_localization.py]