mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-20 08:29:20 +03:00
nixos/tests/chromium: Fix a race condition
Only execute Ctrl+w to close the currently active window if the new/secondary window (title: "New Tab") could be selected. This fixes a test failure since the update to Chromium M88 (cc PR #110010). Without this additional check the main window (title: "startup done") could still be selected (and thus will be closed) and the script would close both windows (i.e. terminate Chromium completely).
This commit is contained in:
parent
3df16a48bf
commit
8a7a8442c1
1 changed files with 8 additions and 7 deletions
|
@ -80,7 +80,7 @@ mapAttrs (channel: chromiumPkg: makeTest rec {
|
||||||
|
|
||||||
def close_win():
|
def close_win():
|
||||||
def try_close(_):
|
def try_close(_):
|
||||||
machine.execute(
|
status, _ = machine.execute(
|
||||||
ru(
|
ru(
|
||||||
"${xdo "close-window" ''
|
"${xdo "close-window" ''
|
||||||
search --onlyvisible --name "new tab"
|
search --onlyvisible --name "new tab"
|
||||||
|
@ -89,13 +89,14 @@ mapAttrs (channel: chromiumPkg: makeTest rec {
|
||||||
''}"
|
''}"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
machine.execute(
|
if status == 0:
|
||||||
ru(
|
machine.execute(
|
||||||
"${xdo "close-window" ''
|
ru(
|
||||||
key Ctrl+w
|
"${xdo "close-window" ''
|
||||||
''}"
|
key Ctrl+w
|
||||||
|
''}"
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
|
||||||
for _ in range(1, 20):
|
for _ in range(1, 20):
|
||||||
status, out = machine.execute(
|
status, out = machine.execute(
|
||||||
ru(
|
ru(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue