Commit c52050f8 authored by weinig@apple.com's avatar weinig@apple.com

Fix failing API test. It turns out that a pop-state event

is sent before every fragment navigation, so we have to test
for it in addition in PageLoadDidChangeLocationWithinPageForFrame.

Reviewed by Anders Carlsson.

* TestWebKitAPI/Tests/WebKit2/PageLoadDidChangeLocationWithinPageForFrame.cpp:
(TestWebKitAPI::didSameDocumentNavigationForFrame):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73880 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent a9eb6221
2010-12-12 Sam Weinig <sam@webkit.org>
Reviewed by Anders Carlsson.
Fix failing API test. It turns out that a pop-state event
is sent before every fragment navigation, so we have to test
for it in addition in PageLoadDidChangeLocationWithinPageForFrame.
* TestWebKitAPI/Tests/WebKit2/PageLoadDidChangeLocationWithinPageForFrame.cpp:
(TestWebKitAPI::didSameDocumentNavigationForFrame):
2010-12-12 Alejandro G. Castro <alex@igalia.com>
Reviewed by Eric Seidel.
......
......@@ -42,9 +42,17 @@ static void didFinishLoadForFrame(WKPageRef, WKFrameRef, WKTypeRef, const void*)
didFinishLoad = true;
}
static bool didPopStateWithinPage;
static bool didChangeLocationWithinPage;
static void didSameDocumentNavigationForFrame(WKPageRef, WKFrameRef, WKSameDocumentNavigationType type, WKTypeRef, const void*)
{
if (!didPopStateWithinPage) {
TEST_ASSERT(type == kWKSameDocumentNavigationSessionStatePop);
TEST_ASSERT(!didChangeLocationWithinPage);
didPopStateWithinPage = true;
return;
}
TEST_ASSERT(type == kWKSameDocumentNavigationAnchorNavigation);
didChangeLocationWithinPage = true;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment