summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCole Robinson <crobinso@redhat.com>2021-05-19 16:46:30 -0400
committerCole Robinson <crobinso@redhat.com>2021-05-19 16:46:30 -0400
commit61a4c0083561410c885e851628e5583e5b6f70d8 (patch)
treea5e95f40b3188aae00781aed7bf2c2878811433f
parent499739cee3601a6867747ffd3cc9680649fb0e6e (diff)
downloadvirt-manager-61a4c0083561410c885e851628e5583e5b6f70d8.tar.gz
tests: uitests: Add mock test for VNC autoresize
Signed-off-by: Cole Robinson <crobinso@redhat.com>
-rw-r--r--tests/uitests/test_livetests.py27
-rw-r--r--virtManager/details/viewers.py2
2 files changed, 28 insertions, 1 deletions
diff --git a/tests/uitests/test_livetests.py b/tests/uitests/test_livetests.py
index 0269a120..28884298 100644
--- a/tests/uitests/test_livetests.py
+++ b/tests/uitests/test_livetests.py
@@ -4,6 +4,7 @@
import os
import libvirt
+import pytest
from virtinst import log
@@ -400,6 +401,32 @@ def testConsoleSpiceSpecific(app, dom):
win.click_title()
+@_vm_wrapper("uitests-vnc-standard")
+def testVNCSpecific(app, dom):
+ from gi.repository import GtkVnc
+ if not hasattr(GtkVnc.Display, "set_allow_resize"):
+ pytest.skip("GtkVnc is too old")
+
+ ignore = dom
+ win = app.topwin
+ con = win.find("console-gfx-viewport")
+ lib.utils.check(lambda: con.showing)
+
+ # Test guest resize behavior
+ def _click_auto():
+ vmenu = win.find("^View$", "menu")
+ vmenu.click()
+ smenu = vmenu.find("Scale Display", "menu")
+ smenu.point()
+ smenu.find("Auto resize VM", "check menu item").click()
+ _click_auto()
+ win.click_title()
+ win.window_maximize()
+ _click_auto()
+ win.click_title()
+ win.click_title()
+
+
def _testLiveHotplug(app, fname):
win = app.topwin
win.find("Details", "radio button").click()
diff --git a/virtManager/details/viewers.py b/virtManager/details/viewers.py
index 07082aa0..3ac6bd4e 100644
--- a/virtManager/details/viewers.py
+++ b/virtManager/details/viewers.py
@@ -413,7 +413,7 @@ class VNCViewer(Viewer):
def _get_resizeguest(self):
if hasattr(self._display, "set_allow_resize"):
return self._display.get_allow_resize() # pylint: disable=no-member
- return False
+ return False # pragma: no cover
def _get_usb_widget(self):
return None # pragma: no cover