Reviewed by Sam Weinig.
WebKitTestRunner should track loading more like DumpRenderTree
https://bugs.webkit.org/show_bug.cgi?id=52692
Change load tracking to track the current top loading frame, in the manner of DumpRenderTree.
This makes some tests that call notifyDone multiple times pass.
* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::InjectedBundle):
(WTR::InjectedBundle::done):
* WebKitTestRunner/InjectedBundle/InjectedBundle.h:
(WTR::InjectedBundle::topLoadingFrame):
(WTR::InjectedBundle::setTopLoadingFrame):
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::InjectedBundlePage):
(WTR::InjectedBundlePage::stopLoading):
(WTR::InjectedBundlePage::didStartProvisionalLoadForFrame):
(WTR::InjectedBundlePage::didFailProvisionalLoadWithErrorForFrame):
(WTR::InjectedBundlePage::didFinishLoadForFrame):
(WTR::InjectedBundlePage::didFailLoadWithErrorForFrame):
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.h:
* WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
(WTR::LayoutTestController::notifyDone):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::didReceiveMessageFromInjectedBundle):
2011-01-18 Maciej Stachowiak <mjs@apple.com>
Reviewed by Sam Weinig.
WebKitTestRunner should track loading more like DumpRenderTree
https://bugs.webkit.org/show_bug.cgi?id=52692
Relax the message check in didSaveFrameToPageCache a bit more, since
layout tests were still hitting the old one.
* UIProcess/WebPageProxy.cpp:
(WebKit::isDisconnectedFrame):
(WebKit::WebPageProxy::didSaveFrameToPageCache):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76092
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
var destinationRichText = document.getElementById("destination-rich-text");
sel.setPosition(destinationRichText, 0);
document.execCommand("Paste");
+ alert(destinationRichText.innerHTML);
var destinationPlainText = document.getElementById("destination-plain-text");
destinationPlainText.focus();
results.innerText = "Plain text field has the wrong value (expected " +
JSON.stringify(expectedPlainTextValue) + " but found " +
JSON.stringify(destinationPlainText.value) + ").";
+ Markup.dump(document.body);
+ Markup.notifyDone();
return;
}
results.innerText = "Plain text field has the wrong value (expected " +
JSON.stringify(expectedPlainTextValue2) + " but found " +
JSON.stringify(destinationPlainText.value) + ").";
+ Markup.dump(document.body);
+ Markup.notifyDone();
return;
}
document.getElementById('result').innerHTML = 'SUCCESS: div.onscroll was called, but window.onscroll was not.';
// Don't call notifyDone straight away, in case there's another scroll event coming/bubbling.
doneTimeout = setTimeout(function() {
+
+ // Don't pollute the test result with nonsense.
+ document.getElementById('container').innerHTML = '';
if (window.layoutTestController)
layoutTestController.notifyDone();
}, 100);
div.onscroll = divScrolled;
window.onscroll = windowScrolled;
div.scrollByLines(1);
-
- // Don't pollute the test result with nonsense.
- div.innerHTML = '';
}
</script>
# WebKit2 needs layoutTestController.overridePreference
# <https://bugs.webkit.org/show_bug.cgi?id=42197>
+http/tests/navigation/go-back-to-error-page.html
http/tests/navigation/ping-cookie.html
plugins/application-plugin-plugins-disabled.html
fast/canvas/webgl/context-lost-restored.html
# Pasteboard doesn't work in WebKit2
# <https://bugs.webkit.org/show_bug.cgi?id=42317>
+editing/pasteboard/copy-null-characters.html
editing/execCommand/4128080-2.html
editing/execCommand/5939887.html
editing/execCommand/copy-without-selection.html
# These require DRT setSerializeHTTPLoads implementation for WebKit2 to be reliable.
http/tests/local/link-stylesheet-load-order.html
http/tests/local/link-stylesheet-load-order-preload.html
+
+
+# Transitions sometimes don't stop when they should
+transitions/hang-with-bad-transition-list.html
+transitions/remove-transition-style.html
+transitions/repeated-firing-background-color.html
+transitions/zero-duration-with-non-zero-delay-end.html
+
+
+# CSSValue and CSSPrimitiveValue prototypes are wrong
+fast/dom/global-constructors.html
+
+# WebKit2 doesn't support tiled layers
+compositing/tiling/huge-layer-resize.html
+
+# Unexplained plugin failures
+plugins/destroy-reentry.html
+platform/mac/plugins/testplugin-onnew-onpaint.html
+plugins/destroy-stream-twice.html
+plugins/embed-inside-object.html
+plugins/no-mime-with-valid-extension.html
function startTransition()
{
var box = document.getElementById('box');
+ box.addEventListener("webkitTransitionEnd", function() { alert("end"); }, false);
box.className = 'animated';
window.setTimeout(function() {
box.style.opacity = '0.5';
<div id="results"></div>
</body>
-</html>
\ No newline at end of file
+</html>
+2011-01-18 Maciej Stachowiak <mjs@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ WebKitTestRunner should track loading more like DumpRenderTree
+ https://bugs.webkit.org/show_bug.cgi?id=52692
+
+ Relax the message check in didSaveFrameToPageCache a bit more, since
+ layout tests were still hitting the old one.
+
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::isDisconnectedFrame):
+ (WebKit::WebPageProxy::didSaveFrameToPageCache):
+
2011-01-18 Brady Eidson <beidson@apple.com>
Reviewed by Darin Adler.
parentFrame->appendChild(subFrame.get());
}
+static bool isDisconnectedFrame(WebFrameProxy* frame)
+{
+ return !frame->page() || !frame->page()->mainFrame() || !frame->isDescendantOf(frame->page()->mainFrame());
+}
+
void WebPageProxy::didSaveFrameToPageCache(uint64_t frameID)
{
MESSAGE_CHECK(m_mainFrame);
WebFrameProxy* subframe = process()->webFrame(frameID);
MESSAGE_CHECK(subframe);
- if (!subframe->parentFrame())
+ if (isDisconnectedFrame(subframe))
return;
MESSAGE_CHECK(subframe->isDescendantOf(m_mainFrame.get()));
+2011-01-18 Maciej Stachowiak <mjs@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ WebKitTestRunner should track loading more like DumpRenderTree
+ https://bugs.webkit.org/show_bug.cgi?id=52692
+
+ Change load tracking to track the current top loading frame, in the manner of DumpRenderTree.
+ This makes some tests that call notifyDone multiple times pass.
+
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
+ (WTR::InjectedBundle::InjectedBundle):
+ (WTR::InjectedBundle::done):
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.h:
+ (WTR::InjectedBundle::topLoadingFrame):
+ (WTR::InjectedBundle::setTopLoadingFrame):
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::InjectedBundlePage::InjectedBundlePage):
+ (WTR::InjectedBundlePage::stopLoading):
+ (WTR::InjectedBundlePage::didStartProvisionalLoadForFrame):
+ (WTR::InjectedBundlePage::didFailProvisionalLoadWithErrorForFrame):
+ (WTR::InjectedBundlePage::didFinishLoadForFrame):
+ (WTR::InjectedBundlePage::didFailLoadWithErrorForFrame):
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.h:
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
+ (WTR::LayoutTestController::notifyDone):
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::TestController::didReceiveMessageFromInjectedBundle):
+
2011-01-18 Mihai Parparita <mihaip@chromium.org>
Reviewed by Kent Tamura.
void LayoutTestController::notifyDone()
{
+ puts("notifyDone");
+
if (m_waitToDump && !topLoadingFrame && !WorkQueue::shared()->count())
dump();
m_waitToDump = false;
InjectedBundle::InjectedBundle()
: m_bundle(0)
+ , m_topLoadingFrame(0)
, m_state(Idle)
{
}
m_state = Stopping;
page()->stopLoading();
+ setTopLoadingFrame(0);
WKRetainPtr<WKStringRef> doneMessageName(AdoptWK, WKStringCreateWithUTF8CString("Done"));
WKRetainPtr<WKStringRef> doneMessageBody(AdoptWK, WKStringCreateWithUTF8CString(m_outputStream.str().c_str()));
bool isTestRunning() { return m_state == Testing; }
+ WKBundleFrameRef topLoadingFrame() { return m_topLoadingFrame; }
+ void setTopLoadingFrame(WKBundleFrameRef frame) { m_topLoadingFrame = frame; }
+
private:
InjectedBundle();
~InjectedBundle();
RefPtr<GCController> m_gcController;
RefPtr<EventSendingController> m_eventSendingController;
+ WKBundleFrameRef m_topLoadingFrame;
+
std::ostringstream m_outputStream;
enum State {
#include <WebKit2/WKBundleFramePrivate.h>
#include <WebKit2/WKBundlePagePrivate.h>
+#include <WebKit2/WKStringCF.h>
+
using namespace std;
namespace WTR {
InjectedBundlePage::InjectedBundlePage(WKBundlePageRef page)
: m_page(page)
, m_world(AdoptWK, WKBundleScriptWorldCreateWorld())
- , m_isLoading(false)
{
WKBundlePageLoaderClient loaderClient = {
0,
void InjectedBundlePage::stopLoading()
{
WKBundlePageStopLoading(m_page);
- m_isLoading = false;
}
void InjectedBundlePage::reset()
if (!InjectedBundle::shared().isTestRunning())
return;
- if (frame == WKBundlePageGetMainFrame(m_page))
- m_isLoading = true;
+ if (InjectedBundle::shared().topLoadingFrame())
+ return;
+ InjectedBundle::shared().setTopLoadingFrame(frame);
}
void InjectedBundlePage::didReceiveServerRedirectForProvisionalLoadForFrame(WKBundleFrameRef frame)
void InjectedBundlePage::didFailProvisionalLoadWithErrorForFrame(WKBundleFrameRef frame, WKErrorRef error)
{
+ if (!InjectedBundle::shared().isTestRunning())
+ return;
+
+ if (frame != InjectedBundle::shared().topLoadingFrame())
+ return;
+ InjectedBundle::shared().setTopLoadingFrame(0);
+
+ if (InjectedBundle::shared().layoutTestController()->waitToDump())
+ return;
+
+ InjectedBundle::shared().done();
}
void InjectedBundlePage::didCommitLoadForFrame(WKBundleFrameRef frame)
if (!InjectedBundle::shared().isTestRunning())
return;
- if (!WKBundleFrameIsMainFrame(frame))
- return;
-
- m_isLoading = false;
-
- if (this != InjectedBundle::shared().page())
+ if (frame != InjectedBundle::shared().topLoadingFrame())
return;
+ InjectedBundle::shared().setTopLoadingFrame(0);
if (InjectedBundle::shared().layoutTestController()->waitToDump())
return;
- dump();
+ InjectedBundle::shared().page()->dump();
}
void InjectedBundlePage::didFailLoadWithErrorForFrame(WKBundleFrameRef frame, WKErrorRef)
if (!InjectedBundle::shared().isTestRunning())
return;
- if (!WKBundleFrameIsMainFrame(frame))
+ if (frame != InjectedBundle::shared().topLoadingFrame())
return;
+ InjectedBundle::shared().setTopLoadingFrame(0);
- m_isLoading = false;
-
- if (this != InjectedBundle::shared().page())
+ if (InjectedBundle::shared().layoutTestController()->waitToDump())
return;
InjectedBundle::shared().done();
void dump();
void stopLoading();
- bool isLoading() { return m_isLoading; }
void reset();
WKBundlePageRef m_page;
WKRetainPtr<WKBundleScriptWorldRef> m_world;
WKRetainPtr<WKBundleBackForwardListItemRef> m_previousTestBackForwardListItem;
- bool m_isLoading;
};
} // namespace WTR
if (!InjectedBundle::shared().isTestRunning())
return;
- if (m_waitToDump && !InjectedBundle::shared().page()->isLoading())
+ if (m_waitToDump && !InjectedBundle::shared().topLoadingFrame())
InjectedBundle::shared().page()->dump();
+
m_waitToDump = false;
}
void TestController::didReceiveMessageFromInjectedBundle(WKStringRef messageName, WKTypeRef messageBody)
{
+ if (!m_currentInvocation)
+ return;
m_currentInvocation->didReceiveMessageFromInjectedBundle(messageName, messageBody);
}