Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/shell_client_rules_test.cpp
Show First 20 Lines • Show All 224 Lines • ▼ Show 20 Line(s) | |||||
225 | void TestShellClientRules::initTestCase() | 225 | void TestShellClientRules::initTestCase() | ||
226 | { | 226 | { | ||
227 | qRegisterMetaType<KWin::ShellClient *>(); | 227 | qRegisterMetaType<KWin::ShellClient *>(); | ||
228 | qRegisterMetaType<KWin::AbstractClient *>(); | 228 | qRegisterMetaType<KWin::AbstractClient *>(); | ||
229 | 229 | | |||
230 | QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); | 230 | QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); | ||
231 | QVERIFY(workspaceCreatedSpy.isValid()); | 231 | QVERIFY(workspaceCreatedSpy.isValid()); | ||
232 | kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); | 232 | kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); | ||
233 | QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); | | |||
234 | QVERIFY(waylandServer()->init(s_socketName.toLocal8Bit())); | 233 | QVERIFY(waylandServer()->init(s_socketName.toLocal8Bit())); | ||
234 | QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); | ||||
235 | 235 | | |||
236 | kwinApp()->start(); | 236 | kwinApp()->start(); | ||
237 | QVERIFY(workspaceCreatedSpy.wait()); | 237 | QVERIFY(workspaceCreatedSpy.wait()); | ||
238 | QCOMPARE(screens()->count(), 2); | 238 | QCOMPARE(screens()->count(), 2); | ||
239 | QCOMPARE(screens()->geometry(0), QRect(0, 0, 1280, 1024)); | 239 | QCOMPARE(screens()->geometry(0), QRect(0, 0, 1280, 1024)); | ||
240 | QCOMPARE(screens()->geometry(1), QRect(1280, 0, 1280, 1024)); | 240 | QCOMPARE(screens()->geometry(1), QRect(1280, 0, 1280, 1024)); | ||
241 | waylandServer()->initWorkspace(); | 241 | waylandServer()->initWorkspace(); | ||
242 | } | 242 | } | ||
▲ Show 20 Lines • Show All 156 Lines • ▼ Show 20 Line(s) | 336 | { | |||
399 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 399 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
400 | QVERIFY(client); | 400 | QVERIFY(client); | ||
401 | QVERIFY(client->isActive()); | 401 | QVERIFY(client->isActive()); | ||
402 | QVERIFY(client->isMovable()); | 402 | QVERIFY(client->isMovable()); | ||
403 | QVERIFY(client->isMovableAcrossScreens()); | 403 | QVERIFY(client->isMovableAcrossScreens()); | ||
404 | QCOMPARE(client->pos(), QPoint(42, 42)); | 404 | QCOMPARE(client->pos(), QPoint(42, 42)); | ||
405 | 405 | | |||
406 | // Destroy the client. | 406 | // Destroy the client. | ||
407 | delete shellSurface; | 407 | delete shellSurface; | ||
Lint: doubleFree: Memory pointed to by 'shellSurface' is freed twice. | |||||
408 | delete surface; | 408 | delete surface; | ||
Lint: doubleFree: Memory pointed to by 'surface' is freed twice. | |||||
409 | QVERIFY(Test::waitForWindowDestroyed(client)); | 409 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
410 | } | 410 | } | ||
411 | 411 | | |||
412 | TEST_DATA(testPositionRemember) | 412 | TEST_DATA(testPositionRemember) | ||
413 | 413 | | |||
414 | void TestShellClientRules::testPositionRemember() | 414 | void TestShellClientRules::testPositionRemember() | ||
415 | { | 415 | { | ||
416 | // Initialize RuleBook with the test rule. | 416 | // Initialize RuleBook with the test rule. | ||
▲ Show 20 Lines • Show All 61 Lines • ▼ Show 20 Line(s) | |||||
478 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 478 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
479 | QVERIFY(client); | 479 | QVERIFY(client); | ||
480 | QVERIFY(client->isActive()); | 480 | QVERIFY(client->isActive()); | ||
481 | QVERIFY(client->isMovable()); | 481 | QVERIFY(client->isMovable()); | ||
482 | QVERIFY(client->isMovableAcrossScreens()); | 482 | QVERIFY(client->isMovableAcrossScreens()); | ||
483 | QCOMPARE(client->pos(), QPoint(50, 42)); | 483 | QCOMPARE(client->pos(), QPoint(50, 42)); | ||
484 | 484 | | |||
485 | // Destroy the client. | 485 | // Destroy the client. | ||
486 | delete shellSurface; | 486 | delete shellSurface; | ||
Lint: doubleFree: Memory pointed to by 'shellSurface' is freed twice. | |||||
487 | delete surface; | 487 | delete surface; | ||
Lint: doubleFree: Memory pointed to by 'surface' is freed twice. | |||||
488 | QVERIFY(Test::waitForWindowDestroyed(client)); | 488 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
489 | } | 489 | } | ||
490 | 490 | | |||
491 | TEST_DATA(testPositionForce) | 491 | TEST_DATA(testPositionForce) | ||
492 | 492 | | |||
493 | void TestShellClientRules::testPositionForce() | 493 | void TestShellClientRules::testPositionForce() | ||
494 | { | 494 | { | ||
495 | // Initialize RuleBook with the test rule. | 495 | // Initialize RuleBook with the test rule. | ||
▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Line(s) | |||||
538 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 538 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
539 | QVERIFY(client); | 539 | QVERIFY(client); | ||
540 | QVERIFY(client->isActive()); | 540 | QVERIFY(client->isActive()); | ||
541 | QVERIFY(!client->isMovable()); | 541 | QVERIFY(!client->isMovable()); | ||
542 | QVERIFY(!client->isMovableAcrossScreens()); | 542 | QVERIFY(!client->isMovableAcrossScreens()); | ||
543 | QCOMPARE(client->pos(), QPoint(42, 42)); | 543 | QCOMPARE(client->pos(), QPoint(42, 42)); | ||
544 | 544 | | |||
545 | // Destroy the client. | 545 | // Destroy the client. | ||
546 | delete shellSurface; | 546 | delete shellSurface; | ||
Lint: doubleFree: Memory pointed to by 'shellSurface' is freed twice. | |||||
547 | delete surface; | 547 | delete surface; | ||
Lint: doubleFree: Memory pointed to by 'surface' is freed twice. | |||||
548 | QVERIFY(Test::waitForWindowDestroyed(client)); | 548 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
549 | } | 549 | } | ||
550 | 550 | | |||
551 | TEST_DATA(testPositionApplyNow) | 551 | TEST_DATA(testPositionApplyNow) | ||
552 | 552 | | |||
553 | void TestShellClientRules::testPositionApplyNow() | 553 | void TestShellClientRules::testPositionApplyNow() | ||
554 | { | 554 | { | ||
555 | // Create the test client. | 555 | // Create the test client. | ||
▲ Show 20 Lines • Show All 123 Lines • ▼ Show 20 Line(s) | 635 | { | |||
679 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 679 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
680 | QVERIFY(client); | 680 | QVERIFY(client); | ||
681 | QVERIFY(client->isActive()); | 681 | QVERIFY(client->isActive()); | ||
682 | QVERIFY(client->isMovable()); | 682 | QVERIFY(client->isMovable()); | ||
683 | QVERIFY(client->isMovableAcrossScreens()); | 683 | QVERIFY(client->isMovableAcrossScreens()); | ||
684 | QCOMPARE(client->pos(), QPoint(0, 0)); | 684 | QCOMPARE(client->pos(), QPoint(0, 0)); | ||
685 | 685 | | |||
686 | // Destroy the client. | 686 | // Destroy the client. | ||
687 | delete shellSurface; | 687 | delete shellSurface; | ||
Lint: doubleFree: Memory pointed to by 'shellSurface' is freed twice. | |||||
688 | delete surface; | 688 | delete surface; | ||
Lint: doubleFree: Memory pointed to by 'surface' is freed twice. | |||||
689 | QVERIFY(Test::waitForWindowDestroyed(client)); | 689 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
690 | } | 690 | } | ||
691 | 691 | | |||
692 | TEST_DATA(testSizeDontAffect) | 692 | TEST_DATA(testSizeDontAffect) | ||
693 | 693 | | |||
694 | void TestShellClientRules::testSizeDontAffect() | 694 | void TestShellClientRules::testSizeDontAffect() | ||
695 | { | 695 | { | ||
696 | // Initialize RuleBook with the test rule. | 696 | // Initialize RuleBook with the test rule. | ||
▲ Show 20 Lines • Show All 1249 Lines • ▼ Show 20 Line(s) | 1905 | { | |||
1946 | VirtualDesktopManager::self()->setCurrent(1); | 1946 | VirtualDesktopManager::self()->setCurrent(1); | ||
1947 | QCOMPARE(VirtualDesktopManager::self()->current(), 1); | 1947 | QCOMPARE(VirtualDesktopManager::self()->current(), 1); | ||
1948 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 1948 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
1949 | QVERIFY(client); | 1949 | QVERIFY(client); | ||
1950 | QCOMPARE(client->desktop(), 2); | 1950 | QCOMPARE(client->desktop(), 2); | ||
1951 | QCOMPARE(VirtualDesktopManager::self()->current(), 2); | 1951 | QCOMPARE(VirtualDesktopManager::self()->current(), 2); | ||
1952 | 1952 | | |||
1953 | // Destroy the client. | 1953 | // Destroy the client. | ||
1954 | delete shellSurface; | 1954 | delete shellSurface; | ||
Lint: doubleFree: Memory pointed to by 'shellSurface' is freed twice. | |||||
1955 | delete surface; | 1955 | delete surface; | ||
Lint: doubleFree: Memory pointed to by 'surface' is freed twice. | |||||
1956 | QVERIFY(Test::waitForWindowDestroyed(client)); | 1956 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
1957 | } | 1957 | } | ||
1958 | 1958 | | |||
1959 | TEST_DATA(testDesktopRemember) | 1959 | TEST_DATA(testDesktopRemember) | ||
1960 | 1960 | | |||
1961 | void TestShellClientRules::testDesktopRemember() | 1961 | void TestShellClientRules::testDesktopRemember() | ||
1962 | { | 1962 | { | ||
1963 | // Initialize RuleBook with the test rule. | 1963 | // Initialize RuleBook with the test rule. | ||
Show All 35 Lines | |||||
1999 | delete surface; | 1999 | delete surface; | ||
2000 | QVERIFY(Test::waitForWindowDestroyed(client)); | 2000 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
2001 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 2001 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
2002 | QVERIFY(client); | 2002 | QVERIFY(client); | ||
2003 | QCOMPARE(client->desktop(), 1); | 2003 | QCOMPARE(client->desktop(), 1); | ||
2004 | QCOMPARE(VirtualDesktopManager::self()->current(), 1); | 2004 | QCOMPARE(VirtualDesktopManager::self()->current(), 1); | ||
2005 | 2005 | | |||
2006 | // Destroy the client. | 2006 | // Destroy the client. | ||
2007 | delete shellSurface; | 2007 | delete shellSurface; | ||
Lint: doubleFree: Memory pointed to by 'shellSurface' is freed twice. | |||||
2008 | delete surface; | 2008 | delete surface; | ||
Lint: doubleFree: Memory pointed to by 'surface' is freed twice. | |||||
2009 | QVERIFY(Test::waitForWindowDestroyed(client)); | 2009 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
2010 | } | 2010 | } | ||
2011 | 2011 | | |||
2012 | TEST_DATA(testDesktopForce) | 2012 | TEST_DATA(testDesktopForce) | ||
2013 | 2013 | | |||
2014 | void TestShellClientRules::testDesktopForce() | 2014 | void TestShellClientRules::testDesktopForce() | ||
2015 | { | 2015 | { | ||
2016 | // Initialize RuleBook with the test rule. | 2016 | // Initialize RuleBook with the test rule. | ||
Show All 39 Lines | |||||
2056 | VirtualDesktopManager::self()->setCurrent(1); | 2056 | VirtualDesktopManager::self()->setCurrent(1); | ||
2057 | QCOMPARE(VirtualDesktopManager::self()->current(), 1); | 2057 | QCOMPARE(VirtualDesktopManager::self()->current(), 1); | ||
2058 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 2058 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
2059 | QVERIFY(client); | 2059 | QVERIFY(client); | ||
2060 | QCOMPARE(client->desktop(), 2); | 2060 | QCOMPARE(client->desktop(), 2); | ||
2061 | QCOMPARE(VirtualDesktopManager::self()->current(), 2); | 2061 | QCOMPARE(VirtualDesktopManager::self()->current(), 2); | ||
2062 | 2062 | | |||
2063 | // Destroy the client. | 2063 | // Destroy the client. | ||
2064 | delete shellSurface; | 2064 | delete shellSurface; | ||
Lint: doubleFree: Memory pointed to by 'shellSurface' is freed twice. | |||||
2065 | delete surface; | 2065 | delete surface; | ||
Lint: doubleFree: Memory pointed to by 'surface' is freed twice. | |||||
2066 | QVERIFY(Test::waitForWindowDestroyed(client)); | 2066 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
2067 | } | 2067 | } | ||
2068 | 2068 | | |||
2069 | TEST_DATA(testDesktopApplyNow) | 2069 | TEST_DATA(testDesktopApplyNow) | ||
2070 | 2070 | | |||
2071 | void TestShellClientRules::testDesktopApplyNow() | 2071 | void TestShellClientRules::testDesktopApplyNow() | ||
2072 | { | 2072 | { | ||
2073 | // We need at least two virtual desktop for this test. | 2073 | // We need at least two virtual desktop for this test. | ||
▲ Show 20 Lines • Show All 100 Lines • ▼ Show 20 Line(s) | 2125 | { | |||
2174 | workspace()->sendClientToDesktop(client, 2, true); | 2174 | workspace()->sendClientToDesktop(client, 2, true); | ||
2175 | QCOMPARE(client->desktop(), 2); | 2175 | QCOMPARE(client->desktop(), 2); | ||
2176 | QCOMPARE(VirtualDesktopManager::self()->current(), 1); | 2176 | QCOMPARE(VirtualDesktopManager::self()->current(), 1); | ||
2177 | workspace()->sendClientToDesktop(client, 1, true); | 2177 | workspace()->sendClientToDesktop(client, 1, true); | ||
2178 | QCOMPARE(client->desktop(), 1); | 2178 | QCOMPARE(client->desktop(), 1); | ||
2179 | QCOMPARE(VirtualDesktopManager::self()->current(), 1); | 2179 | QCOMPARE(VirtualDesktopManager::self()->current(), 1); | ||
2180 | 2180 | | |||
2181 | // Destroy the client. | 2181 | // Destroy the client. | ||
2182 | delete shellSurface; | 2182 | delete shellSurface; | ||
Lint: doubleFree: Memory pointed to by 'shellSurface' is freed twice. | |||||
2183 | delete surface; | 2183 | delete surface; | ||
Lint: doubleFree: Memory pointed to by 'surface' is freed twice. | |||||
2184 | QVERIFY(Test::waitForWindowDestroyed(client)); | 2184 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
2185 | } | 2185 | } | ||
2186 | 2186 | | |||
2187 | TEST_DATA(testMinimizeDontAffect) | 2187 | TEST_DATA(testMinimizeDontAffect) | ||
2188 | 2188 | | |||
2189 | void TestShellClientRules::testMinimizeDontAffect() | 2189 | void TestShellClientRules::testMinimizeDontAffect() | ||
2190 | { | 2190 | { | ||
2191 | // Initialize RuleBook with the test rule. | 2191 | // Initialize RuleBook with the test rule. | ||
▲ Show 20 Lines • Show All 65 Lines • ▼ Show 20 Line(s) | 2225 | { | |||
2257 | delete surface; | 2257 | delete surface; | ||
2258 | QVERIFY(Test::waitForWindowDestroyed(client)); | 2258 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
2259 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 2259 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
2260 | QVERIFY(client); | 2260 | QVERIFY(client); | ||
2261 | QVERIFY(client->isMinimizable()); | 2261 | QVERIFY(client->isMinimizable()); | ||
2262 | QVERIFY(client->isMinimized()); | 2262 | QVERIFY(client->isMinimized()); | ||
2263 | 2263 | | |||
2264 | // Destroy the client. | 2264 | // Destroy the client. | ||
2265 | delete shellSurface; | 2265 | delete shellSurface; | ||
Lint: doubleFree: Memory pointed to by 'shellSurface' is freed twice. | |||||
2266 | delete surface; | 2266 | delete surface; | ||
Lint: doubleFree: Memory pointed to by 'surface' is freed twice. | |||||
2267 | QVERIFY(Test::waitForWindowDestroyed(client)); | 2267 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
2268 | } | 2268 | } | ||
2269 | 2269 | | |||
2270 | TEST_DATA(testMinimizeRemember) | 2270 | TEST_DATA(testMinimizeRemember) | ||
2271 | 2271 | | |||
2272 | void TestShellClientRules::testMinimizeRemember() | 2272 | void TestShellClientRules::testMinimizeRemember() | ||
2273 | { | 2273 | { | ||
2274 | // Initialize RuleBook with the test rule. | 2274 | // Initialize RuleBook with the test rule. | ||
Show All 28 Lines | |||||
2303 | delete surface; | 2303 | delete surface; | ||
2304 | QVERIFY(Test::waitForWindowDestroyed(client)); | 2304 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
2305 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 2305 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
2306 | QVERIFY(client); | 2306 | QVERIFY(client); | ||
2307 | QVERIFY(client->isMinimizable()); | 2307 | QVERIFY(client->isMinimizable()); | ||
2308 | QVERIFY(client->isMinimized()); | 2308 | QVERIFY(client->isMinimized()); | ||
2309 | 2309 | | |||
2310 | // Destroy the client. | 2310 | // Destroy the client. | ||
2311 | delete shellSurface; | 2311 | delete shellSurface; | ||
Lint: doubleFree: Memory pointed to by 'shellSurface' is freed twice. | |||||
2312 | delete surface; | 2312 | delete surface; | ||
Lint: doubleFree: Memory pointed to by 'surface' is freed twice. | |||||
2313 | QVERIFY(Test::waitForWindowDestroyed(client)); | 2313 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
2314 | } | 2314 | } | ||
2315 | 2315 | | |||
2316 | TEST_DATA(testMinimizeForce) | 2316 | TEST_DATA(testMinimizeForce) | ||
2317 | 2317 | | |||
2318 | void TestShellClientRules::testMinimizeForce() | 2318 | void TestShellClientRules::testMinimizeForce() | ||
2319 | { | 2319 | { | ||
2320 | // Initialize RuleBook with the test rule. | 2320 | // Initialize RuleBook with the test rule. | ||
Show All 30 Lines | |||||
2351 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 2351 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
2352 | QVERIFY(client); | 2352 | QVERIFY(client); | ||
2353 | QVERIFY(!client->isMinimizable()); | 2353 | QVERIFY(!client->isMinimizable()); | ||
2354 | QVERIFY(!client->isMinimized()); | 2354 | QVERIFY(!client->isMinimized()); | ||
2355 | client->minimize(); | 2355 | client->minimize(); | ||
2356 | QVERIFY(!client->isMinimized()); | 2356 | QVERIFY(!client->isMinimized()); | ||
2357 | 2357 | | |||
2358 | // Destroy the client. | 2358 | // Destroy the client. | ||
2359 | delete shellSurface; | 2359 | delete shellSurface; | ||
Lint: doubleFree: Memory pointed to by 'shellSurface' is freed twice. | |||||
2360 | delete surface; | 2360 | delete surface; | ||
Lint: doubleFree: Memory pointed to by 'surface' is freed twice. | |||||
2361 | QVERIFY(Test::waitForWindowDestroyed(client)); | 2361 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
2362 | } | 2362 | } | ||
2363 | 2363 | | |||
2364 | TEST_DATA(testMinimizeApplyNow) | 2364 | TEST_DATA(testMinimizeApplyNow) | ||
2365 | 2365 | | |||
2366 | void TestShellClientRules::testMinimizeApplyNow() | 2366 | void TestShellClientRules::testMinimizeApplyNow() | ||
2367 | { | 2367 | { | ||
2368 | // Create the test client. | 2368 | // Create the test client. | ||
▲ Show 20 Lines • Show All 76 Lines • ▼ Show 20 Line(s) | 2413 | { | |||
2445 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 2445 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
2446 | QVERIFY(client); | 2446 | QVERIFY(client); | ||
2447 | QVERIFY(client->isMinimizable()); | 2447 | QVERIFY(client->isMinimizable()); | ||
2448 | QVERIFY(!client->isMinimized()); | 2448 | QVERIFY(!client->isMinimized()); | ||
2449 | client->minimize(); | 2449 | client->minimize(); | ||
2450 | QVERIFY(client->isMinimized()); | 2450 | QVERIFY(client->isMinimized()); | ||
2451 | 2451 | | |||
2452 | // Destroy the client. | 2452 | // Destroy the client. | ||
2453 | delete shellSurface; | 2453 | delete shellSurface; | ||
Lint: doubleFree: Memory pointed to by 'shellSurface' is freed twice. | |||||
2454 | delete surface; | 2454 | delete surface; | ||
Lint: doubleFree: Memory pointed to by 'surface' is freed twice. | |||||
2455 | QVERIFY(Test::waitForWindowDestroyed(client)); | 2455 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
2456 | } | 2456 | } | ||
2457 | 2457 | | |||
2458 | TEST_DATA(testSkipTaskbarDontAffect) | 2458 | TEST_DATA(testSkipTaskbarDontAffect) | ||
2459 | 2459 | | |||
2460 | void TestShellClientRules::testSkipTaskbarDontAffect() | 2460 | void TestShellClientRules::testSkipTaskbarDontAffect() | ||
2461 | { | 2461 | { | ||
2462 | // Initialize RuleBook with the test rule. | 2462 | // Initialize RuleBook with the test rule. | ||
▲ Show 20 Lines • Show All 62 Lines • ▼ Show 20 Line(s) | 2495 | { | |||
2525 | delete shellSurface; | 2525 | delete shellSurface; | ||
2526 | delete surface; | 2526 | delete surface; | ||
2527 | QVERIFY(Test::waitForWindowDestroyed(client)); | 2527 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
2528 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 2528 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
2529 | QVERIFY(client); | 2529 | QVERIFY(client); | ||
2530 | QVERIFY(client->skipTaskbar()); | 2530 | QVERIFY(client->skipTaskbar()); | ||
2531 | 2531 | | |||
2532 | // Destroy the client. | 2532 | // Destroy the client. | ||
2533 | delete shellSurface; | 2533 | delete shellSurface; | ||
Lint: doubleFree: Memory pointed to by 'shellSurface' is freed twice. | |||||
2534 | delete surface; | 2534 | delete surface; | ||
Lint: doubleFree: Memory pointed to by 'surface' is freed twice. | |||||
2535 | QVERIFY(Test::waitForWindowDestroyed(client)); | 2535 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
2536 | } | 2536 | } | ||
2537 | 2537 | | |||
2538 | TEST_DATA(testSkipTaskbarRemember) | 2538 | TEST_DATA(testSkipTaskbarRemember) | ||
2539 | 2539 | | |||
2540 | void TestShellClientRules::testSkipTaskbarRemember() | 2540 | void TestShellClientRules::testSkipTaskbarRemember() | ||
2541 | { | 2541 | { | ||
2542 | // Initialize RuleBook with the test rule. | 2542 | // Initialize RuleBook with the test rule. | ||
Show All 30 Lines | |||||
2573 | QVERIFY(Test::waitForWindowDestroyed(client)); | 2573 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
2574 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 2574 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
2575 | QVERIFY(client); | 2575 | QVERIFY(client); | ||
2576 | 2576 | | |||
2577 | // The client should be included on a taskbar. | 2577 | // The client should be included on a taskbar. | ||
2578 | QVERIFY(!client->skipTaskbar()); | 2578 | QVERIFY(!client->skipTaskbar()); | ||
2579 | 2579 | | |||
2580 | // Destroy the client. | 2580 | // Destroy the client. | ||
2581 | delete shellSurface; | 2581 | delete shellSurface; | ||
Lint: doubleFree: Memory pointed to by 'shellSurface' is freed twice. | |||||
2582 | delete surface; | 2582 | delete surface; | ||
Lint: doubleFree: Memory pointed to by 'surface' is freed twice. | |||||
2583 | QVERIFY(Test::waitForWindowDestroyed(client)); | 2583 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
2584 | } | 2584 | } | ||
2585 | 2585 | | |||
2586 | TEST_DATA(testSkipTaskbarForce) | 2586 | TEST_DATA(testSkipTaskbarForce) | ||
2587 | 2587 | | |||
2588 | void TestShellClientRules::testSkipTaskbarForce() | 2588 | void TestShellClientRules::testSkipTaskbarForce() | ||
2589 | { | 2589 | { | ||
2590 | // Initialize RuleBook with the test rule. | 2590 | // Initialize RuleBook with the test rule. | ||
Show All 30 Lines | |||||
2621 | QVERIFY(Test::waitForWindowDestroyed(client)); | 2621 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
2622 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 2622 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
2623 | QVERIFY(client); | 2623 | QVERIFY(client); | ||
2624 | 2624 | | |||
2625 | // The skip-taskbar state should be still forced. | 2625 | // The skip-taskbar state should be still forced. | ||
2626 | QVERIFY(client->skipTaskbar()); | 2626 | QVERIFY(client->skipTaskbar()); | ||
2627 | 2627 | | |||
2628 | // Destroy the client. | 2628 | // Destroy the client. | ||
2629 | delete shellSurface; | 2629 | delete shellSurface; | ||
Lint: doubleFree: Memory pointed to by 'shellSurface' is freed twice. | |||||
2630 | delete surface; | 2630 | delete surface; | ||
Lint: doubleFree: Memory pointed to by 'surface' is freed twice. | |||||
2631 | QVERIFY(Test::waitForWindowDestroyed(client)); | 2631 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
2632 | } | 2632 | } | ||
2633 | 2633 | | |||
2634 | TEST_DATA(testSkipTaskbarApplyNow) | 2634 | TEST_DATA(testSkipTaskbarApplyNow) | ||
2635 | 2635 | | |||
2636 | void TestShellClientRules::testSkipTaskbarApplyNow() | 2636 | void TestShellClientRules::testSkipTaskbarApplyNow() | ||
2637 | { | 2637 | { | ||
2638 | // Create the test client. | 2638 | // Create the test client. | ||
▲ Show 20 Lines • Show All 75 Lines • ▼ Show 20 Line(s) | 2680 | { | |||
2714 | QVERIFY(client); | 2714 | QVERIFY(client); | ||
2715 | QVERIFY(!client->skipTaskbar()); | 2715 | QVERIFY(!client->skipTaskbar()); | ||
2716 | 2716 | | |||
2717 | // The skip-taskbar state is no longer forced. | 2717 | // The skip-taskbar state is no longer forced. | ||
2718 | client->setOriginalSkipTaskbar(true); | 2718 | client->setOriginalSkipTaskbar(true); | ||
2719 | QVERIFY(client->skipTaskbar()); | 2719 | QVERIFY(client->skipTaskbar()); | ||
2720 | 2720 | | |||
2721 | // Destroy the client. | 2721 | // Destroy the client. | ||
2722 | delete shellSurface; | 2722 | delete shellSurface; | ||
Lint: doubleFree: Memory pointed to by 'shellSurface' is freed twice. | |||||
2723 | delete surface; | 2723 | delete surface; | ||
Lint: doubleFree: Memory pointed to by 'surface' is freed twice. | |||||
2724 | QVERIFY(Test::waitForWindowDestroyed(client)); | 2724 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
2725 | } | 2725 | } | ||
2726 | 2726 | | |||
2727 | TEST_DATA(testSkipPagerDontAffect) | 2727 | TEST_DATA(testSkipPagerDontAffect) | ||
2728 | 2728 | | |||
2729 | void TestShellClientRules::testSkipPagerDontAffect() | 2729 | void TestShellClientRules::testSkipPagerDontAffect() | ||
2730 | { | 2730 | { | ||
2731 | // Initialize RuleBook with the test rule. | 2731 | // Initialize RuleBook with the test rule. | ||
▲ Show 20 Lines • Show All 62 Lines • ▼ Show 20 Line(s) | 2764 | { | |||
2794 | delete shellSurface; | 2794 | delete shellSurface; | ||
2795 | delete surface; | 2795 | delete surface; | ||
2796 | QVERIFY(Test::waitForWindowDestroyed(client)); | 2796 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
2797 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 2797 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
2798 | QVERIFY(client); | 2798 | QVERIFY(client); | ||
2799 | QVERIFY(client->skipPager()); | 2799 | QVERIFY(client->skipPager()); | ||
2800 | 2800 | | |||
2801 | // Destroy the client. | 2801 | // Destroy the client. | ||
2802 | delete shellSurface; | 2802 | delete shellSurface; | ||
Lint: doubleFree: Memory pointed to by 'shellSurface' is freed twice. | |||||
2803 | delete surface; | 2803 | delete surface; | ||
Lint: doubleFree: Memory pointed to by 'surface' is freed twice. | |||||
2804 | QVERIFY(Test::waitForWindowDestroyed(client)); | 2804 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
2805 | } | 2805 | } | ||
2806 | 2806 | | |||
2807 | TEST_DATA(testSkipPagerRemember) | 2807 | TEST_DATA(testSkipPagerRemember) | ||
2808 | 2808 | | |||
2809 | void TestShellClientRules::testSkipPagerRemember() | 2809 | void TestShellClientRules::testSkipPagerRemember() | ||
2810 | { | 2810 | { | ||
2811 | // Initialize RuleBook with the test rule. | 2811 | // Initialize RuleBook with the test rule. | ||
Show All 30 Lines | |||||
2842 | QVERIFY(Test::waitForWindowDestroyed(client)); | 2842 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
2843 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 2843 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
2844 | QVERIFY(client); | 2844 | QVERIFY(client); | ||
2845 | 2845 | | |||
2846 | // The client should be included on a pager. | 2846 | // The client should be included on a pager. | ||
2847 | QVERIFY(!client->skipPager()); | 2847 | QVERIFY(!client->skipPager()); | ||
2848 | 2848 | | |||
2849 | // Destroy the client. | 2849 | // Destroy the client. | ||
2850 | delete shellSurface; | 2850 | delete shellSurface; | ||
Lint: doubleFree: Memory pointed to by 'shellSurface' is freed twice. | |||||
2851 | delete surface; | 2851 | delete surface; | ||
Lint: doubleFree: Memory pointed to by 'surface' is freed twice. | |||||
2852 | QVERIFY(Test::waitForWindowDestroyed(client)); | 2852 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
2853 | } | 2853 | } | ||
2854 | 2854 | | |||
2855 | TEST_DATA(testSkipPagerForce) | 2855 | TEST_DATA(testSkipPagerForce) | ||
2856 | 2856 | | |||
2857 | void TestShellClientRules::testSkipPagerForce() | 2857 | void TestShellClientRules::testSkipPagerForce() | ||
2858 | { | 2858 | { | ||
2859 | // Initialize RuleBook with the test rule. | 2859 | // Initialize RuleBook with the test rule. | ||
Show All 30 Lines | |||||
2890 | QVERIFY(Test::waitForWindowDestroyed(client)); | 2890 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
2891 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 2891 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
2892 | QVERIFY(client); | 2892 | QVERIFY(client); | ||
2893 | 2893 | | |||
2894 | // The skip-pager state should be still forced. | 2894 | // The skip-pager state should be still forced. | ||
2895 | QVERIFY(client->skipPager()); | 2895 | QVERIFY(client->skipPager()); | ||
2896 | 2896 | | |||
2897 | // Destroy the client. | 2897 | // Destroy the client. | ||
2898 | delete shellSurface; | 2898 | delete shellSurface; | ||
Lint: doubleFree: Memory pointed to by 'shellSurface' is freed twice. | |||||
2899 | delete surface; | 2899 | delete surface; | ||
Lint: doubleFree: Memory pointed to by 'surface' is freed twice. | |||||
2900 | QVERIFY(Test::waitForWindowDestroyed(client)); | 2900 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
2901 | } | 2901 | } | ||
2902 | 2902 | | |||
2903 | TEST_DATA(testSkipPagerApplyNow) | 2903 | TEST_DATA(testSkipPagerApplyNow) | ||
2904 | 2904 | | |||
2905 | void TestShellClientRules::testSkipPagerApplyNow() | 2905 | void TestShellClientRules::testSkipPagerApplyNow() | ||
2906 | { | 2906 | { | ||
2907 | // Create the test client. | 2907 | // Create the test client. | ||
▲ Show 20 Lines • Show All 75 Lines • ▼ Show 20 Line(s) | 2949 | { | |||
2983 | QVERIFY(client); | 2983 | QVERIFY(client); | ||
2984 | QVERIFY(!client->skipPager()); | 2984 | QVERIFY(!client->skipPager()); | ||
2985 | 2985 | | |||
2986 | // The skip-pager state is no longer forced. | 2986 | // The skip-pager state is no longer forced. | ||
2987 | client->setSkipPager(true); | 2987 | client->setSkipPager(true); | ||
2988 | QVERIFY(client->skipPager()); | 2988 | QVERIFY(client->skipPager()); | ||
2989 | 2989 | | |||
2990 | // Destroy the client. | 2990 | // Destroy the client. | ||
2991 | delete shellSurface; | 2991 | delete shellSurface; | ||
Lint: doubleFree: Memory pointed to by 'shellSurface' is freed twice. | |||||
2992 | delete surface; | 2992 | delete surface; | ||
Lint: doubleFree: Memory pointed to by 'surface' is freed twice. | |||||
2993 | QVERIFY(Test::waitForWindowDestroyed(client)); | 2993 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
2994 | } | 2994 | } | ||
2995 | 2995 | | |||
2996 | TEST_DATA(testSkipSwitcherDontAffect) | 2996 | TEST_DATA(testSkipSwitcherDontAffect) | ||
2997 | 2997 | | |||
2998 | void TestShellClientRules::testSkipSwitcherDontAffect() | 2998 | void TestShellClientRules::testSkipSwitcherDontAffect() | ||
2999 | { | 2999 | { | ||
3000 | // Initialize RuleBook with the test rule. | 3000 | // Initialize RuleBook with the test rule. | ||
▲ Show 20 Lines • Show All 62 Lines • ▼ Show 20 Line(s) | 3033 | { | |||
3063 | delete shellSurface; | 3063 | delete shellSurface; | ||
3064 | delete surface; | 3064 | delete surface; | ||
3065 | QVERIFY(Test::waitForWindowDestroyed(client)); | 3065 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
3066 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 3066 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
3067 | QVERIFY(client); | 3067 | QVERIFY(client); | ||
3068 | QVERIFY(client->skipSwitcher()); | 3068 | QVERIFY(client->skipSwitcher()); | ||
3069 | 3069 | | |||
3070 | // Destroy the client. | 3070 | // Destroy the client. | ||
3071 | delete shellSurface; | 3071 | delete shellSurface; | ||
Lint: doubleFree: Memory pointed to by 'shellSurface' is freed twice. | |||||
3072 | delete surface; | 3072 | delete surface; | ||
Lint: doubleFree: Memory pointed to by 'surface' is freed twice. | |||||
3073 | QVERIFY(Test::waitForWindowDestroyed(client)); | 3073 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
3074 | } | 3074 | } | ||
3075 | 3075 | | |||
3076 | TEST_DATA(testSkipSwitcherRemember) | 3076 | TEST_DATA(testSkipSwitcherRemember) | ||
3077 | 3077 | | |||
3078 | void TestShellClientRules::testSkipSwitcherRemember() | 3078 | void TestShellClientRules::testSkipSwitcherRemember() | ||
3079 | { | 3079 | { | ||
3080 | // Initialize RuleBook with the test rule. | 3080 | // Initialize RuleBook with the test rule. | ||
Show All 30 Lines | |||||
3111 | QVERIFY(Test::waitForWindowDestroyed(client)); | 3111 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
3112 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 3112 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
3113 | QVERIFY(client); | 3113 | QVERIFY(client); | ||
3114 | 3114 | | |||
3115 | // The client should be included in window switching effects. | 3115 | // The client should be included in window switching effects. | ||
3116 | QVERIFY(!client->skipSwitcher()); | 3116 | QVERIFY(!client->skipSwitcher()); | ||
3117 | 3117 | | |||
3118 | // Destroy the client. | 3118 | // Destroy the client. | ||
3119 | delete shellSurface; | 3119 | delete shellSurface; | ||
Lint: doubleFree: Memory pointed to by 'shellSurface' is freed twice. | |||||
3120 | delete surface; | 3120 | delete surface; | ||
Lint: doubleFree: Memory pointed to by 'surface' is freed twice. | |||||
3121 | QVERIFY(Test::waitForWindowDestroyed(client)); | 3121 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
3122 | } | 3122 | } | ||
3123 | 3123 | | |||
3124 | TEST_DATA(testSkipSwitcherForce) | 3124 | TEST_DATA(testSkipSwitcherForce) | ||
3125 | 3125 | | |||
3126 | void TestShellClientRules::testSkipSwitcherForce() | 3126 | void TestShellClientRules::testSkipSwitcherForce() | ||
3127 | { | 3127 | { | ||
3128 | // Initialize RuleBook with the test rule. | 3128 | // Initialize RuleBook with the test rule. | ||
Show All 30 Lines | |||||
3159 | QVERIFY(Test::waitForWindowDestroyed(client)); | 3159 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
3160 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 3160 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
3161 | QVERIFY(client); | 3161 | QVERIFY(client); | ||
3162 | 3162 | | |||
3163 | // The skip-switcher state should be still forced. | 3163 | // The skip-switcher state should be still forced. | ||
3164 | QVERIFY(client->skipSwitcher()); | 3164 | QVERIFY(client->skipSwitcher()); | ||
3165 | 3165 | | |||
3166 | // Destroy the client. | 3166 | // Destroy the client. | ||
3167 | delete shellSurface; | 3167 | delete shellSurface; | ||
Lint: doubleFree: Memory pointed to by 'shellSurface' is freed twice. | |||||
3168 | delete surface; | 3168 | delete surface; | ||
Lint: doubleFree: Memory pointed to by 'surface' is freed twice. | |||||
3169 | QVERIFY(Test::waitForWindowDestroyed(client)); | 3169 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
3170 | } | 3170 | } | ||
3171 | 3171 | | |||
3172 | TEST_DATA(testSkipSwitcherApplyNow) | 3172 | TEST_DATA(testSkipSwitcherApplyNow) | ||
3173 | 3173 | | |||
3174 | void TestShellClientRules::testSkipSwitcherApplyNow() | 3174 | void TestShellClientRules::testSkipSwitcherApplyNow() | ||
3175 | { | 3175 | { | ||
3176 | // Create the test client. | 3176 | // Create the test client. | ||
▲ Show 20 Lines • Show All 75 Lines • ▼ Show 20 Line(s) | 3218 | { | |||
3252 | QVERIFY(client); | 3252 | QVERIFY(client); | ||
3253 | QVERIFY(!client->skipSwitcher()); | 3253 | QVERIFY(!client->skipSwitcher()); | ||
3254 | 3254 | | |||
3255 | // The skip-switcher state is no longer forced. | 3255 | // The skip-switcher state is no longer forced. | ||
3256 | client->setSkipSwitcher(true); | 3256 | client->setSkipSwitcher(true); | ||
3257 | QVERIFY(client->skipSwitcher()); | 3257 | QVERIFY(client->skipSwitcher()); | ||
3258 | 3258 | | |||
3259 | // Destroy the client. | 3259 | // Destroy the client. | ||
3260 | delete shellSurface; | 3260 | delete shellSurface; | ||
Lint: doubleFree: Memory pointed to by 'shellSurface' is freed twice. | |||||
3261 | delete surface; | 3261 | delete surface; | ||
Lint: doubleFree: Memory pointed to by 'surface' is freed twice. | |||||
3262 | QVERIFY(Test::waitForWindowDestroyed(client)); | 3262 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
3263 | } | 3263 | } | ||
3264 | 3264 | | |||
3265 | TEST_DATA(testKeepAboveDontAffect) | 3265 | TEST_DATA(testKeepAboveDontAffect) | ||
3266 | 3266 | | |||
3267 | void TestShellClientRules::testKeepAboveDontAffect() | 3267 | void TestShellClientRules::testKeepAboveDontAffect() | ||
3268 | { | 3268 | { | ||
3269 | // Initialize RuleBook with the test rule. | 3269 | // Initialize RuleBook with the test rule. | ||
▲ Show 20 Lines • Show All 62 Lines • ▼ Show 20 Line(s) | 3302 | { | |||
3332 | delete shellSurface; | 3332 | delete shellSurface; | ||
3333 | delete surface; | 3333 | delete surface; | ||
3334 | QVERIFY(Test::waitForWindowDestroyed(client)); | 3334 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
3335 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 3335 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
3336 | QVERIFY(client); | 3336 | QVERIFY(client); | ||
3337 | QVERIFY(client->keepAbove()); | 3337 | QVERIFY(client->keepAbove()); | ||
3338 | 3338 | | |||
3339 | // Destroy the client. | 3339 | // Destroy the client. | ||
3340 | delete shellSurface; | 3340 | delete shellSurface; | ||
Lint: doubleFree: Memory pointed to by 'shellSurface' is freed twice. | |||||
3341 | delete surface; | 3341 | delete surface; | ||
Lint: doubleFree: Memory pointed to by 'surface' is freed twice. | |||||
3342 | QVERIFY(Test::waitForWindowDestroyed(client)); | 3342 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
3343 | } | 3343 | } | ||
3344 | 3344 | | |||
3345 | TEST_DATA(testKeepAboveRemember) | 3345 | TEST_DATA(testKeepAboveRemember) | ||
3346 | 3346 | | |||
3347 | void TestShellClientRules::testKeepAboveRemember() | 3347 | void TestShellClientRules::testKeepAboveRemember() | ||
3348 | { | 3348 | { | ||
3349 | // Initialize RuleBook with the test rule. | 3349 | // Initialize RuleBook with the test rule. | ||
Show All 28 Lines | |||||
3378 | QVERIFY(Test::waitForWindowDestroyed(client)); | 3378 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
3379 | 3379 | | |||
3380 | // Re-open the client, it should not be kept above. | 3380 | // Re-open the client, it should not be kept above. | ||
3381 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 3381 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
3382 | QVERIFY(client); | 3382 | QVERIFY(client); | ||
3383 | QVERIFY(!client->keepAbove()); | 3383 | QVERIFY(!client->keepAbove()); | ||
3384 | 3384 | | |||
3385 | // Destroy the client. | 3385 | // Destroy the client. | ||
3386 | delete shellSurface; | 3386 | delete shellSurface; | ||
Lint: doubleFree: Memory pointed to by 'shellSurface' is freed twice. | |||||
3387 | delete surface; | 3387 | delete surface; | ||
Lint: doubleFree: Memory pointed to by 'surface' is freed twice. | |||||
3388 | QVERIFY(Test::waitForWindowDestroyed(client)); | 3388 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
3389 | } | 3389 | } | ||
3390 | 3390 | | |||
3391 | TEST_DATA(testKeepAboveForce) | 3391 | TEST_DATA(testKeepAboveForce) | ||
3392 | 3392 | | |||
3393 | void TestShellClientRules::testKeepAboveForce() | 3393 | void TestShellClientRules::testKeepAboveForce() | ||
3394 | { | 3394 | { | ||
3395 | // Initialize RuleBook with the test rule. | 3395 | // Initialize RuleBook with the test rule. | ||
Show All 28 Lines | |||||
3424 | delete shellSurface; | 3424 | delete shellSurface; | ||
3425 | delete surface; | 3425 | delete surface; | ||
3426 | QVERIFY(Test::waitForWindowDestroyed(client)); | 3426 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
3427 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 3427 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
3428 | QVERIFY(client); | 3428 | QVERIFY(client); | ||
3429 | QVERIFY(client->keepAbove()); | 3429 | QVERIFY(client->keepAbove()); | ||
3430 | 3430 | | |||
3431 | // Destroy the client. | 3431 | // Destroy the client. | ||
3432 | delete shellSurface; | 3432 | delete shellSurface; | ||
Lint: doubleFree: Memory pointed to by 'shellSurface' is freed twice. | |||||
3433 | delete surface; | 3433 | delete surface; | ||
Lint: doubleFree: Memory pointed to by 'surface' is freed twice. | |||||
3434 | QVERIFY(Test::waitForWindowDestroyed(client)); | 3434 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
3435 | } | 3435 | } | ||
3436 | 3436 | | |||
3437 | TEST_DATA(testKeepAboveApplyNow) | 3437 | TEST_DATA(testKeepAboveApplyNow) | ||
3438 | 3438 | | |||
3439 | void TestShellClientRules::testKeepAboveApplyNow() | 3439 | void TestShellClientRules::testKeepAboveApplyNow() | ||
3440 | { | 3440 | { | ||
3441 | // Create the test client. | 3441 | // Create the test client. | ||
▲ Show 20 Lines • Show All 77 Lines • ▼ Show 20 Line(s) | 3483 | { | |||
3519 | 3519 | | |||
3520 | // The keep-above state is no longer forced. | 3520 | // The keep-above state is no longer forced. | ||
3521 | client->setKeepAbove(true); | 3521 | client->setKeepAbove(true); | ||
3522 | QVERIFY(client->keepAbove()); | 3522 | QVERIFY(client->keepAbove()); | ||
3523 | client->setKeepAbove(false); | 3523 | client->setKeepAbove(false); | ||
3524 | QVERIFY(!client->keepAbove()); | 3524 | QVERIFY(!client->keepAbove()); | ||
3525 | 3525 | | |||
3526 | // Destroy the client. | 3526 | // Destroy the client. | ||
3527 | delete shellSurface; | 3527 | delete shellSurface; | ||
Lint: doubleFree: Memory pointed to by 'shellSurface' is freed twice. | |||||
3528 | delete surface; | 3528 | delete surface; | ||
Lint: doubleFree: Memory pointed to by 'surface' is freed twice. | |||||
3529 | QVERIFY(Test::waitForWindowDestroyed(client)); | 3529 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
3530 | } | 3530 | } | ||
3531 | 3531 | | |||
3532 | TEST_DATA(testKeepBelowDontAffect) | 3532 | TEST_DATA(testKeepBelowDontAffect) | ||
3533 | 3533 | | |||
3534 | void TestShellClientRules::testKeepBelowDontAffect() | 3534 | void TestShellClientRules::testKeepBelowDontAffect() | ||
3535 | { | 3535 | { | ||
3536 | // Initialize RuleBook with the test rule. | 3536 | // Initialize RuleBook with the test rule. | ||
▲ Show 20 Lines • Show All 62 Lines • ▼ Show 20 Line(s) | 3569 | { | |||
3599 | delete shellSurface; | 3599 | delete shellSurface; | ||
3600 | delete surface; | 3600 | delete surface; | ||
3601 | QVERIFY(Test::waitForWindowDestroyed(client)); | 3601 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
3602 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 3602 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
3603 | QVERIFY(client); | 3603 | QVERIFY(client); | ||
3604 | QVERIFY(client->keepBelow()); | 3604 | QVERIFY(client->keepBelow()); | ||
3605 | 3605 | | |||
3606 | // Destroy the client. | 3606 | // Destroy the client. | ||
3607 | delete shellSurface; | 3607 | delete shellSurface; | ||
Lint: doubleFree: Memory pointed to by 'shellSurface' is freed twice. | |||||
3608 | delete surface; | 3608 | delete surface; | ||
Lint: doubleFree: Memory pointed to by 'surface' is freed twice. | |||||
3609 | QVERIFY(Test::waitForWindowDestroyed(client)); | 3609 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
3610 | } | 3610 | } | ||
3611 | 3611 | | |||
3612 | TEST_DATA(testKeepBelowRemember) | 3612 | TEST_DATA(testKeepBelowRemember) | ||
3613 | 3613 | | |||
3614 | void TestShellClientRules::testKeepBelowRemember() | 3614 | void TestShellClientRules::testKeepBelowRemember() | ||
3615 | { | 3615 | { | ||
3616 | // Initialize RuleBook with the test rule. | 3616 | // Initialize RuleBook with the test rule. | ||
Show All 28 Lines | |||||
3645 | QVERIFY(Test::waitForWindowDestroyed(client)); | 3645 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
3646 | 3646 | | |||
3647 | // Re-open the client, it should not be kept below. | 3647 | // Re-open the client, it should not be kept below. | ||
3648 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 3648 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
3649 | QVERIFY(client); | 3649 | QVERIFY(client); | ||
3650 | QVERIFY(!client->keepBelow()); | 3650 | QVERIFY(!client->keepBelow()); | ||
3651 | 3651 | | |||
3652 | // Destroy the client. | 3652 | // Destroy the client. | ||
3653 | delete shellSurface; | 3653 | delete shellSurface; | ||
Lint: doubleFree: Memory pointed to by 'shellSurface' is freed twice. | |||||
3654 | delete surface; | 3654 | delete surface; | ||
Lint: doubleFree: Memory pointed to by 'surface' is freed twice. | |||||
3655 | QVERIFY(Test::waitForWindowDestroyed(client)); | 3655 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
3656 | } | 3656 | } | ||
3657 | 3657 | | |||
3658 | TEST_DATA(testKeepBelowForce) | 3658 | TEST_DATA(testKeepBelowForce) | ||
3659 | 3659 | | |||
3660 | void TestShellClientRules::testKeepBelowForce() | 3660 | void TestShellClientRules::testKeepBelowForce() | ||
3661 | { | 3661 | { | ||
3662 | // Initialize RuleBook with the test rule. | 3662 | // Initialize RuleBook with the test rule. | ||
Show All 28 Lines | |||||
3691 | delete shellSurface; | 3691 | delete shellSurface; | ||
3692 | delete surface; | 3692 | delete surface; | ||
3693 | QVERIFY(Test::waitForWindowDestroyed(client)); | 3693 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
3694 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 3694 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
3695 | QVERIFY(client); | 3695 | QVERIFY(client); | ||
3696 | QVERIFY(client->keepBelow()); | 3696 | QVERIFY(client->keepBelow()); | ||
3697 | 3697 | | |||
3698 | // Destroy the client. | 3698 | // Destroy the client. | ||
3699 | delete shellSurface; | 3699 | delete shellSurface; | ||
Lint: doubleFree: Memory pointed to by 'shellSurface' is freed twice. | |||||
3700 | delete surface; | 3700 | delete surface; | ||
Lint: doubleFree: Memory pointed to by 'surface' is freed twice. | |||||
3701 | QVERIFY(Test::waitForWindowDestroyed(client)); | 3701 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
3702 | } | 3702 | } | ||
3703 | 3703 | | |||
3704 | TEST_DATA(testKeepBelowApplyNow) | 3704 | TEST_DATA(testKeepBelowApplyNow) | ||
3705 | 3705 | | |||
3706 | void TestShellClientRules::testKeepBelowApplyNow() | 3706 | void TestShellClientRules::testKeepBelowApplyNow() | ||
3707 | { | 3707 | { | ||
3708 | // Create the test client. | 3708 | // Create the test client. | ||
▲ Show 20 Lines • Show All 77 Lines • ▼ Show 20 Line(s) | 3750 | { | |||
3786 | 3786 | | |||
3787 | // The keep-below state is no longer forced. | 3787 | // The keep-below state is no longer forced. | ||
3788 | client->setKeepBelow(true); | 3788 | client->setKeepBelow(true); | ||
3789 | QVERIFY(client->keepBelow()); | 3789 | QVERIFY(client->keepBelow()); | ||
3790 | client->setKeepBelow(false); | 3790 | client->setKeepBelow(false); | ||
3791 | QVERIFY(!client->keepBelow()); | 3791 | QVERIFY(!client->keepBelow()); | ||
3792 | 3792 | | |||
3793 | // Destroy the client. | 3793 | // Destroy the client. | ||
3794 | delete shellSurface; | 3794 | delete shellSurface; | ||
Lint: doubleFree: Memory pointed to by 'shellSurface' is freed twice. | |||||
3795 | delete surface; | 3795 | delete surface; | ||
Lint: doubleFree: Memory pointed to by 'surface' is freed twice. | |||||
3796 | QVERIFY(Test::waitForWindowDestroyed(client)); | 3796 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
3797 | } | 3797 | } | ||
3798 | 3798 | | |||
3799 | TEST_DATA(testShortcutDontAffect) | 3799 | TEST_DATA(testShortcutDontAffect) | ||
3800 | 3800 | | |||
3801 | void TestShellClientRules::testShortcutDontAffect() | 3801 | void TestShellClientRules::testShortcutDontAffect() | ||
3802 | { | 3802 | { | ||
3803 | // Initialize RuleBook with the test rule. | 3803 | // Initialize RuleBook with the test rule. | ||
▲ Show 20 Lines • Show All 112 Lines • ▼ Show 20 Line(s) | 3849 | { | |||
3916 | QVERIFY(Test::waitForWindowDestroyed(client)); | 3916 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
3917 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 3917 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
3918 | QVERIFY(client); | 3918 | QVERIFY(client); | ||
3919 | 3919 | | |||
3920 | // The window shortcut should be set back to Ctrl+Alt+1. | 3920 | // The window shortcut should be set back to Ctrl+Alt+1. | ||
3921 | QCOMPARE(client->shortcut(), (QKeySequence{Qt::CTRL + Qt::ALT + Qt::Key_1})); | 3921 | QCOMPARE(client->shortcut(), (QKeySequence{Qt::CTRL + Qt::ALT + Qt::Key_1})); | ||
3922 | 3922 | | |||
3923 | // Destroy the client. | 3923 | // Destroy the client. | ||
3924 | delete shellSurface; | 3924 | delete shellSurface; | ||
Lint: doubleFree: Memory pointed to by 'shellSurface' is freed twice. | |||||
3925 | delete surface; | 3925 | delete surface; | ||
Lint: doubleFree: Memory pointed to by 'surface' is freed twice. | |||||
3926 | QVERIFY(Test::waitForWindowDestroyed(client)); | 3926 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
3927 | } | 3927 | } | ||
3928 | 3928 | | |||
3929 | TEST_DATA(testShortcutRemember) | 3929 | TEST_DATA(testShortcutRemember) | ||
3930 | 3930 | | |||
3931 | void TestShellClientRules::testShortcutRemember() | 3931 | void TestShellClientRules::testShortcutRemember() | ||
3932 | { | 3932 | { | ||
3933 | QSKIP("KWin core doesn't try to save the last used window shortcut"); | 3933 | QSKIP("KWin core doesn't try to save the last used window shortcut"); | ||
▲ Show 20 Lines • Show All 55 Lines • ▼ Show 20 Line(s) | |||||
3989 | QVERIFY(Test::waitForWindowDestroyed(client)); | 3989 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
3990 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 3990 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
3991 | QVERIFY(client); | 3991 | QVERIFY(client); | ||
3992 | 3992 | | |||
3993 | // The window shortcut should be set to the last known value. | 3993 | // The window shortcut should be set to the last known value. | ||
3994 | QCOMPARE(client->shortcut(), (QKeySequence{Qt::CTRL + Qt::ALT + Qt::Key_2})); | 3994 | QCOMPARE(client->shortcut(), (QKeySequence{Qt::CTRL + Qt::ALT + Qt::Key_2})); | ||
3995 | 3995 | | |||
3996 | // Destroy the client. | 3996 | // Destroy the client. | ||
3997 | delete shellSurface; | 3997 | delete shellSurface; | ||
Lint: doubleFree: Memory pointed to by 'shellSurface' is freed twice. | |||||
3998 | delete surface; | 3998 | delete surface; | ||
Lint: doubleFree: Memory pointed to by 'surface' is freed twice. | |||||
3999 | QVERIFY(Test::waitForWindowDestroyed(client)); | 3999 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
4000 | } | 4000 | } | ||
4001 | 4001 | | |||
4002 | TEST_DATA(testShortcutForce) | 4002 | TEST_DATA(testShortcutForce) | ||
4003 | 4003 | | |||
4004 | void TestShellClientRules::testShortcutForce() | 4004 | void TestShellClientRules::testShortcutForce() | ||
4005 | { | 4005 | { | ||
4006 | QSKIP("KWin core can't release forced window shortcuts"); | 4006 | QSKIP("KWin core can't release forced window shortcuts"); | ||
▲ Show 20 Lines • Show All 55 Lines • ▼ Show 20 Line(s) | |||||
4062 | QVERIFY(Test::waitForWindowDestroyed(client)); | 4062 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
4063 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 4063 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
4064 | QVERIFY(client); | 4064 | QVERIFY(client); | ||
4065 | 4065 | | |||
4066 | // The window shortcut should still be forced. | 4066 | // The window shortcut should still be forced. | ||
4067 | QCOMPARE(client->shortcut(), (QKeySequence{Qt::CTRL + Qt::ALT + Qt::Key_1})); | 4067 | QCOMPARE(client->shortcut(), (QKeySequence{Qt::CTRL + Qt::ALT + Qt::Key_1})); | ||
4068 | 4068 | | |||
4069 | // Destroy the client. | 4069 | // Destroy the client. | ||
4070 | delete shellSurface; | 4070 | delete shellSurface; | ||
Lint: doubleFree: Memory pointed to by 'shellSurface' is freed twice. | |||||
4071 | delete surface; | 4071 | delete surface; | ||
Lint: doubleFree: Memory pointed to by 'surface' is freed twice. | |||||
4072 | QVERIFY(Test::waitForWindowDestroyed(client)); | 4072 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
4073 | } | 4073 | } | ||
4074 | 4074 | | |||
4075 | TEST_DATA(testShortcutApplyNow) | 4075 | TEST_DATA(testShortcutApplyNow) | ||
4076 | 4076 | | |||
4077 | void TestShellClientRules::testShortcutApplyNow() | 4077 | void TestShellClientRules::testShortcutApplyNow() | ||
4078 | { | 4078 | { | ||
4079 | // Create the test client. | 4079 | // Create the test client. | ||
▲ Show 20 Lines • Show All 119 Lines • ▼ Show 20 Line(s) | 4144 | { | |||
4199 | delete shellSurface; | 4199 | delete shellSurface; | ||
4200 | delete surface; | 4200 | delete surface; | ||
4201 | QVERIFY(Test::waitForWindowDestroyed(client)); | 4201 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
4202 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 4202 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
4203 | QVERIFY(client); | 4203 | QVERIFY(client); | ||
4204 | QVERIFY(client->shortcut().isEmpty()); | 4204 | QVERIFY(client->shortcut().isEmpty()); | ||
4205 | 4205 | | |||
4206 | // Destroy the client. | 4206 | // Destroy the client. | ||
4207 | delete shellSurface; | 4207 | delete shellSurface; | ||
Lint: doubleFree: Memory pointed to by 'shellSurface' is freed twice. | |||||
4208 | delete surface; | 4208 | delete surface; | ||
Lint: doubleFree: Memory pointed to by 'surface' is freed twice. | |||||
4209 | QVERIFY(Test::waitForWindowDestroyed(client)); | 4209 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
4210 | } | 4210 | } | ||
4211 | 4211 | | |||
4212 | TEST_DATA(testDesktopFileDontAffect) | 4212 | TEST_DATA(testDesktopFileDontAffect) | ||
4213 | 4213 | | |||
4214 | void TestShellClientRules::testDesktopFileDontAffect() | 4214 | void TestShellClientRules::testDesktopFileDontAffect() | ||
4215 | { | 4215 | { | ||
4216 | // Currently, the desktop file name is derived from the app id. If the app id is | 4216 | // Currently, the desktop file name is derived from the app id. If the app id is | ||
▲ Show 20 Lines • Show All 152 Lines • ▼ Show 20 Line(s) | 4343 | { | |||
4369 | delete surface; | 4369 | delete surface; | ||
4370 | QVERIFY(Test::waitForWindowDestroyed(client)); | 4370 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
4371 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | 4371 | std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); | ||
4372 | QVERIFY(client); | 4372 | QVERIFY(client); | ||
4373 | QVERIFY(client->isActive()); | 4373 | QVERIFY(client->isActive()); | ||
4374 | QCOMPARE(client->opacity(), 1.0); | 4374 | QCOMPARE(client->opacity(), 1.0); | ||
4375 | 4375 | | |||
4376 | // Destroy the client. | 4376 | // Destroy the client. | ||
4377 | delete shellSurface; | 4377 | delete shellSurface; | ||
Lint: doubleFree: Memory pointed to by 'shellSurface' is freed twice. | |||||
4378 | delete surface; | 4378 | delete surface; | ||
Lint: doubleFree: Memory pointed to by 'surface' is freed twice. | |||||
4379 | QVERIFY(Test::waitForWindowDestroyed(client)); | 4379 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
4380 | } | 4380 | } | ||
4381 | 4381 | | |||
4382 | TEST_DATA(testInactiveOpacityDontAffect) | 4382 | TEST_DATA(testInactiveOpacityDontAffect) | ||
4383 | 4383 | | |||
4384 | void TestShellClientRules::testInactiveOpacityDontAffect() | 4384 | void TestShellClientRules::testInactiveOpacityDontAffect() | ||
4385 | { | 4385 | { | ||
4386 | // Initialize RuleBook with the test rule. | 4386 | // Initialize RuleBook with the test rule. | ||
▲ Show 20 Lines • Show All 112 Lines • ▼ Show 20 Line(s) | 4464 | { | |||
4499 | QVERIFY(client); | 4499 | QVERIFY(client); | ||
4500 | QVERIFY(client->isActive()); | 4500 | QVERIFY(client->isActive()); | ||
4501 | QCOMPARE(client->opacity(), 1.0); | 4501 | QCOMPARE(client->opacity(), 1.0); | ||
4502 | workspace()->setActiveClient(nullptr); | 4502 | workspace()->setActiveClient(nullptr); | ||
4503 | QVERIFY(!client->isActive()); | 4503 | QVERIFY(!client->isActive()); | ||
4504 | QCOMPARE(client->opacity(), 1.0); | 4504 | QCOMPARE(client->opacity(), 1.0); | ||
4505 | 4505 | | |||
4506 | // Destroy the client. | 4506 | // Destroy the client. | ||
4507 | delete shellSurface; | 4507 | delete shellSurface; | ||
Lint: doubleFree: Memory pointed to by 'shellSurface' is freed twice. | |||||
4508 | delete surface; | 4508 | delete surface; | ||
Lint: doubleFree: Memory pointed to by 'surface' is freed twice. | |||||
4509 | QVERIFY(Test::waitForWindowDestroyed(client)); | 4509 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
4510 | } | 4510 | } | ||
4511 | 4511 | | |||
4512 | void TestShellClientRules::testMatchAfterNameChange() | 4512 | void TestShellClientRules::testMatchAfterNameChange() | ||
4513 | { | 4513 | { | ||
4514 | KSharedConfig::Ptr config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig); | 4514 | KSharedConfig::Ptr config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig); | ||
4515 | config->group("General").writeEntry("count", 1); | 4515 | config->group("General").writeEntry("count", 1); | ||
4516 | 4516 | | |||
Show All 29 Lines |
Memory pointed to by 'shellSurface' is freed twice.