1
0
Fork 0
mirror of https://github.com/thoughtbot/capybara-webkit synced 2023-03-27 23:22:28 -04:00
capybara-webkit/src/TimeoutCommand.h

39 lines
806 B
C
Raw Normal View History

#include "Command.h"
#include <QObject>
#include <QStringList>
class Response;
class WebPageManager;
class QTimer;
/* Decorates a command with a timeout.
*
* If the timeout, using a QTimer is reached before
* the command is finished, the load page load will
* be stopped and failure response will be issued.
*
*/
class TimeoutCommand : public Command {
Q_OBJECT
public:
TimeoutCommand(Command *command, WebPageManager *page, QObject *parent = 0);
virtual void start();
public slots:
void commandTimeout();
void commandFinished(Response *response);
void pageLoadingFromCommand();
void pendingLoadFinished(bool);
protected:
void startCommand();
void startTimeout();
private:
WebPageManager *m_manager;
QTimer *m_timer;
Command *m_command;
};