tests: externalResize: also test concession expiry

This commit is contained in:
Peter Fajdiga
2024-10-05 14:36:49 +02:00
parent e95378c0dd
commit a4236534fc
2 changed files with 15 additions and 4 deletions

View File

@@ -25,9 +25,18 @@ tests.register("External resize", 1, () => {
workspaceMock.createWindow(client);
Assert.equalRects(client.frameGeometry, getTiledFrame(100), { message: "We should tile the window, respecting its desired width" });
client.frameGeometry = getClientDesiredFrame(110);
Assert.equalRects(client.frameGeometry, getTiledFrame(110), { message: "We should re-arrange the window, respecting its new desired width" });
function testExternalResizing() {
client.frameGeometry = getClientDesiredFrame(110);
Assert.equalRects(client.frameGeometry, getTiledFrame(110), { message: "We should re-arrange the window, respecting its new desired width" });
client.frameGeometry = getClientDesiredFrame(120);
Assert.equalRects(client.frameGeometry, getClientDesiredFrame(120), { message: "We should give up and let the client have its desired frame" });
client.frameGeometry = getClientDesiredFrame(120);
Assert.equalRects(client.frameGeometry, getClientDesiredFrame(120), { message: "We should give up and let the client have its desired frame" });
}
testExternalResizing();
setTimeout(() => {
// the concession has expired, let's test again
testExternalResizing();
}, 1000);
});

View File

@@ -1,3 +1,5 @@
declare const process: {
exit(code?: number): void,
};
declare const setTimeout: (callback: () => void, timeout: number) => void;