summaryrefslogtreecommitdiffstats
path: root/tests/auto/wasm/selenium/qwasmwindow.py
diff options
context:
space:
mode:
authorEven Oscar Andersen <[email protected]>2024-10-29 09:00:08 +0100
committerEven Oscar Andersen <[email protected]>2024-11-26 16:25:11 +0100
commitef8bf4c2cf3d86a869ff8a555d4e390168864144 (patch)
tree99020819212b9c2ec2056c5cddbfbea8aa9b2c82 /tests/auto/wasm/selenium/qwasmwindow.py
parent6085b9399053cd6665dc1a7b636c078992aaffe0 (diff)
wasm: Fix focus handling
We had input handling enabled as a precondition for setting focus. This is wrong, we need to have the focus for toggle buttons and other non-input things as well. (Also toggle buttons act on spacebar). Also selects a new active window if the window that is active (i.e a dialog) is deleted. Also shift + tab did not always work, fixed to emit Key_Backtab Fixes: QTBUG-130371 Pick-to: 6.8 Change-Id: I3b36a3e200ba9d4b0791865e75235ddfb72bcaa5 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.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/auto/wasm/selenium/qwasmwindow.py b/tests/auto/wasm/selenium/qwasmwindow.py
index bf05aed9db4..fcda0359c4c 100644
--- a/tests/auto/wasm/selenium/qwasmwindow.py
+++ b/tests/auto/wasm/selenium/qwasmwindow.py
@@ -91,6 +91,18 @@ class WidgetTestCase(unittest.TestCase):
self.assertEqual(w2.hasFocus(), False)
self.assertEqual(w3.hasFocus(), True)
+ w3.close();
+ self.assertEqual(w0.hasFocus(), False)
+ self.assertEqual(w1.hasFocus(), False)
+ self.assertEqual(w2.hasFocus(), True)
+
+ w2.close();
+ self.assertEqual(w0.hasFocus(), True)
+ self.assertEqual(w1.hasFocus(), False)
+
+ w1.close();
+ self.assertEqual(w0.hasFocus(), True)
+
clearWidgets(self._driver)
#Looks weird, no asserts, the test is that
@@ -744,6 +756,13 @@ class Widget:
'''
)
+ def close(self):
+ self.driver.execute_script(
+ f'''
+ instance.closeWidget('{self.name}');
+ '''
+ )
+
class Window:
def __init__(self, parent=None, rect=None, title=None, element=None, visible=True, opengl=0):
self.driver = parent.driver