| 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 | |
| 108 | QTEST_MAIN(QuickTextureTest) |
nothing calls this directly
no test coverage detected