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

Remove m_commandWaiting and add logging to TimeoutCommand

This commit is contained in:
Matthew Horan 2012-10-24 08:15:37 -04:00
parent cbb58d05f1
commit 67b8a3391a
3 changed files with 1 additions and 3 deletions

View file

@ -16,7 +16,6 @@ Connection::Connection(QTcpSocket *socket, WebPageManager *manager, QObject *par
m_commandFactory = new CommandFactory(m_manager, this); m_commandFactory = new CommandFactory(m_manager, this);
m_commandParser = new CommandParser(socket, m_commandFactory, this); m_commandParser = new CommandParser(socket, m_commandFactory, this);
m_pageSuccess = true; m_pageSuccess = true;
m_commandWaiting = false;
connect(m_socket, SIGNAL(readyRead()), m_commandParser, SLOT(checkNext())); connect(m_socket, SIGNAL(readyRead()), m_commandParser, SLOT(checkNext()));
connect(m_commandParser, SIGNAL(commandReady(Command *)), this, SLOT(commandReady(Command *))); connect(m_commandParser, SIGNAL(commandReady(Command *)), this, SLOT(commandReady(Command *)));
connect(m_manager, SIGNAL(pageFinished(bool)), this, SLOT(pendingLoadFinished(bool))); connect(m_manager, SIGNAL(pageFinished(bool)), this, SLOT(pendingLoadFinished(bool)));
@ -29,7 +28,6 @@ void Connection::commandReady(Command *command) {
} }
void Connection::startCommand() { void Connection::startCommand() {
m_commandWaiting = false;
if (m_pageSuccess) { if (m_pageSuccess) {
m_runningCommand = new PageLoadingCommand(m_queuedCommand, m_manager, this); m_runningCommand = new PageLoadingCommand(m_queuedCommand, m_manager, this);
m_runningCommand = new TimeoutCommand(m_runningCommand, m_manager, this); m_runningCommand = new TimeoutCommand(m_runningCommand, m_manager, this);

View file

@ -33,7 +33,6 @@ class Connection : public QObject {
CommandFactory *m_commandFactory; CommandFactory *m_commandFactory;
Command *m_runningCommand; Command *m_runningCommand;
bool m_pageSuccess; bool m_pageSuccess;
bool m_commandWaiting;
WebPage *currentPage(); WebPage *currentPage();
}; };

View file

@ -15,6 +15,7 @@ TimeoutCommand::TimeoutCommand(Command *command, WebPageManager *manager, QObjec
void TimeoutCommand::start() { void TimeoutCommand::start() {
if (m_manager->isLoading()) { if (m_manager->isLoading()) {
m_manager->logger() << this->toString() << "waiting for load to finish";
connect(m_manager, SIGNAL(pageFinished(bool)), this, SLOT(pendingLoadFinished(bool))); connect(m_manager, SIGNAL(pageFinished(bool)), this, SLOT(pendingLoadFinished(bool)));
startTimeout(); startTimeout();
} else { } else {