Bug 1316707 - Remove Marionette unit tests for B2G. draft
authorHenrik Skupin <mail@hskupin.info>
Thu, 10 Nov 2016 21:41:11 +0100
changeset 440462 33eba6794b92ff0962c429668ca65b549d7bb887
parent 440252 13f49da109ea460665ad27c8497cb1489548450c
child 440463 debc146e6caaf2161800abc2ed78dc15663260ac
push id36223
push userbmo:hskupin@gmail.com
push dateThu, 17 Nov 2016 15:08:12 +0000
bugs1316707
milestone53.0a1
Bug 1316707 - Remove Marionette unit tests for B2G. MozReview-Commit-ID: B1pQqL17Ug9
testing/marionette/harness/marionette/tests/unit/test_capabilities.py
testing/marionette/harness/marionette/tests/unit/test_element_touch.py
testing/marionette/harness/marionette/tests/unit/test_gesture.py
testing/marionette/harness/marionette/tests/unit/test_multi_finger.py
testing/marionette/harness/marionette/tests/unit/test_single_finger.py
testing/marionette/harness/marionette/tests/unit/unit-tests.ini
--- a/testing/marionette/harness/marionette/tests/unit/test_capabilities.py
+++ b/testing/marionette/harness/marionette/tests/unit/test_capabilities.py
@@ -14,20 +14,16 @@ class TestCapabilities(MarionetteTestCas
         with self.marionette.using_context("chrome"):
             self.appinfo = self.marionette.execute_script(
                 "return Services.appinfo")
             self.os_name = self.marionette.execute_script(
                 "return Services.sysinfo.getProperty('name')").lower()
             self.os_version = self.marionette.execute_script(
                 "return Services.sysinfo.getProperty('version')")
 
-    @property
-    def is_b2g(self):
-        return self.appinfo["name"] == "B2G"
-
     def test_mandates_capabilities(self):
         self.assertIn("browserName", self.caps)
         self.assertIn("browserVersion", self.caps)
         self.assertIn("platformName", self.caps)
         self.assertIn("platformVersion", self.caps)
         self.assertIn("specificationLevel", self.caps)
 
         self.assertEqual(self.caps["browserName"], self.appinfo["name"].lower())
@@ -37,17 +33,16 @@ class TestCapabilities(MarionetteTestCas
         self.assertEqual(self.caps["specificationLevel"], 0)
 
     def test_supported_features(self):
         self.assertIn("rotatable", self.caps)
         self.assertIn("acceptSslCerts", self.caps)
         self.assertIn("takesElementScreenshot", self.caps)
         self.assertIn("takesScreenshot", self.caps)
 
-        self.assertEqual(self.caps["rotatable"], self.is_b2g)
         self.assertFalse(self.caps["acceptSslCerts"])
         self.assertTrue(self.caps["takesElementScreenshot"])
         self.assertTrue(self.caps["takesScreenshot"])
 
     def test_selenium2_compat(self):
         self.assertIn("platform", self.caps)
         self.assertEqual(self.caps["platform"], self.caps["platformName"].upper())
 
deleted file mode 100644
--- a/testing/marionette/harness/marionette/tests/unit/test_element_touch.py
+++ /dev/null
@@ -1,35 +0,0 @@
-# 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/.
-
-from marionette import MarionetteTestCase
-from marionette_driver.errors import MarionetteException
-from marionette_driver.by import By
-
-
-class testElementTouch(MarionetteTestCase):
-    def test_touch(self):
-      testAction = self.marionette.absolute_url("testAction.html")
-      self.marionette.navigate(testAction)
-      button = self.marionette.find_element(By.ID, "button1")
-      button.tap()
-      expected = "button1-touchstart-touchend-mousemove-mousedown-mouseup-click"
-      self.wait_for_condition(lambda m: m.execute_script("return document.getElementById('button1').innerHTML;") == expected)
-      button = self.marionette.find_element(By.ID, "button2")
-      button.tap()
-      expected = "button2-touchstart-touchend-mousemove-mousedown-mouseup-click"
-      self.wait_for_condition(lambda m: m.execute_script("return document.getElementById('button2').innerHTML;") == expected)
-
-    def test_invisible(self):
-      testAction = self.marionette.absolute_url("testAction.html")
-      self.marionette.navigate(testAction)
-      ele = self.marionette.find_element(By.ID, "hidden")
-      self.assertRaises(MarionetteException, ele.tap)
-
-    def test_scrolling(self):
-      testAction = self.marionette.absolute_url("testAction.html")
-      self.marionette.navigate(testAction)
-      ele = self.marionette.find_element(By.ID, "buttonScroll")
-      ele.tap()
-      expected = "buttonScroll-touchstart-touchend-mousemove-mousedown-mouseup-click"
-      self.wait_for_condition(lambda m: m.execute_script("return document.getElementById('buttonScroll').innerHTML;") == expected)
deleted file mode 100644
--- a/testing/marionette/harness/marionette/tests/unit/test_gesture.py
+++ /dev/null
@@ -1,38 +0,0 @@
-# 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/.
-
-from marionette import MarionetteTestCase
-from marionette.gestures import smooth_scroll
-from marionette_driver.by import By
-
-
-class testGestures(MarionetteTestCase):
-    check_in_viewport = """
-        function elementInViewport(el) {
-          let rect = el.getBoundingClientRect();
-          return (rect.top >= window.pageYOffset &&
-                 rect.left >= window.pageXOffset &&
-                 rect.bottom <= (window.pageYOffset + window.innerHeight) &&
-                 rect.right <= (window.pageXOffset + window.innerWidth)
-         );   
-        };
-    """
-    def test_smooth_scroll(self):
-        testAction = self.marionette.absolute_url("testAction.html")
-        self.marionette.navigate(testAction)
-        button = self.marionette.find_element(By.ID, "button2")
-        self.assertFalse(self.marionette.execute_script("{}; return elementInViewport(document.getElementById('buttonScroll'));" .format(elf.check_in_viewport)))
-        smooth_scroll(self.marionette, button, "y",  -1, 800)
-        buttonScroll = self.marionette.find_element(By.ID, "buttonScroll")
-        self.wait_for_condition(lambda m: m.execute_script("{}; return elementInViewport(arguments[0]);".format(self.check_in_viewport, [buttonScroll]) == True))
-        self.assertEqual("button2-touchstart", self.marionette.execute_script("return document.getElementById('button2').innerHTML;"))
-
-    """
-    #This test doesn't manipulate the page, filed Bug 870377 about it.
-    def test_pinch(self):
-        testAction = self.marionette.absolute_url("testAction.html")
-        self.marionette.navigate(testAction)
-        button = self.marionette.find_element(By.ID, "button1")
-        pinch(self.marionette, button, 0, 0, 0, 0, 0, -50, 0, 50)
-    """
deleted file mode 100644
--- a/testing/marionette/harness/marionette/tests/unit/test_multi_finger.py
+++ /dev/null
@@ -1,67 +0,0 @@
-# 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/.
-
-from marionette import MarionetteTestCase
-from marionette_driver.marionette import MultiActions, Actions
-from marionette_driver.by import By
-
-
-class testMultiFinger(MarionetteTestCase):
-    def test_move_element(self):
-      testAction = self.marionette.absolute_url("testAction.html")
-      self.marionette.navigate(testAction)
-      start = self.marionette.find_element(By.ID, "button1")
-      drop = self.marionette.find_element(By.ID, "button2")
-      ele = self.marionette.find_element(By.ID, "button3")
-      multi_action = MultiActions(self.marionette)
-      action1 = Actions(self.marionette)
-      action2 = Actions(self.marionette)
-      action1.press(start).move(drop).wait(3).release()
-      action2.press(ele).wait().release()
-      multi_action.add(action1).add(action2).perform()
-      expected = "button1-touchstart"
-      self.wait_for_condition(lambda m: m.execute_script("return document.getElementById('button1').innerHTML;") == expected)
-      self.assertEqual("button2-touchmove-touchend", self.marionette.execute_script("return document.getElementById('button2').innerHTML;"))
-      self.assertTrue("button3-touchstart-touchend" in self.marionette.execute_script("return document.getElementById('button3').innerHTML;"))
-
-    def test_move_offset_element(self):
-      testAction = self.marionette.absolute_url("testAction.html")
-      self.marionette.navigate(testAction)
-      start = self.marionette.find_element(By.ID, "button1")
-      ele = self.marionette.find_element(By.ID, "button3")
-      multi_action = MultiActions(self.marionette)
-      action1 = Actions(self.marionette)
-      action2 = Actions(self.marionette)
-      action1.press(start).move_by_offset(0,300).wait().release()
-      action2.press(ele).wait(5).release()
-      multi_action.add(action1).add(action2).perform()
-      expected = "button1-touchstart"
-      self.wait_for_condition(lambda m: m.execute_script("return document.getElementById('button1').innerHTML;") == expected)
-      self.assertEqual("button2-touchmove-touchend", self.marionette.execute_script("return document.getElementById('button2').innerHTML;"))
-      self.assertTrue("button3-touchstart-touchend" in self.marionette.execute_script("return document.getElementById('button3').innerHTML;"))
-
-    def test_three_fingers(self):
-      testAction = self.marionette.absolute_url("testAction.html")
-      self.marionette.navigate(testAction)
-      start_one = self.marionette.find_element(By.ID, "button1")
-      start_two = self.marionette.find_element(By.ID, "button2")
-      element1 = self.marionette.find_element(By.ID, "button3")
-      element2 = self.marionette.find_element(By.ID, "button4")
-      multi_action = MultiActions(self.marionette)
-      action1 = Actions(self.marionette)
-      action2 = Actions(self.marionette)
-      action3 = Actions(self.marionette)
-      action1.press(start_one).move_by_offset(0,300).release()
-      action2.press(element1).wait().wait(5).release()
-      action3.press(element2).wait().wait().release()
-      multi_action.add(action1).add(action2).add(action3).perform()
-      expected = "button1-touchstart"
-      self.wait_for_condition(lambda m: m.execute_script("return document.getElementById('button1').innerHTML;") == expected)
-      self.assertEqual("button2-touchmove-touchend", self.marionette.execute_script("return document.getElementById('button2').innerHTML;"))
-      button3_text = self.marionette.execute_script("return document.getElementById('button3').innerHTML;")
-      button4_text = self.marionette.execute_script("return document.getElementById('button4').innerHTML;")
-      self.assertTrue("button3-touchstart-touchend" in button3_text)
-      self.assertTrue("button4-touchstart-touchend" in button4_text)
-      self.assertTrue(int(button3_text.rsplit("-")[-1]) >= 5000)
-      self.assertTrue(int(button4_text.rsplit("-")[-1]) >= 5000)
deleted file mode 100644
--- a/testing/marionette/harness/marionette/tests/unit/test_single_finger.py
+++ /dev/null
@@ -1,96 +0,0 @@
-# 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/.
-
-from marionette import MarionetteTestCase
-from marionette_driver.marionette import Actions
-from marionette_driver.errors import MarionetteException
-from marionette_driver.by import By
-#add this directory to the path
-import os
-import sys
-sys.path.append(os.path.dirname(__file__))
-from single_finger_functions import (
-        chain, chain_flick, context_menu, double_tap,
-        long_press_action, long_press_on_xy_action,
-        move_element, move_element_offset, press_release, single_tap, wait,
-        wait_with_value
-        )
-
-
-class testSingleFinger(MarionetteTestCase):
-    def test_press_release(self):
-        press_release(self.marionette, 1, self.wait_for_condition, "button1-touchstart-touchend-mousemove-mousedown-mouseup-click")
-
-    def test_press_release_twice(self):
-        press_release(self.marionette, 2, self.wait_for_condition, "button1-touchstart-touchend-mousemove-mousedown-mouseup-click-touchstart-touchend-mousemove-mousedown-mouseup-click")
-
-    def test_move_element(self):
-        move_element(self.marionette, self.wait_for_condition, "button1-touchstart", "button2-touchmove-touchend")
-
-    """
-    #Skipping due to Bug 874914
-    def test_move_by_offset(self):
-        move_element_offset(self.marionette, self.wait_for_condition, "button1-touchstart", "button2-touchmove-touchend")
-    """
-
-    def test_no_press(self):
-        testAction = self.marionette.absolute_url("testAction.html")
-        self.marionette.navigate(testAction)
-        action = Actions(self.marionette)
-        action.release()
-        self.assertRaises(MarionetteException, action.perform)
-
-    def test_wait(self):
-        wait(self.marionette, self.wait_for_condition, "button1-touchstart-touchend-mousemove-mousedown-mouseup-click")
-
-    def test_wait_with_value(self):
-        wait_with_value(self.marionette, self.wait_for_condition, "button1-touchstart-touchend-mousemove-mousedown-mouseup-click")
-
-    def test_context_menu(self):
-        context_menu(self.marionette, self.wait_for_condition, "button1-touchstart-contextmenu", "button1-touchstart-contextmenu-touchend")
-
-    def test_long_press_action(self):
-        long_press_action(self.marionette, self.wait_for_condition, "button1-touchstart-contextmenu-touchend")
-
-    def test_long_press_on_xy_action(self):
-        long_press_on_xy_action(self.marionette, self.wait_for_condition, "button1-touchstart-touchend")
-
-    """
-    #Skipping due to Bug 865334
-    def test_long_press_fail(self):
-        testAction = self.marionette.absolute_url("testAction.html")
-        self.marionette.navigate(testAction)
-        button = self.marionette.find_element(By.ID, "button1Copy")
-        action = Actions(self.marionette)
-        action.press(button).long_press(button, 5)
-        self.assertRaises(MarionetteException, action.perform)
-    """
-
-    def test_chain(self):
-        chain(self.marionette, self.wait_for_condition, "button1-touchstart", "delayed-touchmove-touchend")
-
-    """
-    #Skipping due to Bug 874914. Flick uses chained moveByOffset calls
-    def test_chain_flick(self):
-        chain_flick(self.marionette, self.wait_for_condition, "button1-touchstart-touchmove", "buttonFlick-touchmove-touchend")
-    """
-
-    """
-    #Skipping due to Bug 865334
-    def test_touchcancel_chain(self):
-        testAction = self.marionette.absolute_url("testAction.html")
-        self.marionette.navigate(testAction)
-        button = self.marionette.find_element(By.ID, "button1")
-        action = Actions(self.marionette)
-        action.press(button).wait(5).cancel()
-        action.perform()
-        expected = "button1-touchstart-touchcancel"
-        self.wait_for_condition(lambda m: m.execute_script("return document.getElementById('button1').innerHTML;") == expected)
-    """
-
-    def test_single_tap(self):
-        single_tap(self.marionette, self.wait_for_condition, "button1-touchstart-touchend-mousemove-mousedown-mouseup-click")
-
-    def test_double_tap(self):
-        double_tap(self.marionette, self.wait_for_condition, "button1-touchstart-touchend-mousemove-mousedown-mouseup-click-touchstart-touchend-mousemove-mousedown-mouseup-click")
--- a/testing/marionette/harness/marionette/tests/unit/unit-tests.ini
+++ b/testing/marionette/harness/marionette/tests/unit/unit-tests.ini
@@ -1,145 +1,126 @@
 [test_marionette.py]
 [test_data_driven.py]
 [test_session.py]
 [test_capabilities.py]
-
 [test_accessibility.py]
-skip-if = buildapp == 'b2g'
-
 [test_expectedfail.py]
 expected = fail
 [test_import_script.py]
-skip-if = buildapp == 'b2g'
 [test_click.py]
 [test_click_chrome.py]
-skip-if = buildapp == 'b2g' || appname == 'fennec'
+skip-if = appname == 'fennec'
 [test_checkbox.py]
 [test_checkbox_chrome.py]
-skip-if = buildapp == 'b2g' || appname == 'fennec'
+skip-if = appname == 'fennec'
 [test_elementsize.py]
 [test_elementsize_chrome.py]
-skip-if = buildapp == 'b2g' || appname == 'fennec'
+skip-if = appname == 'fennec'
 [test_position.py]
 [test_rendered_element.py]
 [test_chrome_element_css.py]
-skip-if = buildapp == 'b2g' || appname == 'fennec'
+skip-if = appname == 'fennec'
 [test_element_state.py]
 [test_element_state_chrome.py]
-skip-if = buildapp == 'b2g' || appname == 'fennec'
+skip-if = appname == 'fennec'
 [test_text.py]
 [test_text_chrome.py]
 skip-if = true # "Bug 896046"
 
 [test_clearing.py]
 [test_typing.py]
 
 [test_log.py]
 
 [test_about_pages.py]
-skip-if = buildapp == 'b2g'
 
 [test_execute_async_script.py]
 [test_execute_script.py]
 [test_simpletest_fail.js]
 [test_element_retrieval.py]
 [test_findelement_chrome.py]
-skip-if = buildapp == 'b2g' || appname == 'fennec'
+skip-if = appname == 'fennec'
 
 [test_navigation.py]
 
 [test_timeouts.py]
 
-[test_element_touch.py]
-skip-if = buildapp != 'b2g'
-
-[test_gesture.py]
-skip-if = true # buildapp != 'b2g' -- Bug 1060060
-
-[test_single_finger.py]
-skip-if = true # buildapp != 'b2g' -- Bug 1060060
 [test_single_finger_desktop.py]
-skip-if = buildapp == 'b2g' || appname == 'fennec' || os == "win" # Bug 1025040
-
-[test_multi_finger.py]
-skip-if = true # buildapp != 'b2g' -- Bug 1060060
+skip-if = appname == 'fennec' || os == "win" # Bug 1025040
 
 [test_simpletest_pass.js]
 [test_simpletest_sanity.py]
 [test_simpletest_chrome.js]
 [test_simpletest_timeout.js]
 [test_anonymous_content.py]
-skip-if = buildapp == 'b2g' || appname == 'fennec'
+skip-if = appname == 'fennec'
 [test_switch_frame.py]
-skip-if = buildapp == 'b2g' || os == "win" # Bug 1078237
+skip-if = os == "win" # Bug 1078237
 [test_switch_frame_chrome.py]
-skip-if = buildapp == 'b2g' || appname == 'fennec'
+skip-if = appname == 'fennec'
 [test_switch_remote_frame.py]
-skip-if = buildapp == 'b2g' || appname == 'fennec'
+skip-if = appname == 'fennec'
 
 [test_pagesource.py]
 [test_pagesource_chrome.py]
-skip-if = buildapp == 'b2g' || appname == 'fennec'
+skip-if = appname == 'fennec'
 
 [test_visibility.py]
 [test_window_switching.py]
-skip-if = buildapp == 'b2g' || appname == 'fennec'
+skip-if = appname == 'fennec'
 [test_window_management.py]
-skip-if = buildapp == 'b2g' || appname == 'fennec'
+skip-if = appname == 'fennec'
 [test_window_position.py]
-skip-if = buildapp == 'b2g' || appname == 'fennec'
+skip-if = appname == 'fennec'
 [test_window_handles.py]
-skip-if = buildapp == 'b2g' || appname == 'fennec'
+skip-if = appname == 'fennec'
 
 [test_screenshot.py]
 [test_cookies.py]
-skip-if = buildapp == 'b2g'
 [test_window_title.py]
 [test_window_title_chrome.py]
-skip-if = buildapp == 'b2g' || appname == 'fennec'
+skip-if = appname == 'fennec'
 [test_window_type.py]
-skip-if = buildapp == 'b2g' || appname == 'fennec'
+skip-if = appname == 'fennec'
 [test_implicit_waits.py]
 [test_wait.py]
 [test_expected.py]
 [test_date_time_value.py]
 [test_getactiveframe_oop.py]
-skip-if = true # buildapp == 'b2g' -- Bug 925688
+skip-if = true # Bug 925688
 [test_chrome_async_finish.js]
 [test_screen_orientation.py]
 [test_errors.py]
 
 [test_execute_isolate.py]
 [test_click_scrolling.py]
 [test_profile_management.py]
-skip-if = buildapp == 'b2g'
 [test_quit_restart.py]
-skip-if = buildapp == 'b2g' || appname == 'fennec' # Bug 1298921
+skip-if = appname == 'fennec' # Bug 1298921
 [test_set_window_size.py]
-skip-if = buildapp == 'b2g' || os == "linux" || appname == 'fennec' # Bug 1085717
+skip-if = os == "linux" || appname == 'fennec' # Bug 1085717
 [test_with_using_context.py]
 
 [test_modal_dialogs.py]
-skip-if = buildapp == 'b2g' || appname == 'fennec'
+skip-if = appname == 'fennec'
 [test_key_actions.py]
 [test_mouse_action.py]
 skip-if = appname == 'fennec'
 [test_teardown_context_preserved.py]
-skip-if = buildapp == 'b2g'
 [test_file_upload.py]
-skip-if = buildapp == 'b2g' || appname == 'fennec' || os == "win" # http://bugs.python.org/issue14574
+skip-if = appname == 'fennec' || os == "win" # http://bugs.python.org/issue14574
 
 [test_execute_sandboxes.py]
 [test_using_permissions.py]
 [test_using_prefs.py]
 
 [test_shadow_dom.py]
 
 [test_chrome.py]
-skip-if = buildapp == 'b2g' || appname == 'fennec'
+skip-if = appname == 'fennec'
 
 [test_addons.py]
 
 [test_select.py]
 [test_crash.py]
 [test_httpd.py]
 [test_localization.py]