Moved API call to Test interface.

This commit is contained in:
NissimHadar 2019-04-01 10:29:31 -07:00
parent 303dabd93c
commit 670fb017f3
4 changed files with 13 additions and 13 deletions

View file

@ -199,3 +199,9 @@ void TestScriptingInterface::setOtherAvatarsReplicaCount(int count) {
int TestScriptingInterface::getOtherAvatarsReplicaCount() {
return qApp->getOtherAvatarsReplicaCount();
}
bool TestScriptingInterface::isTextureLoadingComplete() {
bool result;
QMetaObject::invokeMethod(qApp, "gpuTextureMemSizeStable", Qt::DirectConnection, Q_RETURN_ARG(bool, result));
return result;
}

View file

@ -163,6 +163,13 @@ public slots:
*/
Q_INVOKABLE int getOtherAvatarsReplicaCount();
/**jsdoc
* Check whether all textures have been loaded.
* @function Entities.areTexturesLoaded
* @returns {boolean} <code>true</code> texture memory usage is not increasing <code>false</code>.
*/
Q_INVOKABLE bool isTextureLoadingComplete();
private:
bool waitForCondition(qint64 maxWaitMs, std::function<bool()> condition);
QString _testResultsLocation;

View file

@ -1026,12 +1026,6 @@ bool EntityScriptingInterface::isLoaded(const QUuid& id) {
return toReturn;
}
bool EntityScriptingInterface::isTextureLoadingComplete() {
bool result;
QMetaObject::invokeMethod(qApp, "gpuTextureMemSizeStable", Qt::DirectConnection, Q_RETURN_ARG(bool, result));
return result;
}
bool EntityScriptingInterface::isAddedEntity(const QUuid& id) {
bool toReturn = false;
_entityTree->withReadLock([&] {

View file

@ -395,13 +395,6 @@ public slots:
*/
Q_INVOKABLE bool isLoaded(const QUuid& id);
/**jsdoc
* Check whether all textures have been loaded.
* @function Entities.areTexturesLoaded
* @returns {boolean} <code>true</code> texture memory usage is not increasing <code>false</code>.
*/
Q_INVOKABLE bool isTextureLoadingComplete();
/**jsdoc
* Check if there is an object of a given ID.
* @function Entities.isAddedEntity