Changeset 235123 in webkit
- Timestamp:
- Aug 21, 2018, 10:31:44 AM (6 years ago)
- Location:
- trunk/Tools
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r235117 r235123 1 2018-08-21 Alex Christensen <achristensen@webkit.org> 2 3 Transition more API tests from WKPageLoaderClient to WKPageNavigationClient 4 https://bugs.webkit.org/show_bug.cgi?id=188797 5 6 Reviewed by Tim Horton. 7 8 * TestWebKitAPI/Tests/WebKit/AboutBlankLoad.cpp: 9 (TestWebKitAPI::didFinishNavigation): 10 (TestWebKitAPI::TEST): 11 (TestWebKitAPI::didFinishLoadForFrame): Deleted. 12 * TestWebKitAPI/Tests/WebKit/EphemeralSessionPushStateNoHistoryCallback.cpp: 13 (TestWebKitAPI::didSameDocumentNavigation): 14 (TestWebKitAPI::TEST): 15 (TestWebKitAPI::didSameDocumentNavigationForFrame): Deleted. 16 * TestWebKitAPI/Tests/WebKit/FailedLoad.cpp: 17 (TestWebKitAPI::didFailProvisionalNavigation): 18 (TestWebKitAPI::TEST): 19 (TestWebKitAPI::didFailProvisionalLoadWithErrorForFrame): Deleted. 20 * TestWebKitAPI/Tests/WebKit/FrameMIMETypeHTML.cpp: 21 (TestWebKitAPI::didStartProvisionalNavigation): 22 (TestWebKitAPI::didCommitNavigation): 23 (TestWebKitAPI::didFinishNavigation): 24 (TestWebKitAPI::TEST): 25 (TestWebKitAPI::didStartProvisionalLoadForFrame): Deleted. 26 (TestWebKitAPI::didCommitLoadForFrame): Deleted. 27 (TestWebKitAPI::didFinishLoadForFrame): Deleted. 28 * TestWebKitAPI/Tests/WebKit/FrameMIMETypePNG.cpp: 29 (TestWebKitAPI::didStartProvisionalNavigation): 30 (TestWebKitAPI::didCommitNavigation): 31 (TestWebKitAPI::didFinishNavigation): 32 (TestWebKitAPI::TEST): 33 (TestWebKitAPI::didStartProvisionalLoadForFrame): Deleted. 34 (TestWebKitAPI::didCommitLoadForFrame): Deleted. 35 (TestWebKitAPI::didFinishLoadForFrame): Deleted. 36 * TestWebKitAPI/Tests/WebKit/LayoutMilestonesWithAllContentInFrame.cpp: 37 (TestWebKitAPI::renderingProgressDidChange): 38 (TestWebKitAPI::TEST): 39 (TestWebKitAPI::didLayout): Deleted. 40 * TestWebKitAPI/Tests/WebKit/NewFirstVisuallyNonEmptyLayoutFrames.cpp: 41 (TestWebKitAPI::didFinishNavigation): 42 (TestWebKitAPI::renderingProgressDidChange): 43 (TestWebKitAPI::setPageLoaderClient): 44 (TestWebKitAPI::didFinishLoadForFrame): Deleted. 45 (TestWebKitAPI::didLayout): Deleted. 46 * TestWebKitAPI/Tests/WebKit/PageLoadBasic.cpp: 47 (TestWebKitAPI::State::State): 48 (TestWebKitAPI::didStartProvisionalNavigation): 49 (TestWebKitAPI::didCommitNavigation): 50 (TestWebKitAPI::didFinishNavigation): 51 (TestWebKitAPI::decidePolicyForNavigationAction): 52 (TestWebKitAPI::decidePolicyForResponse): 53 (TestWebKitAPI::TEST): 54 (TestWebKitAPI::didStartProvisionalLoadForFrame): Deleted. 55 (TestWebKitAPI::didCommitLoadForFrame): Deleted. 56 (TestWebKitAPI::didFinishLoadForFrame): Deleted. 57 (TestWebKitAPI::decidePolicyForNewWindowAction): Deleted. 58 * TestWebKitAPI/Tests/WebKit/PageLoadDidChangeLocationWithinPageForFrame.cpp: 59 (TestWebKitAPI::didSameDocumentNavigation): 60 (TestWebKitAPI::TEST): 61 (TestWebKitAPI::didFinishLoadForFrame): Deleted. 62 (TestWebKitAPI::didSameDocumentNavigationForFrame): Deleted. 63 * TestWebKitAPI/Tests/WebKit/PrivateBrowsingPushStateNoHistoryCallback.cpp: 64 (TestWebKitAPI::TEST): 65 (TestWebKitAPI::didSameDocumentNavigationForFrame): Deleted. 66 * TestWebKitAPI/Tests/WebKit/ReloadPageAfterCrash.cpp: 67 (TestWebKitAPI::didFinishLoad): 68 (TestWebKitAPI::TEST): 69 * TestWebKitAPI/Tests/WebKit/WKBundleFileHandle.cpp: 70 (TestWebKitAPI::didFinishNavigation): 71 (TestWebKitAPI::TEST): 72 (TestWebKitAPI::didFinishLoadForFrame): Deleted. 73 * TestWebKitAPI/Tests/WebKit/mac/RestoreStateAfterTermination.mm: 74 (TestWebKitAPI::didFinishLoad): 75 (TestWebKitAPI::TEST): 76 * TestWebKitAPI/Tests/WebKitCocoa/CommandBackForward.mm: 77 (WebKit2_CommandBackForwardTestWKView::SetUp): 78 (WebKit2_CommandBackForwardTestWKView::didFinishLoadForFrame): Deleted. 79 1 80 2018-08-20 Alex Christensen <achristensen@webkit.org> 2 81 -
trunk/Tools/TestWebKitAPI/Tests/WebKit/AboutBlankLoad.cpp
r221505 r235123 35 35 static bool done; 36 36 37 static void didFinish LoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)37 static void didFinishNavigation(WKPageRef page, WKNavigationRef, WKTypeRef userData, const void* clientInfo) 38 38 { 39 WKRetainPtr<WKStringRef> mimeType = adoptWK(WKFrameCopyMIMEType( frame));39 WKRetainPtr<WKStringRef> mimeType = adoptWK(WKFrameCopyMIMEType(WKPageGetMainFrame(page))); 40 40 EXPECT_WK_STREQ("text/html", mimeType); 41 41 done = true; … … 47 47 PlatformWebView webView(context.get()); 48 48 49 WKPage LoaderClientV0 loaderClient;49 WKPageNavigationClientV0 loaderClient; 50 50 memset(&loaderClient, 0, sizeof(loaderClient)); 51 51 52 52 loaderClient.base.version = 0; 53 loaderClient.didFinish LoadForFrame = didFinishLoadForFrame;53 loaderClient.didFinishNavigation = didFinishNavigation; 54 54 55 WKPageSetPage LoaderClient(webView.page(), &loaderClient.base);55 WKPageSetPageNavigationClient(webView.page(), &loaderClient.base); 56 56 57 57 WKPageLoadURL(webView.page(), adoptWK(WKURLCreateWithUTF8CString("about:blank")).get()); -
trunk/Tools/TestWebKitAPI/Tests/WebKit/EphemeralSessionPushStateNoHistoryCallback.cpp
r224631 r235123 45 45 } 46 46 47 static void didSameDocumentNavigation ForFrame(WKPageRef page, WKFrameRef frame, WKSameDocumentNavigationType type, WKTypeRef userData, const void *clientInfo)47 static void didSameDocumentNavigation(WKPageRef page, WKNavigationRef, WKSameDocumentNavigationType type, WKTypeRef userData, const void *clientInfo) 48 48 { 49 49 testDone = true; … … 70 70 PlatformWebView webView(configuration.get()); 71 71 72 WKPage LoaderClientV0 pageLoaderClient;72 WKPageNavigationClientV0 pageLoaderClient; 73 73 memset(&pageLoaderClient, 0, sizeof(pageLoaderClient)); 74 74 75 75 pageLoaderClient.base.version = 0; 76 pageLoaderClient.didSameDocumentNavigation ForFrame = didSameDocumentNavigationForFrame;76 pageLoaderClient.didSameDocumentNavigation = didSameDocumentNavigation; 77 77 78 WKPageSetPage LoaderClient(webView.page(), &pageLoaderClient.base);78 WKPageSetPageNavigationClient(webView.page(), &pageLoaderClient.base); 79 79 80 80 WKRetainPtr<WKPreferencesRef> preferences(AdoptWK, WKPreferencesCreate()); -
trunk/Tools/TestWebKitAPI/Tests/WebKit/FailedLoad.cpp
r221505 r235123 39 39 static bool testDone; 40 40 41 static void didFailProvisional LoadWithErrorForFrame(WKPageRef page, WKFrameRef frame, WKErrorRef error, WKTypeRef userData, const void* clientInfo)41 static void didFailProvisionalNavigation(WKPageRef page, WKNavigationRef, WKErrorRef error, WKTypeRef userData, const void* clientInfo) 42 42 { 43 auto frame = WKPageGetMainFrame(page); 43 44 EXPECT_EQ(static_cast<uint32_t>(kWKFrameLoadStateFinished), WKFrameGetFrameLoadState(frame)); 44 45 … … 54 55 PlatformWebView webView(context.get()); 55 56 56 WKPage LoaderClientV0 loaderClient;57 WKPageNavigationClientV0 loaderClient; 57 58 memset(&loaderClient, 0, sizeof(loaderClient)); 58 59 59 60 loaderClient.base.version = 0; 60 loaderClient.didFailProvisional LoadWithErrorForFrame = didFailProvisionalLoadWithErrorForFrame;61 loaderClient.didFailProvisionalNavigation = didFailProvisionalNavigation; 61 62 62 WKPageSetPage LoaderClient(webView.page(), &loaderClient.base);63 WKPageSetPageNavigationClient(webView.page(), &loaderClient.base); 63 64 64 65 WKRetainPtr<WKURLRef> url(AdoptWK, Util::URLForNonExistentResource()); -
trunk/Tools/TestWebKitAPI/Tests/WebKit/FrameMIMETypeHTML.cpp
r221505 r235123 37 37 static bool testDone; 38 38 39 static void didStartProvisional LoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)39 static void didStartProvisionalNavigation(WKPageRef page, WKNavigationRef, WKTypeRef userData, const void* clientInfo) 40 40 { 41 WKRetainPtr<WKStringRef> wkMIME = adoptWK(WKFrameCopyMIMEType( frame));41 WKRetainPtr<WKStringRef> wkMIME = adoptWK(WKFrameCopyMIMEType(WKPageGetMainFrame(page))); 42 42 EXPECT_TRUE(WKStringIsEmpty(wkMIME.get())); 43 43 } 44 44 45 static void didCommit LoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)45 static void didCommitNavigation(WKPageRef page, WKNavigationRef, WKTypeRef userData, const void* clientInfo) 46 46 { 47 WKRetainPtr<WKStringRef> wkMIME = adoptWK(WKFrameCopyMIMEType( frame));47 WKRetainPtr<WKStringRef> wkMIME = adoptWK(WKFrameCopyMIMEType(WKPageGetMainFrame(page))); 48 48 EXPECT_WK_STREQ("text/html", wkMIME); 49 49 } 50 50 51 static void didFinish LoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)51 static void didFinishNavigation(WKPageRef page, WKNavigationRef, WKTypeRef userData, const void* clientInfo) 52 52 { 53 WKRetainPtr<WKStringRef> wkMIME = adoptWK(WKFrameCopyMIMEType( frame));53 WKRetainPtr<WKStringRef> wkMIME = adoptWK(WKFrameCopyMIMEType(WKPageGetMainFrame(page))); 54 54 EXPECT_WK_STREQ("text/html", wkMIME); 55 55 … … 62 62 PlatformWebView webView(context.get()); 63 63 64 WKPage LoaderClientV0 loaderClient;64 WKPageNavigationClientV0 loaderClient; 65 65 memset(&loaderClient, 0, sizeof(loaderClient)); 66 66 67 67 loaderClient.base.version = 0; 68 loaderClient.didStartProvisional LoadForFrame = didStartProvisionalLoadForFrame;69 loaderClient.didCommit LoadForFrame = didCommitLoadForFrame;70 loaderClient.didFinish LoadForFrame = didFinishLoadForFrame;68 loaderClient.didStartProvisionalNavigation = didStartProvisionalNavigation; 69 loaderClient.didCommitNavigation = didCommitNavigation; 70 loaderClient.didFinishNavigation = didFinishNavigation; 71 71 72 WKPageSetPage LoaderClient(webView.page(), &loaderClient.base);72 WKPageSetPageNavigationClient(webView.page(), &loaderClient.base); 73 73 74 74 WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("simple", "html")); -
trunk/Tools/TestWebKitAPI/Tests/WebKit/FrameMIMETypePNG.cpp
r221505 r235123 36 36 static bool testDone; 37 37 38 static void didStartProvisional LoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)38 static void didStartProvisionalNavigation(WKPageRef page, WKNavigationRef, WKTypeRef userData, const void* clientInfo) 39 39 { 40 WKRetainPtr<WKStringRef> wkMIME = adoptWK(WKFrameCopyMIMEType( frame));40 WKRetainPtr<WKStringRef> wkMIME = adoptWK(WKFrameCopyMIMEType(WKPageGetMainFrame(page))); 41 41 EXPECT_TRUE(WKStringIsEmpty(wkMIME.get())); 42 42 } 43 43 44 static void didCommit LoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)44 static void didCommitNavigation(WKPageRef page, WKNavigationRef, WKTypeRef userData, const void* clientInfo) 45 45 { 46 WKRetainPtr<WKStringRef> wkMIME = adoptWK(WKFrameCopyMIMEType( frame));46 WKRetainPtr<WKStringRef> wkMIME = adoptWK(WKFrameCopyMIMEType(WKPageGetMainFrame(page))); 47 47 EXPECT_WK_STREQ("image/png", wkMIME); 48 48 } 49 49 50 static void didFinish LoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)50 static void didFinishNavigation(WKPageRef page, WKNavigationRef, WKTypeRef userData, const void* clientInfo) 51 51 { 52 WKRetainPtr<WKStringRef> wkMIME = adoptWK(WKFrameCopyMIMEType( frame));52 WKRetainPtr<WKStringRef> wkMIME = adoptWK(WKFrameCopyMIMEType(WKPageGetMainFrame(page))); 53 53 EXPECT_WK_STREQ("image/png", wkMIME); 54 54 … … 61 61 PlatformWebView webView(context.get()); 62 62 63 WKPage LoaderClientV0 loaderClient;63 WKPageNavigationClientV0 loaderClient; 64 64 memset(&loaderClient, 0, sizeof(loaderClient)); 65 65 66 66 loaderClient.base.version = 0; 67 loaderClient.didStartProvisional LoadForFrame = didStartProvisionalLoadForFrame;68 loaderClient.didCommit LoadForFrame = didCommitLoadForFrame;69 loaderClient.didFinish LoadForFrame = didFinishLoadForFrame;67 loaderClient.didStartProvisionalNavigation = didStartProvisionalNavigation; 68 loaderClient.didCommitNavigation = didCommitNavigation; 69 loaderClient.didFinishNavigation = didFinishNavigation; 70 70 71 WKPageSetPage LoaderClient(webView.page(), &loaderClient.base);71 WKPageSetPageNavigationClient(webView.page(), &loaderClient.base); 72 72 73 73 WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("icon", "png")); -
trunk/Tools/TestWebKitAPI/Tests/WebKit/LayoutMilestonesWithAllContentInFrame.cpp
r221505 r235123 38 38 static bool testDone; 39 39 40 static void didLayout(WKPageRef page, WKLayoutMilestones milestones, WKTypeRef, const void* clientInfo)40 static void renderingProgressDidChange(WKPageRef page, WKPageRenderingProgressEvents milestones, WKTypeRef, const void* clientInfo) 41 41 { 42 42 // This test ensures that the DidFirstVisuallyNonEmptyLayout will be reached for the main frame 43 43 // even when all of the content is in a subframe. 44 if (milestones & kWKDidFirstVisuallyNonEmptyLayout)44 if (milestones & WKPageRenderingProgressEventFirstVisuallyNonEmptyLayout) 45 45 testDone = true; 46 46 } … … 51 51 PlatformWebView webView(context.get()); 52 52 53 WKPage LoaderClientV3 loaderClient;53 WKPageNavigationClientV3 loaderClient; 54 54 memset(&loaderClient, 0, sizeof(loaderClient)); 55 55 56 56 loaderClient.base.version = 3; 57 57 loaderClient.base.clientInfo = &webView; 58 loaderClient. didLayout = didLayout;58 loaderClient.renderingProgressDidChange = renderingProgressDidChange; 59 59 60 WKPageSetPage LoaderClient(webView.page(), &loaderClient.base);60 WKPageSetPageNavigationClient(webView.page(), &loaderClient.base); 61 61 62 WKPageListenForLayoutMilestones(webView.page(), kWKDidFirstVisuallyNonEmptyLayout);62 WKPageListenForLayoutMilestones(webView.page(), WKPageRenderingProgressEventFirstVisuallyNonEmptyLayout); 63 63 WKPageLoadURL(webView.page(), adoptWK(Util::createURLForResource("all-content-in-one-iframe", "html")).get()); 64 64 -
trunk/Tools/TestWebKitAPI/Tests/WebKit/NewFirstVisuallyNonEmptyLayoutFrames.cpp
r221505 r235123 47 47 } 48 48 49 static void didFinish LoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)49 static void didFinishNavigation(WKPageRef page, WKNavigationRef, WKTypeRef userData, const void* clientInfo) 50 50 { 51 51 test1Done = true; … … 53 53 } 54 54 55 static void didLayout(WKPageRef, WKLayoutMilestones type, WKTypeRef, const void *)55 static void renderingProgressDidChange(WKPageRef, WKPageRenderingProgressEvents type, WKTypeRef, const void *) 56 56 { 57 if (type != kWKDidHitRelevantRepaintedObjectsAreaThreshold)57 if (type != WKPageRenderingProgressEventFirstPaintWithSignificantArea) 58 58 return; 59 59 … … 65 65 static void setPageLoaderClient(WKPageRef page) 66 66 { 67 WKPage LoaderClientV3 loaderClient;67 WKPageNavigationClientV3 loaderClient; 68 68 memset(&loaderClient, 0, sizeof(loaderClient)); 69 69 70 70 loaderClient.base.version = 3; 71 loaderClient.didFinish LoadForFrame = didFinishLoadForFrame;72 loaderClient. didLayout = didLayout;71 loaderClient.didFinishNavigation = didFinishNavigation; 72 loaderClient.renderingProgressDidChange = renderingProgressDidChange; 73 73 74 WKPageSetPage LoaderClient(page, &loaderClient.base);74 WKPageSetPageNavigationClient(page, &loaderClient.base); 75 75 } 76 76 -
trunk/Tools/TestWebKitAPI/Tests/WebKit/PageLoadBasic.cpp
r235117 r235123 40 40 State() 41 41 : didDecidePolicyForNavigationAction(false) 42 , didStartProvisional LoadForFrame(false)43 , didCommit LoadForFrame(false)42 , didStartProvisionalNavigation(false) 43 , didCommitNavigation(false) 44 44 { 45 45 } 46 46 47 47 bool didDecidePolicyForNavigationAction; 48 bool didStartProvisional LoadForFrame;49 bool didCommit LoadForFrame;48 bool didStartProvisionalNavigation; 49 bool didCommitNavigation; 50 50 }; 51 51 52 static void didStartProvisional LoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)52 static void didStartProvisionalNavigation(WKPageRef page, WKNavigationRef, WKTypeRef userData, const void* clientInfo) 53 53 { 54 54 State* state = reinterpret_cast<State*>(const_cast<void*>(clientInfo)); 55 55 EXPECT_TRUE(state->didDecidePolicyForNavigationAction); 56 EXPECT_FALSE(state->didCommit LoadForFrame);56 EXPECT_FALSE(state->didCommitNavigation); 57 57 58 58 // The commited URL should be null. 59 EXPECT_NULL(WKFrameCopyURL( frame));59 EXPECT_NULL(WKFrameCopyURL(WKPageGetMainFrame(page))); 60 60 61 EXPECT_FALSE(state->didStartProvisional LoadForFrame);61 EXPECT_FALSE(state->didStartProvisionalNavigation); 62 62 63 state->didStartProvisional LoadForFrame= true;63 state->didStartProvisionalNavigation = true; 64 64 } 65 65 66 static void didCommit LoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)66 static void didCommitNavigation(WKPageRef page, WKNavigationRef, WKTypeRef userData, const void* clientInfo) 67 67 { 68 68 State* state = reinterpret_cast<State*>(const_cast<void*>(clientInfo)); 69 69 EXPECT_TRUE(state->didDecidePolicyForNavigationAction); 70 EXPECT_TRUE(state->didStartProvisional LoadForFrame);70 EXPECT_TRUE(state->didStartProvisionalNavigation); 71 71 72 72 // The provisional URL should be null. 73 EXPECT_NULL(WKFrameCopyProvisionalURL( frame));73 EXPECT_NULL(WKFrameCopyProvisionalURL(WKPageGetMainFrame(page))); 74 74 75 state->didCommit LoadForFrame= true;75 state->didCommitNavigation = true; 76 76 } 77 77 78 static void didFinish LoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)78 static void didFinishNavigation(WKPageRef page, WKNavigationRef, WKTypeRef userData, const void* clientInfo) 79 79 { 80 80 State* state = reinterpret_cast<State*>(const_cast<void*>(clientInfo)); 81 81 EXPECT_TRUE(state->didDecidePolicyForNavigationAction); 82 EXPECT_TRUE(state->didStartProvisional LoadForFrame);83 EXPECT_TRUE(state->didCommit LoadForFrame);82 EXPECT_TRUE(state->didStartProvisionalNavigation); 83 EXPECT_TRUE(state->didCommitNavigation); 84 84 85 85 // The provisional URL should be null. 86 EXPECT_NULL(WKFrameCopyProvisionalURL( frame));86 EXPECT_NULL(WKFrameCopyProvisionalURL(WKPageGetMainFrame(page))); 87 87 88 88 test1Done = true; 89 89 } 90 90 91 static void decidePolicyForNavigationAction(WKPageRef page, WK FrameRef frame, WKFrameNavigationType navigationType, WKEventModifiers modifiers, WKEventMouseButton mouseButton, WKFrameRef originatingFrame, WKURLRequestRef request, WKFramePolicyListenerRef listener, WKTypeRef userData, const void* clientInfo)91 static void decidePolicyForNavigationAction(WKPageRef page, WKNavigationActionRef navigationAction, WKFramePolicyListenerRef listener, WKTypeRef userData, const void* clientInfo) 92 92 { 93 93 State* state = reinterpret_cast<State*>(const_cast<void*>(clientInfo)); 94 EXPECT_FALSE(state->didStartProvisionalLoadForFrame); 95 EXPECT_FALSE(state->didCommitLoadForFrame); 96 EXPECT_TRUE(mouseButton == kWKEventMouseButtonNoButton); 94 EXPECT_FALSE(state->didStartProvisionalNavigation); 95 EXPECT_FALSE(state->didCommitNavigation); 97 96 98 97 state->didDecidePolicyForNavigationAction = true; … … 101 100 } 102 101 103 static void decidePolicyForNewWindowAction(WKPageRef page, WKFrameRef frame, WKFrameNavigationType navigationType, WKEventModifiers modifiers, WKEventMouseButton mouseButton, WKURLRequestRef request, WKStringRef frameName, WKFramePolicyListenerRef listener, WKTypeRef userData, const void* clientInfo) 104 { 105 EXPECT_TRUE(mouseButton == kWKEventMouseButtonNoButton); 106 WKFramePolicyListenerUse(listener); 107 } 108 109 static void decidePolicyForResponse(WKPageRef page, WKFrameRef frame, WKURLResponseRef response, WKURLRequestRef request, bool canShowMIMEType, WKFramePolicyListenerRef listener, WKTypeRef userData, const void* clientInfo) 102 static void decidePolicyForResponse(WKPageRef page, WKNavigationResponseRef navigationResponse, WKFramePolicyListenerRef listener, WKTypeRef userData, const void* clientInfo) 110 103 { 111 104 WKFramePolicyListenerUse(listener); … … 119 112 PlatformWebView webView(context.get()); 120 113 121 WKPage LoaderClientV0 loaderClient;114 WKPageNavigationClientV0 loaderClient; 122 115 memset(&loaderClient, 0, sizeof(loaderClient)); 123 116 124 117 loaderClient.base.version = 0; 125 118 loaderClient.base.clientInfo = &state; 126 loaderClient.didStartProvisionalLoadForFrame = didStartProvisionalLoadForFrame; 127 loaderClient.didCommitLoadForFrame = didCommitLoadForFrame; 128 loaderClient.didFinishLoadForFrame = didFinishLoadForFrame; 119 loaderClient.didStartProvisionalNavigation = didStartProvisionalNavigation; 120 loaderClient.didCommitNavigation = didCommitNavigation; 121 loaderClient.didFinishNavigation = didFinishNavigation; 122 loaderClient.decidePolicyForNavigationAction = decidePolicyForNavigationAction; 123 loaderClient.decidePolicyForNavigationResponse = decidePolicyForResponse; 129 124 130 WKPageSetPageLoaderClient(webView.page(), &loaderClient.base); 131 132 WKPagePolicyClientV1 policyClient; 133 memset(&policyClient, 0, sizeof(policyClient)); 134 135 policyClient.base.version = 1; 136 policyClient.base.clientInfo = &state; 137 policyClient.decidePolicyForNavigationAction = decidePolicyForNavigationAction; 138 policyClient.decidePolicyForNewWindowAction = decidePolicyForNewWindowAction; 139 policyClient.decidePolicyForResponse = decidePolicyForResponse; 140 141 WKPageSetPagePolicyClient(webView.page(), &policyClient.base); 125 WKPageSetPageNavigationClient(webView.page(), &loaderClient.base); 142 126 143 127 // Before loading anything, the active url should be null -
trunk/Tools/TestWebKitAPI/Tests/WebKit/PageLoadDidChangeLocationWithinPageForFrame.cpp
r221505 r235123 39 39 40 40 static bool didFinishLoad; 41 static void didFinishLoadForFrame(WKPageRef, WKFrameRef, WKTypeRef, const void*)42 {43 didFinishLoad = true;44 }45 46 41 static bool didPopStateWithinPage; 47 42 static bool didChangeLocationWithinPage; 48 static void didSameDocumentNavigationForFrame(WKPageRef, WKFrameRef, WKSameDocumentNavigationType type, WKTypeRef, const void*) 43 44 static void didSameDocumentNavigation(WKPageRef, WKNavigationRef, WKSameDocumentNavigationType type, WKTypeRef, const void*) 49 45 { 50 46 if (!didPopStateWithinPage) { … … 59 55 } 60 56 61 TEST(WebKit, PageLoadDidChangeLocationWithinPage ForFrame)57 TEST(WebKit, PageLoadDidChangeLocationWithinPage) 62 58 { 63 59 WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreate()); 64 60 PlatformWebView webView(context.get()); 65 61 66 WKPage LoaderClientV0 loaderClient;62 WKPageNavigationClientV0 loaderClient; 67 63 memset(&loaderClient, 0, sizeof(loaderClient)); 68 64 69 65 loaderClient.base.version = 0; 70 loaderClient.didFinishLoadForFrame = didFinishLoadForFrame; 71 loaderClient.didSameDocumentNavigationForFrame = didSameDocumentNavigationForFrame; 66 loaderClient.didFinishNavigation = [] (WKPageRef, WKNavigationRef, WKTypeRef, const void*) { 67 didFinishLoad = true; 68 }; 69 loaderClient.didSameDocumentNavigation = didSameDocumentNavigation; 72 70 73 WKPageSetPage LoaderClient(webView.page(), &loaderClient.base);71 WKPageSetPageNavigationClient(webView.page(), &loaderClient.base); 74 72 75 73 WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("file-with-anchor", "html")); -
trunk/Tools/TestWebKitAPI/Tests/WebKit/PrivateBrowsingPushStateNoHistoryCallback.cpp
r224631 r235123 50 50 } 51 51 52 static void didSameDocumentNavigationForFrame(WKPageRef page, WKFrameRef frame, WKSameDocumentNavigationType type, WKTypeRef userData, const void *clientInfo)53 {54 didSameDocumentNavigation = true;55 }56 57 52 TEST(WebKit, PrivateBrowsingPushStateNoHistoryCallback) 58 53 { … … 69 64 PlatformWebView webView(context.get()); 70 65 71 WKPage LoaderClientV0 pageLoaderClient;66 WKPageNavigationClientV0 pageLoaderClient; 72 67 memset(&pageLoaderClient, 0, sizeof(pageLoaderClient)); 73 68 74 69 pageLoaderClient.base.version = 0; 75 pageLoaderClient.didSameDocumentNavigationForFrame = didSameDocumentNavigationForFrame; 70 pageLoaderClient.didSameDocumentNavigation = [] (WKPageRef, WKNavigationRef, WKSameDocumentNavigationType, WKTypeRef, const void *) { 71 didSameDocumentNavigation = true; 72 }; 76 73 77 WKPageSetPage LoaderClient(webView.page(), &pageLoaderClient.base);74 WKPageSetPageNavigationClient(webView.page(), &pageLoaderClient.base); 78 75 79 76 WKRetainPtr<WKPreferencesRef> preferences(AdoptWK, WKPreferencesCreate()); -
trunk/Tools/TestWebKitAPI/Tests/WebKit/ReloadPageAfterCrash.cpp
r221505 r235123 38 38 static bool loadAfterCrash = false; 39 39 40 static void didFinishLoad(WKPageRef page, WK FrameRef frame, WKTypeRef userData, const void* clientInfo)40 static void didFinishLoad(WKPageRef page, WKNavigationRef, WKTypeRef userData, const void* clientInfo) 41 41 { 42 42 // First load before WebProcess was terminated. … … 48 48 // Next load after WebProcess was terminated (hopefully 49 49 // it will be correctly re-spawned). 50 EXPECT_EQ(static_cast<uint32_t>(kWKFrameLoadStateFinished), WKFrameGetFrameLoadState( frame));50 EXPECT_EQ(static_cast<uint32_t>(kWKFrameLoadStateFinished), WKFrameGetFrameLoadState(WKPageGetMainFrame(page))); 51 51 EXPECT_FALSE(loadAfterCrash); 52 52 … … 69 69 PlatformWebView webView(context.get()); 70 70 71 WKPage LoaderClientV0 loaderClient;71 WKPageNavigationClientV0 loaderClient; 72 72 memset(&loaderClient, 0, sizeof(loaderClient)); 73 73 74 74 loaderClient.base.version = 0; 75 loaderClient.didFinish LoadForFrame= didFinishLoad;76 loaderClient. processDidCrash = didCrash;75 loaderClient.didFinishNavigation = didFinishLoad; 76 loaderClient.webProcessDidCrash = didCrash; 77 77 78 WKPageSetPage LoaderClient(webView.page(), &loaderClient.base);78 WKPageSetPageNavigationClient(webView.page(), &loaderClient.base); 79 79 80 80 WKRetainPtr<WKURLRef> url = adoptWK(WKURLCreateWithUTF8CString("about:blank")); -
trunk/Tools/TestWebKitAPI/Tests/WebKit/WKBundleFileHandle.cpp
r221505 r235123 47 47 } 48 48 49 static void didFinish LoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void*)49 static void didFinishNavigation(WKPageRef page, WKNavigationRef, WKTypeRef userData, const void*) 50 50 { 51 51 loadDone = true; … … 64 64 PlatformWebView webView(context.get()); 65 65 66 WKPage LoaderClientV0 loaderClient;66 WKPageNavigationClientV0 loaderClient; 67 67 memset(&loaderClient, 0, sizeof(loaderClient)); 68 68 loaderClient.base.version = 0; 69 loaderClient.didFinish LoadForFrame = didFinishLoadForFrame;70 WKPageSetPage LoaderClient(webView.page(), &loaderClient.base);69 loaderClient.didFinishNavigation = didFinishNavigation; 70 WKPageSetPageNavigationClient(webView.page(), &loaderClient.base); 71 71 72 72 WKPageLoadURL(webView.page(), adoptWK(Util::createURLForResource("bundle-file", "html")).get()); -
trunk/Tools/TestWebKitAPI/Tests/WebKit/mac/RestoreStateAfterTermination.mm
r221505 r235123 47 47 } 48 48 49 static void didFinishLoad(WKPageRef page, WK FrameRef frame, WKTypeRef userData, const void* clientInfo)49 static void didFinishLoad(WKPageRef page, WKNavigationRef, WKTypeRef userData, const void* clientInfo) 50 50 { 51 51 // First load before WebProcess was terminated. … … 57 57 // Next load after WebProcess was terminated (hopefully 58 58 // it will be correctly re-spawned). 59 EXPECT_EQ(static_cast<uint32_t>(kWKFrameLoadStateFinished), WKFrameGetFrameLoadState( frame));59 EXPECT_EQ(static_cast<uint32_t>(kWKFrameLoadStateFinished), WKFrameGetFrameLoadState(WKPageGetMainFrame(page))); 60 60 EXPECT_FALSE(loadAfterCrash); 61 61 … … 79 79 [window.get().contentView addSubview:webView.platformView()]; 80 80 81 WKPage LoaderClientV0 loaderClient;81 WKPageNavigationClientV0 loaderClient; 82 82 memset(&loaderClient, 0, sizeof(loaderClient)); 83 83 loaderClient.base.version = 0; 84 loaderClient.didFinish LoadForFrame= didFinishLoad;85 loaderClient. processDidCrash = didCrash;86 WKPageSetPage LoaderClient(webView.page(), &loaderClient.base);84 loaderClient.didFinishNavigation = didFinishLoad; 85 loaderClient.webProcessDidCrash = didCrash; 86 WKPageSetPageNavigationClient(webView.page(), &loaderClient.base); 87 87 88 88 WKPageUIClientV0 uiClient; -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/CommandBackForward.mm
r208455 r235123 113 113 WKRetainPtr<WKURLRef> file2; 114 114 115 static void didFinishLoadForFrame(WKPageRef, WKFrameRef, WKTypeRef, const void* clientInfo)116 {117 didFinishNavigation = true;118 }119 120 115 virtual void SetUp() 121 116 { … … 128 123 webView = [[WKView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100) configurationRef:configuration.get()]; 129 124 130 WKPage LoaderClientV6loaderClient;125 WKPageNavigationClientV0 loaderClient; 131 126 memset(&loaderClient, 0, sizeof(loaderClient)); 132 127 133 loaderClient.base.version = 6; 134 loaderClient.didFinishLoadForFrame = didFinishLoadForFrame; 135 136 WKPageSetPageLoaderClient([webView pageRef], &loaderClient.base); 128 loaderClient.base.version = 0; 129 loaderClient.didFinishNavigation = [] (WKPageRef, WKNavigationRef, WKTypeRef, const void* clientInfo) { 130 didFinishNavigation = true; 131 }; 132 133 WKPageSetPageNavigationClient([webView pageRef], &loaderClient.base); 137 134 138 135 file1 = adoptWK(TestWebKitAPI::Util::createURLForResource("simple", "html"));
Note:
See TracChangeset
for help on using the changeset viewer.