summaryrefslogtreecommitdiff
path: root/hyprtester/src/tests/main/window.cpp
diff options
context:
space:
mode:
authorItsOhen <TNordfeldt@gmail.com>2026-03-15 20:32:05 +0100
committerGitHub <noreply@github.com>2026-03-15 14:32:05 -0500
commit94bd4123c6e8fd3162e245b0d568c9d6dfd75780 (patch)
tree764d69857d566a44939394960b05731c709ae973 /hyprtester/src/tests/main/window.cpp
parent3fd2a95475d9a954305eeede59fe2b345a4d8098 (diff)
desktop/rules: fix static rules and content type. (#13725)
Hopefully for the last time in a while. Also a lot easier to add in new static types with the recheck done in window map instead of the rule.
Diffstat (limited to 'hyprtester/src/tests/main/window.cpp')
-rw-r--r--hyprtester/src/tests/main/window.cpp35
1 files changed, 20 insertions, 15 deletions
diff --git a/hyprtester/src/tests/main/window.cpp b/hyprtester/src/tests/main/window.cpp
index a42ffd38..5c0fe2fe 100644
--- a/hyprtester/src/tests/main/window.cpp
+++ b/hyprtester/src/tests/main/window.cpp
@@ -647,31 +647,36 @@ static bool testWindowRuleWorkspaceEmpty() {
return true;
}
-static void testContentRules() {
+static bool testContentRules() {
NLog::log("{}Testing content window rules", Colors::YELLOW);
// kill me PLEASE
- OK(getFromSocket("/keyword windowrule match:class kitty_bitch, content game"));
+ OK(getFromSocket("/keyword windowrule match:class kitty_content_string, content game"));
+ OK(getFromSocket("/keyword windowrule match:class kitty_content_numbers, content 3"));
OK(getFromSocket("/keyword windowrule match:content game, border_size 10"));
OK(getFromSocket("/keyword windowrule match:content 3, opacity 0.5"));
- getFromSocket("/dispatch workspace 420");
+ const auto testProps = []() {
+ EXPECT_CONTAINS(getFromSocket("/getprop active border_size"), "10");
+ EXPECT_CONTAINS(getFromSocket("/getprop active opacity"), "0.5");
+ };
+ if (!spawnKitty("kitty_content_string"))
+ return false;
+ waitForActiveWindow("kitty_content_string");
+ testProps();
- if (!spawnKitty("kitty_bitch")) {
- NLog::log("{}Error: failed to spawn kitty", Colors::RED);
- return;
- }
+ Tests::killAllWindows();
+ EXPECT(Tests::windowCount(), 0);
- {
- auto res = getFromSocket("/getprop active border_size");
- EXPECT_CONTAINS(res, "10");
- }
+ if (!spawnKitty("kitty_content_numbers"))
+ return false;
+ waitForActiveWindow("kitty_content_numbers");
+ testProps();
- {
- auto res = getFromSocket("/getprop active opacity");
- EXPECT_CONTAINS(res, "0.5");
- }
+ Tests::killAllWindows();
+ EXPECT(Tests::windowCount(), 0);
+ return true;
}
static bool test() {