Files
tdesktop/Telegram/ThirdParty/kcoreaddons/autotests/kcompositejobtest.h
allhaileris afb81b8278
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Close stale issues and PRs / stale (push) Has been cancelled
init
2026-02-16 15:50:16 +03:00

62 lines
993 B
C++

/*
This file is part of the KDE project
SPDX-FileCopyrightText: 2013 Kevin Funk <kevin@kfunk.org>
SPDX-License-Identifier: LGPL-2.0-only
*/
#ifndef KCOMPOSITEJOBTEST_H
#define KCOMPOSITEJOBTEST_H
#include <QEventLoop>
#include <QObject>
#include "kcompositejob.h"
class TestJob : public KJob
{
Q_OBJECT
public:
explicit TestJob(QObject *parent = nullptr);
/// Takes 1 second to finish
void start() override;
private Q_SLOTS:
void doEmit();
};
class CompositeJob : public KCompositeJob
{
Q_OBJECT
public:
explicit CompositeJob(QObject *parent = nullptr)
: KCompositeJob(parent)
{
}
void start() override;
bool addSubjob(KJob *job) override;
protected Q_SLOTS:
void slotResult(KJob *job) override;
};
class KCompositeJobTest : public QObject
{
Q_OBJECT
public:
KCompositeJobTest();
private Q_SLOTS:
void testDeletionDuringExecution();
private:
QEventLoop loop;
};
#endif // KCOMPOSITEJOBTEST_H