on xenial help sign in
add a QML test to verify pressing the PrtScr keyboard shortcut
86a756fLukáš Tinkl
tests/qmltests/Components/tst_PhysicalKeysMapper.qml+5
@@ -89,6 +89,11 @@ TestCase {
89 compare(powerSpy.count, 1);
89 compare(powerSpy.count, 1);
90 }
90 }
91
91
92+ function test_screenshotPrtScr() {
93+ physicalKeysMapper.onKeyPressed({ key: Qt.Key_Print })
94+ tryCompare(screenshotSpy, "count", 1) // verify the screenshotTriggered signal has been called, exactly once
95+ }
96+
92 function test_screenshotButtons_data() {
97 function test_screenshotButtons_data() {
93 return [
98 return [
94 { tag: "UpFirst", first: Qt.Key_VolumeUp, second: Qt.Key_VolumeDown },
99 { tag: "UpFirst", first: Qt.Key_VolumeUp, second: Qt.Key_VolumeDown },