Home
Phabricator
Search
Log In
Paste
P582
Masterwork From Distant Lands
Active
Public
Actions
Authored by
davidedmundson
on Apr 11 2020, 3:27 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
None
Subscribers
None
commit e41eddbbe447a03cb095de51c5fe0b8b0fcf1f57
Author: David Edmundson <kde@davidedmundson.co.uk>
Date: Sat Apr 11 16:27:19 2020 +0100
asdf
diff --git a/autotests/client/test_wayland_blur.cpp b/autotests/client/test_wayland_blur.cpp
index f6cd202..dd2d5d4 100644
--- a/autotests/client/test_wayland_blur.cpp
+++ b/autotests/client/test_wayland_blur.cpp
@@ -31,6 +31,7 @@ private Q_SLOTS:
void testCreate();
void testSurfaceDestroy();
+ void testGlobalDestroy();
private:
KWayland::Server::Display *m_display;
@@ -157,6 +158,7 @@ void TestBlur::testCreate()
QVERIFY(blurChanged.wait());
QCOMPARE(serverSurface->blur()->region(), QRegion(0, 0, 10, 20));
+
// and destroy
QSignalSpy destroyedSpy(serverSurface->blur().data(), &QObject::destroyed);
QVERIFY(destroyedSpy.isValid());
@@ -197,5 +199,27 @@ void TestBlur::testSurfaceDestroy()
QVERIFY(blurDestroyedSpy.wait());
}
+void TestBlur::testGlobalDestroy()
+{
+ QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWayland::Server::CompositorInterface::surfaceCreated);
+ QScopedPointer<KWayland::Client::Surface> surface(m_compositor->createSurface());
+ QVERIFY(serverSurfaceCreated.wait());
+
+ auto serverSurface = serverSurfaceCreated.first().first().value<KWayland::Server::SurfaceInterface*>();
+ QSignalSpy blurChanged(serverSurface, &KWayland::Server::SurfaceInterface::blurChanged);
+
+ delete m_blurManagerInterface;
+ m_blurManagerInterface = nullptr;
+
+ //this will be an sync operation, we've deleted our global, but the clients have some operations in flight as they haven't processed this yet
+
+ QScopedPointer<KWayland::Client::Blur> blur(m_blurManager->createBlur(surface.data()));
+ blur->setRegion(m_compositor->createRegion(QRegion(0, 0, 10, 20), nullptr));
+ blur->commit();
+ surface->commit(KWayland::Client::Surface::CommitFlag::None);
+
+ blurChanged.wait(10);
+}
+
QTEST_GUILESS_MAIN(TestBlur)
#include "test_wayland_blur.moc"
davidedmundson
edited the content of this paste.
(Show Details)
Apr 11 2020, 3:27 PM
davidedmundson
changed the title of this paste from untitled to
Masterwork From Distant Lands
.
Log In to Comment