summaryrefslogtreecommitdiffstats
path: root/tests/auto/wasm/selenium/qwasmwindow.py
diff options
context:
space:
mode:
authorEven Oscar Andersen <[email protected]>2024-03-15 22:28:59 +0100
committerEven Oscar Andersen <[email protected]>2024-09-05 16:43:52 +0200
commit00ce86a90815443562bebd68277bda77972bc65d (patch)
treea5ae5994a842efbdcfb57f0c87c7b85db6591e42 /tests/auto/wasm/selenium/qwasmwindow.py
parent183a775f80a029136416c75a66f74e4c099e0d32 (diff)
wasm: disable spinbox context menu if not ASYNCIFY to avoid deadlock
Using exec will lock the application if asyncify is not used Fixes: QTBUG-120925 Change-Id: Ic8b3acc402f3ecbfb07fd8cb80013e02e2421402 Reviewed-by: Morten Johan Sørvig <[email protected]>
Diffstat (limited to 'tests/auto/wasm/selenium/qwasmwindow.py')
-rw-r--r--tests/auto/wasm/selenium/qwasmwindow.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/auto/wasm/selenium/qwasmwindow.py b/tests/auto/wasm/selenium/qwasmwindow.py
index df2d39f5167..3d70f742034 100644
--- a/tests/auto/wasm/selenium/qwasmwindow.py
+++ b/tests/auto/wasm/selenium/qwasmwindow.py
@@ -81,6 +81,35 @@ class WidgetTestCase(unittest.TestCase):
clearWidgets(self._driver)
+ #Looks weird, no asserts, the test is that
+ #the test itself finishes
+ def test_showContextMenu_doesNotDeadlock(self):
+ screen = Screen(self._driver, ScreenPosition.FIXED,
+ x=0, y=0, width=600, height=1200)
+
+ w0 = Widget(self._driver, "w0")
+ w0.show()
+ w0.showContextMenu()
+
+ w1 = Widget(self._driver, "w1")
+ w1.setNoFocusShow()
+ w1.show()
+ w1.showContextMenu()
+
+ w2 = Widget(self._driver, "w2")
+ w2.show()
+ w2.showContextMenu()
+
+ w3 = Widget(self._driver, "w3")
+ w3.setNoFocusShow()
+ w3.show()
+ w3.showContextMenu()
+
+ w3.activate();
+ w3.showContextMenu()
+
+ clearWidgets(self._driver)
+
def test_window_resizing(self):
screen = Screen(self._driver, ScreenPosition.FIXED,
x=0, y=0, width=600, height=600)
@@ -686,6 +715,12 @@ class Widget:
information = call_instance_function(self.driver, 'windowInformation')
return next(filter(lambda e: e['title'] == "Dialog", information))
+ def showContextMenu(self):
+ self.driver.execute_script(
+ f'''
+ instance.showContextMenuWidget('{self.name}');
+ '''
+ )
class Window:
def __init__(self, parent=None, rect=None, title=None, element=None, visible=True, opengl=0):