Turns Response into a QObject and sets parent to the command that emits it. Each Command is also a child of the decorator commands, Timeout and PageLoading commnds, so that deleting the top level command will delete all the children. See discussion in #430.
WebPage::setContent will cause the loadFinished signal to fire, so there's no need to call loadFinished if the signal is connected.
Instead of emitting loadStarted when a reply is created and pageFinished when all pending replies have finished, emit these signals when the corresponding WebPage events fire.
JavaScipt actions and other asynchronous events which cause a WebPage load may not be processed by the time we receive an incoming command. Ensure that these events get processed before checking if the page is loading by calling QApplication::processEvents(). Fixes spurious failures throughout the test suite.
QWebFrame::url() does not return a valid URL for iframes. We can't just look up the requested URL in m_responses because the request may have been redirected, so instead we keep track of redirects and set up the NetworkResponse when the final reply is received.