Emit last progress notification before calling dispatchDidFinishLoad
authorAdemar de Souza Reis Jr <ademar.reis@openbossa.org>
Mon, 5 Sep 2011 13:36:26 +0000 (10:36 -0300)
committerAdemar de Souza Reis Jr <ademar.reis@openbossa.org>
Mon, 5 Sep 2011 14:17:10 +0000 (11:17 -0300)
commit3f29aef112574c3e20d8178ecb100448a915190c
treef407f8c9e0297ac5c88de744b56f4a8c9046b49b
parent572a831e3dde22be16b1c4452cb341ada9cdd260
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: http://svn.webkit.org/repository/webkit/trunk@94105 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Conflicts:

LayoutTests/platform/mac/Skipped
LayoutTests/platform/win/Skipped
Tools/DumpRenderTree/chromium/LayoutTestController.h
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