MCPcopy Create free account
hub / github.com/KDAB/GammaRay / testShaderEffectSourceGrab

Method testShaderEffectSourceGrab

tests/quicktexturetest.cpp:79–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77 }
78
79 void testShaderEffectSourceGrab()
80 {
81 if (!showSource("qrc:/manual/shadereffect6.qml")) {
82 qWarning() << "Skipping test due to unavailable QtQuick display.";
83 return;
84 }
85
86 auto remoteView = ObjectBroker::object<RemoteViewInterface *>("com.kdab.GammaRay.ObjectInspector.texture.remoteView");
87 QVERIFY(remoteView);
88 QSignalSpy frameSpy(remoteView, &RemoteViewInterface::frameUpdated);
89 QVERIFY(frameSpy.isValid());
90 remoteView->setViewActive(true);
91
92 QQuickItem *source = nullptr;
93 foreach (auto item, view()->rootObject()->findChildren<QQuickItem *>()) {
94 if (item->inherits("QQuickShaderEffectSource"))
95 source = item;
96 }
97 QVERIFY(source);
98 Probe::instance()->selectObject(source, QPoint());
99
100 QVERIFY(frameSpy.wait() || frameSpy.size() >= 1);
101 const auto last = frameSpy.size() - 1;
102 const auto frame = frameSpy.at(last).at(0).value<RemoteViewFrame>();
103 QVERIFY(frame.viewRect().height() > 0);
104 QVERIFY(frame.viewRect().width() > 0);
105 }
106};
107
108QTEST_MAIN(QuickTextureTest)

Callers

nothing calls this directly

Calls 7

showSourceFunction · 0.85
QPointClass · 0.85
viewRectMethod · 0.80
isValidMethod · 0.45
setViewActiveMethod · 0.45
selectObjectMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected