Skip to content

Commit

Permalink
dnd: use gtkapp
Browse files Browse the repository at this point in the history
  • Loading branch information
Saviq committed Feb 9, 2024
1 parent 8754e55 commit 0982fe4
Showing 1 changed file with 8 additions and 25 deletions.
33 changes: 8 additions & 25 deletions mir-ci/mir_ci/test_drag_and_drop.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,6 @@
APP_PATH = Path(__file__).parent / "clients/drag_and_drop_demo.py"


@pytest.mark.xdg(
XDG_CONFIG_HOME={
"glib-2.0/settings/keyfile": dedent(
"""\
[org/gnome/desktop/interface]
color-scheme='prefer-light'
gtk-theme='Adwaita'
icon-theme='Adwaita'
font-name='Ubuntu 11'
cursor-theme='Adwaita'
cursor-size=24
font-antialiasing='grayscale'
"""
),
},
)
@pytest.mark.env(GSETTINGS_BACKEND="keyfile")
@pytest.mark.parametrize(
"modern_server",
[
Expand Down Expand Up @@ -56,14 +39,14 @@ class TestDragAndDrop:
@pytest.mark.parametrize(
"app",
[
("python3", APP_PATH, "--source", "pixbuf", "--target", "pixbuf", "--expect", "pixbuf"),
("python3", APP_PATH, "--source", "text", "--target", "text", "--expect", "text"),
apps.gtkapp("python3", APP_PATH, "--source", "pixbuf", "--target", "pixbuf", "--expect", "pixbuf"),
apps.gtkapp("python3", APP_PATH, "--source", "text", "--target", "text", "--expect", "text"),
],
)
async def test_source_and_dest_match(self, modern_server, app, request) -> None:
extensions = VirtualPointer.required_extensions + ScreencopyTracker.required_extensions
server_instance = DisplayServer(modern_server, add_extensions=extensions)
program = server_instance.program(apps.App(app))
program = server_instance.program(app)

robot_test_case = dedent(
"""\
Expand All @@ -84,16 +67,16 @@ async def test_source_and_dest_match(self, modern_server, app, request) -> None:
@pytest.mark.parametrize(
"app",
[
("python3", "-u", APP_PATH, "--source", "pixbuf", "--target", "text", "--expect", "pixbuf"),
("python3", "-u", APP_PATH, "--source", "text", "--target", "pixbuf", "--expect", "text"),
("python3", "-u", APP_PATH, "--source", "pixbuf", "--target", "text", "--expect", "text"),
("python3", "-u", APP_PATH, "--source", "text", "--target", "pixbuf", "--expect", "pixbuf"),
apps.gtkapp("python3", "-u", APP_PATH, "--source", "pixbuf", "--target", "text", "--expect", "pixbuf"),
apps.gtkapp("python3", "-u", APP_PATH, "--source", "text", "--target", "pixbuf", "--expect", "text"),
apps.gtkapp("python3", "-u", APP_PATH, "--source", "pixbuf", "--target", "text", "--expect", "text"),
apps.gtkapp("python3", "-u", APP_PATH, "--source", "text", "--target", "pixbuf", "--expect", "pixbuf"),
],
)
async def test_source_and_dest_mismatch(self, modern_server, app, request) -> None:
extensions = VirtualPointer.required_extensions + ScreencopyTracker.required_extensions
server_instance = DisplayServer(modern_server, add_extensions=extensions)
program = server_instance.program(apps.App(app))
program = server_instance.program(app)

robot_test_case = dedent(
"""\
Expand Down

0 comments on commit 0982fe4

Please sign in to comment.