Emit last progress notification before calling dispatchDidFinishLoad
authorcaio.oliveira@openbossa.org <caio.oliveira@openbossa.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 30 Aug 2011 20:42:46 +0000 (20:42 +0000)
committercaio.oliveira@openbossa.org <caio.oliveira@openbossa.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 30 Aug 2011 20:42:46 +0000 (20:42 +0000)
commit7c4446fef666a6f052fdae0c72e1e21e72726858
tree3a9966ec23301b2d156aecbfbb2b4244678141f8
parent7c232d0226dd55a78e68619ed06339e068d1be90
Emit last progress notification before calling dispatchDidFinishLoad
https://bugs.webkit.org/show_bug.cgi?id=28851

Reviewed by Adam Barth.

Source/WebCore:

Original patch by Xan Lopez. Change FrameLoader to dispatch the notifications in
a more natural sequence.

Test: http/tests/loading/progress-finished-callback.html

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::checkLoadCompleteForThisFrame):

Source/WebKit/qt:

Add infrastructure to dump progressFinishedNotification callback in DRT.

* WebCoreSupport/DumpRenderTreeSupportQt.cpp:
(DumpRenderTreeSupportQt::dumpProgressFinishedCallback):
* WebCoreSupport/DumpRenderTreeSupportQt.h:
* WebCoreSupport/FrameLoaderClientQt.cpp:
(WebCore::FrameLoaderClientQt::postProgressFinishedNotification):
* WebCoreSupport/FrameLoaderClientQt.h:

Tools:

Implement dumpProgressFinishedCallback() in the layoutTestController for Qt,
Chromium and GTK ports. The first two were simple changes.

Some refactoring was needed in GTK port to assure that the dumps are emitted
correctly and the processing after the page load finished is in the right place.

To detect the load finished, we use the callback for the "load-status" notifier
signal of the top loading frame. And we use the deprecated "load-finished" signal
for dumping (if enabled) the progress finished expected output.

* DumpRenderTree/LayoutTestController.cpp:
(LayoutTestController::LayoutTestController):
(dumpProgressFinishedCallbackCallback):
(LayoutTestController::staticFunctions):
* DumpRenderTree/LayoutTestController.h:
(LayoutTestController::dumpProgressFinishedCallback):
(LayoutTestController::setDumpProgressFinishedCallback):
* DumpRenderTree/chromium/LayoutTestController.cpp:
(LayoutTestController::LayoutTestController):
(LayoutTestController::dumpProgressFinishedCallback):
(LayoutTestController::reset):
* DumpRenderTree/chromium/LayoutTestController.h:
(LayoutTestController::shouldDumpProgressFinishedCallback):
(LayoutTestController::setShouldDumpProgressFinishedCallback):
* DumpRenderTree/chromium/WebViewHost.cpp:
(WebViewHost::didStopLoading):
* DumpRenderTree/gtk/DumpRenderTree.cpp:
(webViewLoadFinished):
(topLoadingFrameLoadFinished):
(webFrameLoadStatusNotified):
* DumpRenderTree/qt/LayoutTestControllerQt.cpp:
(LayoutTestController::reset):
(LayoutTestController::dumpProgressFinishedCallback):
* DumpRenderTree/qt/LayoutTestControllerQt.h:

LayoutTests:

Keep track of the order expected for the progressFinishedNotification, which is
before the didFinishLoadForFrame.

* http/tests/loading/progress-finished-callback-expected.txt: Added.
* http/tests/loading/progress-finished-callback.html: Added.
* platform/mac/Skipped:
* platform/win/Skipped:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94105 268f45cc-cd09-0410-ab3c-d52691b4dbfc
21 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/loading/progress-finished-callback-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/loading/progress-finished-callback.html [new file with mode: 0644]
LayoutTests/platform/mac/Skipped
LayoutTests/platform/win/Skipped
Source/WebCore/ChangeLog
Source/WebCore/loader/FrameLoader.cpp
Source/WebKit/qt/ChangeLog
Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h
Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
Tools/ChangeLog
Tools/DumpRenderTree/LayoutTestController.cpp
Tools/DumpRenderTree/LayoutTestController.h
Tools/DumpRenderTree/chromium/LayoutTestController.cpp
Tools/DumpRenderTree/chromium/LayoutTestController.h
Tools/DumpRenderTree/chromium/WebViewHost.cpp
Tools/DumpRenderTree/gtk/DumpRenderTree.cpp
Tools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
Tools/DumpRenderTree/qt/LayoutTestControllerQt.h