capybara-webkit/src/SetTimeout.cpp

21 lines
490 B
C++
Raw Normal View History

#include "SetTimeout.h"
#include "WebPageManager.h"
2013-02-02 22:32:54 +00:00
#include "ErrorMessage.h"
SetTimeout::SetTimeout(WebPageManager *manager, QStringList &arguments, QObject *parent) : SocketCommand(manager, arguments, parent) {
}
void SetTimeout::start() {
QString timeoutString = arguments()[0];
bool ok;
int timeout = timeoutString.toInt(&ok);
if (ok) {
manager()->setTimeout(timeout);
2013-02-11 23:31:41 +00:00
finish(true);
} else {
2013-02-11 23:31:41 +00:00
finish(false, new ErrorMessage("Invalid value for timeout"));
}
}