Changeset 235123 in webkit


Ignore:
Timestamp:
Aug 21, 2018, 10:31:44 AM (6 years ago)
Author:
achristensen@apple.com
Message:

Transition more API tests from WKPageLoaderClient to WKPageNavigationClient
https://bugs.webkit.org/show_bug.cgi?id=188797

Reviewed by Tim Horton.

  • TestWebKitAPI/Tests/WebKit/AboutBlankLoad.cpp:

(TestWebKitAPI::didFinishNavigation):
(TestWebKitAPI::TEST):
(TestWebKitAPI::didFinishLoadForFrame): Deleted.

  • TestWebKitAPI/Tests/WebKit/EphemeralSessionPushStateNoHistoryCallback.cpp:

(TestWebKitAPI::didSameDocumentNavigation):
(TestWebKitAPI::TEST):
(TestWebKitAPI::didSameDocumentNavigationForFrame): Deleted.

  • TestWebKitAPI/Tests/WebKit/FailedLoad.cpp:

(TestWebKitAPI::didFailProvisionalNavigation):
(TestWebKitAPI::TEST):
(TestWebKitAPI::didFailProvisionalLoadWithErrorForFrame): Deleted.

  • TestWebKitAPI/Tests/WebKit/FrameMIMETypeHTML.cpp:

(TestWebKitAPI::didStartProvisionalNavigation):
(TestWebKitAPI::didCommitNavigation):
(TestWebKitAPI::didFinishNavigation):
(TestWebKitAPI::TEST):
(TestWebKitAPI::didStartProvisionalLoadForFrame): Deleted.
(TestWebKitAPI::didCommitLoadForFrame): Deleted.
(TestWebKitAPI::didFinishLoadForFrame): Deleted.

  • TestWebKitAPI/Tests/WebKit/FrameMIMETypePNG.cpp:

(TestWebKitAPI::didStartProvisionalNavigation):
(TestWebKitAPI::didCommitNavigation):
(TestWebKitAPI::didFinishNavigation):
(TestWebKitAPI::TEST):
(TestWebKitAPI::didStartProvisionalLoadForFrame): Deleted.
(TestWebKitAPI::didCommitLoadForFrame): Deleted.
(TestWebKitAPI::didFinishLoadForFrame): Deleted.

  • TestWebKitAPI/Tests/WebKit/LayoutMilestonesWithAllContentInFrame.cpp:

(TestWebKitAPI::renderingProgressDidChange):
(TestWebKitAPI::TEST):
(TestWebKitAPI::didLayout): Deleted.

  • TestWebKitAPI/Tests/WebKit/NewFirstVisuallyNonEmptyLayoutFrames.cpp:

(TestWebKitAPI::didFinishNavigation):
(TestWebKitAPI::renderingProgressDidChange):
(TestWebKitAPI::setPageLoaderClient):
(TestWebKitAPI::didFinishLoadForFrame): Deleted.
(TestWebKitAPI::didLayout): Deleted.

  • TestWebKitAPI/Tests/WebKit/PageLoadBasic.cpp:

(TestWebKitAPI::State::State):
(TestWebKitAPI::didStartProvisionalNavigation):
(TestWebKitAPI::didCommitNavigation):
(TestWebKitAPI::didFinishNavigation):
(TestWebKitAPI::decidePolicyForNavigationAction):
(TestWebKitAPI::decidePolicyForResponse):
(TestWebKitAPI::TEST):
(TestWebKitAPI::didStartProvisionalLoadForFrame): Deleted.
(TestWebKitAPI::didCommitLoadForFrame): Deleted.
(TestWebKitAPI::didFinishLoadForFrame): Deleted.
(TestWebKitAPI::decidePolicyForNewWindowAction): Deleted.

  • TestWebKitAPI/Tests/WebKit/PageLoadDidChangeLocationWithinPageForFrame.cpp:

(TestWebKitAPI::didSameDocumentNavigation):
(TestWebKitAPI::TEST):
(TestWebKitAPI::didFinishLoadForFrame): Deleted.
(TestWebKitAPI::didSameDocumentNavigationForFrame): Deleted.

  • TestWebKitAPI/Tests/WebKit/PrivateBrowsingPushStateNoHistoryCallback.cpp:

(TestWebKitAPI::TEST):
(TestWebKitAPI::didSameDocumentNavigationForFrame): Deleted.

  • TestWebKitAPI/Tests/WebKit/ReloadPageAfterCrash.cpp:

(TestWebKitAPI::didFinishLoad):
(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit/WKBundleFileHandle.cpp:

(TestWebKitAPI::didFinishNavigation):
(TestWebKitAPI::TEST):
(TestWebKitAPI::didFinishLoadForFrame): Deleted.

  • TestWebKitAPI/Tests/WebKit/mac/RestoreStateAfterTermination.mm:

(TestWebKitAPI::didFinishLoad):
(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKitCocoa/CommandBackForward.mm:

(WebKit2_CommandBackForwardTestWKView::SetUp):
(WebKit2_CommandBackForwardTestWKView::didFinishLoadForFrame): Deleted.

Location:
trunk/Tools
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r235117 r235123  
     12018-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
    1802018-08-20  Alex Christensen  <achristensen@webkit.org>
    281
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/AboutBlankLoad.cpp

    r221505 r235123  
    3535static bool done;
    3636
    37 static void didFinishLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)
     37static void didFinishNavigation(WKPageRef page, WKNavigationRef, WKTypeRef userData, const void* clientInfo)
    3838{
    39     WKRetainPtr<WKStringRef> mimeType = adoptWK(WKFrameCopyMIMEType(frame));
     39    WKRetainPtr<WKStringRef> mimeType = adoptWK(WKFrameCopyMIMEType(WKPageGetMainFrame(page)));
    4040    EXPECT_WK_STREQ("text/html", mimeType);
    4141    done = true;
     
    4747    PlatformWebView webView(context.get());
    4848
    49     WKPageLoaderClientV0 loaderClient;
     49    WKPageNavigationClientV0 loaderClient;
    5050    memset(&loaderClient, 0, sizeof(loaderClient));
    5151
    5252    loaderClient.base.version = 0;
    53     loaderClient.didFinishLoadForFrame = didFinishLoadForFrame;
     53    loaderClient.didFinishNavigation = didFinishNavigation;
    5454
    55     WKPageSetPageLoaderClient(webView.page(), &loaderClient.base);
     55    WKPageSetPageNavigationClient(webView.page(), &loaderClient.base);
    5656
    5757    WKPageLoadURL(webView.page(), adoptWK(WKURLCreateWithUTF8CString("about:blank")).get());
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/EphemeralSessionPushStateNoHistoryCallback.cpp

    r224631 r235123  
    4545}
    4646
    47 static void didSameDocumentNavigationForFrame(WKPageRef page, WKFrameRef frame, WKSameDocumentNavigationType type, WKTypeRef userData, const void *clientInfo)
     47static void didSameDocumentNavigation(WKPageRef page, WKNavigationRef, WKSameDocumentNavigationType type, WKTypeRef userData, const void *clientInfo)
    4848{
    4949    testDone = true;
     
    7070    PlatformWebView webView(configuration.get());
    7171
    72     WKPageLoaderClientV0 pageLoaderClient;
     72    WKPageNavigationClientV0 pageLoaderClient;
    7373    memset(&pageLoaderClient, 0, sizeof(pageLoaderClient));
    7474
    7575    pageLoaderClient.base.version = 0;
    76     pageLoaderClient.didSameDocumentNavigationForFrame = didSameDocumentNavigationForFrame;
     76    pageLoaderClient.didSameDocumentNavigation = didSameDocumentNavigation;
    7777
    78     WKPageSetPageLoaderClient(webView.page(), &pageLoaderClient.base);
     78    WKPageSetPageNavigationClient(webView.page(), &pageLoaderClient.base);
    7979
    8080    WKRetainPtr<WKPreferencesRef> preferences(AdoptWK, WKPreferencesCreate());
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/FailedLoad.cpp

    r221505 r235123  
    3939static bool testDone;
    4040
    41 static void didFailProvisionalLoadWithErrorForFrame(WKPageRef page, WKFrameRef frame, WKErrorRef error, WKTypeRef userData, const void* clientInfo)
     41static void didFailProvisionalNavigation(WKPageRef page, WKNavigationRef, WKErrorRef error, WKTypeRef userData, const void* clientInfo)
    4242{
     43    auto frame = WKPageGetMainFrame(page);
    4344    EXPECT_EQ(static_cast<uint32_t>(kWKFrameLoadStateFinished), WKFrameGetFrameLoadState(frame));
    4445
     
    5455    PlatformWebView webView(context.get());
    5556
    56     WKPageLoaderClientV0 loaderClient;
     57    WKPageNavigationClientV0 loaderClient;
    5758    memset(&loaderClient, 0, sizeof(loaderClient));
    5859
    5960    loaderClient.base.version = 0;
    60     loaderClient.didFailProvisionalLoadWithErrorForFrame = didFailProvisionalLoadWithErrorForFrame;
     61    loaderClient.didFailProvisionalNavigation = didFailProvisionalNavigation;
    6162
    62     WKPageSetPageLoaderClient(webView.page(), &loaderClient.base);
     63    WKPageSetPageNavigationClient(webView.page(), &loaderClient.base);
    6364
    6465    WKRetainPtr<WKURLRef> url(AdoptWK, Util::URLForNonExistentResource());
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/FrameMIMETypeHTML.cpp

    r221505 r235123  
    3737static bool testDone;
    3838
    39 static void didStartProvisionalLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)
     39static void didStartProvisionalNavigation(WKPageRef page, WKNavigationRef, WKTypeRef userData, const void* clientInfo)
    4040{
    41     WKRetainPtr<WKStringRef> wkMIME = adoptWK(WKFrameCopyMIMEType(frame));
     41    WKRetainPtr<WKStringRef> wkMIME = adoptWK(WKFrameCopyMIMEType(WKPageGetMainFrame(page)));
    4242    EXPECT_TRUE(WKStringIsEmpty(wkMIME.get()));
    4343}
    4444
    45 static void didCommitLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)
     45static void didCommitNavigation(WKPageRef page, WKNavigationRef, WKTypeRef userData, const void* clientInfo)
    4646{
    47     WKRetainPtr<WKStringRef> wkMIME = adoptWK(WKFrameCopyMIMEType(frame));
     47    WKRetainPtr<WKStringRef> wkMIME = adoptWK(WKFrameCopyMIMEType(WKPageGetMainFrame(page)));
    4848    EXPECT_WK_STREQ("text/html", wkMIME);
    4949}
    5050
    51 static void didFinishLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)
     51static void didFinishNavigation(WKPageRef page, WKNavigationRef, WKTypeRef userData, const void* clientInfo)
    5252{
    53     WKRetainPtr<WKStringRef> wkMIME = adoptWK(WKFrameCopyMIMEType(frame));
     53    WKRetainPtr<WKStringRef> wkMIME = adoptWK(WKFrameCopyMIMEType(WKPageGetMainFrame(page)));
    5454    EXPECT_WK_STREQ("text/html", wkMIME);
    5555
     
    6262    PlatformWebView webView(context.get());
    6363
    64     WKPageLoaderClientV0 loaderClient;
     64    WKPageNavigationClientV0 loaderClient;
    6565    memset(&loaderClient, 0, sizeof(loaderClient));
    6666
    6767    loaderClient.base.version = 0;
    68     loaderClient.didStartProvisionalLoadForFrame = didStartProvisionalLoadForFrame;
    69     loaderClient.didCommitLoadForFrame = didCommitLoadForFrame;
    70     loaderClient.didFinishLoadForFrame = didFinishLoadForFrame;
     68    loaderClient.didStartProvisionalNavigation = didStartProvisionalNavigation;
     69    loaderClient.didCommitNavigation = didCommitNavigation;
     70    loaderClient.didFinishNavigation = didFinishNavigation;
    7171
    72     WKPageSetPageLoaderClient(webView.page(), &loaderClient.base);
     72    WKPageSetPageNavigationClient(webView.page(), &loaderClient.base);
    7373
    7474    WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("simple", "html"));
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/FrameMIMETypePNG.cpp

    r221505 r235123  
    3636static bool testDone;
    3737
    38 static void didStartProvisionalLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)
     38static void didStartProvisionalNavigation(WKPageRef page, WKNavigationRef, WKTypeRef userData, const void* clientInfo)
    3939{
    40     WKRetainPtr<WKStringRef> wkMIME = adoptWK(WKFrameCopyMIMEType(frame));
     40    WKRetainPtr<WKStringRef> wkMIME = adoptWK(WKFrameCopyMIMEType(WKPageGetMainFrame(page)));
    4141    EXPECT_TRUE(WKStringIsEmpty(wkMIME.get()));
    4242}
    4343
    44 static void didCommitLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)
     44static void didCommitNavigation(WKPageRef page, WKNavigationRef, WKTypeRef userData, const void* clientInfo)
    4545{
    46     WKRetainPtr<WKStringRef> wkMIME = adoptWK(WKFrameCopyMIMEType(frame));
     46    WKRetainPtr<WKStringRef> wkMIME = adoptWK(WKFrameCopyMIMEType(WKPageGetMainFrame(page)));
    4747    EXPECT_WK_STREQ("image/png", wkMIME);
    4848}
    4949
    50 static void didFinishLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)
     50static void didFinishNavigation(WKPageRef page, WKNavigationRef, WKTypeRef userData, const void* clientInfo)
    5151{
    52     WKRetainPtr<WKStringRef> wkMIME = adoptWK(WKFrameCopyMIMEType(frame));
     52    WKRetainPtr<WKStringRef> wkMIME = adoptWK(WKFrameCopyMIMEType(WKPageGetMainFrame(page)));
    5353    EXPECT_WK_STREQ("image/png", wkMIME);
    5454
     
    6161    PlatformWebView webView(context.get());
    6262
    63     WKPageLoaderClientV0 loaderClient;
     63    WKPageNavigationClientV0 loaderClient;
    6464    memset(&loaderClient, 0, sizeof(loaderClient));
    6565
    6666    loaderClient.base.version = 0;
    67     loaderClient.didStartProvisionalLoadForFrame = didStartProvisionalLoadForFrame;
    68     loaderClient.didCommitLoadForFrame = didCommitLoadForFrame;
    69     loaderClient.didFinishLoadForFrame = didFinishLoadForFrame;
     67    loaderClient.didStartProvisionalNavigation = didStartProvisionalNavigation;
     68    loaderClient.didCommitNavigation = didCommitNavigation;
     69    loaderClient.didFinishNavigation = didFinishNavigation;
    7070
    71     WKPageSetPageLoaderClient(webView.page(), &loaderClient.base);
     71    WKPageSetPageNavigationClient(webView.page(), &loaderClient.base);
    7272
    7373    WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("icon", "png"));
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/LayoutMilestonesWithAllContentInFrame.cpp

    r221505 r235123  
    3838static bool testDone;
    3939
    40 static void didLayout(WKPageRef page, WKLayoutMilestones milestones, WKTypeRef, const void* clientInfo)
     40static void renderingProgressDidChange(WKPageRef page, WKPageRenderingProgressEvents milestones, WKTypeRef, const void* clientInfo)
    4141{
    4242    // This test ensures that the DidFirstVisuallyNonEmptyLayout will be reached for the main frame
    4343    // even when all of the content is in a subframe.
    44     if (milestones & kWKDidFirstVisuallyNonEmptyLayout)
     44    if (milestones & WKPageRenderingProgressEventFirstVisuallyNonEmptyLayout)
    4545        testDone = true;
    4646}
     
    5151    PlatformWebView webView(context.get());
    5252
    53     WKPageLoaderClientV3 loaderClient;
     53    WKPageNavigationClientV3 loaderClient;
    5454    memset(&loaderClient, 0, sizeof(loaderClient));
    5555
    5656    loaderClient.base.version = 3;
    5757    loaderClient.base.clientInfo = &webView;
    58     loaderClient.didLayout = didLayout;
     58    loaderClient.renderingProgressDidChange = renderingProgressDidChange;
    5959
    60     WKPageSetPageLoaderClient(webView.page(), &loaderClient.base);
     60    WKPageSetPageNavigationClient(webView.page(), &loaderClient.base);
    6161
    62     WKPageListenForLayoutMilestones(webView.page(), kWKDidFirstVisuallyNonEmptyLayout);
     62    WKPageListenForLayoutMilestones(webView.page(), WKPageRenderingProgressEventFirstVisuallyNonEmptyLayout);
    6363    WKPageLoadURL(webView.page(), adoptWK(Util::createURLForResource("all-content-in-one-iframe", "html")).get());
    6464
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/NewFirstVisuallyNonEmptyLayoutFrames.cpp

    r221505 r235123  
    4747}
    4848
    49 static void didFinishLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)
     49static void didFinishNavigation(WKPageRef page, WKNavigationRef, WKTypeRef userData, const void* clientInfo)
    5050{
    5151    test1Done = true;
     
    5353}
    5454
    55 static void didLayout(WKPageRef, WKLayoutMilestones type, WKTypeRef, const void *)
     55static void renderingProgressDidChange(WKPageRef, WKPageRenderingProgressEvents type, WKTypeRef, const void *)
    5656{
    57     if (type != kWKDidHitRelevantRepaintedObjectsAreaThreshold)
     57    if (type != WKPageRenderingProgressEventFirstPaintWithSignificantArea)
    5858        return;
    5959
     
    6565static void setPageLoaderClient(WKPageRef page)
    6666{
    67     WKPageLoaderClientV3 loaderClient;
     67    WKPageNavigationClientV3 loaderClient;
    6868    memset(&loaderClient, 0, sizeof(loaderClient));
    6969
    7070    loaderClient.base.version = 3;
    71     loaderClient.didFinishLoadForFrame = didFinishLoadForFrame;
    72     loaderClient.didLayout = didLayout;
     71    loaderClient.didFinishNavigation = didFinishNavigation;
     72    loaderClient.renderingProgressDidChange = renderingProgressDidChange;
    7373
    74     WKPageSetPageLoaderClient(page, &loaderClient.base);
     74    WKPageSetPageNavigationClient(page, &loaderClient.base);
    7575}
    7676
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/PageLoadBasic.cpp

    r235117 r235123  
    4040    State()
    4141        : didDecidePolicyForNavigationAction(false)
    42         , didStartProvisionalLoadForFrame(false)
    43         , didCommitLoadForFrame(false)
     42        , didStartProvisionalNavigation(false)
     43        , didCommitNavigation(false)
    4444    {
    4545    }
    4646
    4747    bool didDecidePolicyForNavigationAction;
    48     bool didStartProvisionalLoadForFrame;
    49     bool didCommitLoadForFrame;
     48    bool didStartProvisionalNavigation;
     49    bool didCommitNavigation;
    5050};
    5151
    52 static void didStartProvisionalLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)
     52static void didStartProvisionalNavigation(WKPageRef page, WKNavigationRef, WKTypeRef userData, const void* clientInfo)
    5353{
    5454    State* state = reinterpret_cast<State*>(const_cast<void*>(clientInfo));
    5555    EXPECT_TRUE(state->didDecidePolicyForNavigationAction);
    56     EXPECT_FALSE(state->didCommitLoadForFrame);
     56    EXPECT_FALSE(state->didCommitNavigation);
    5757
    5858    // The commited URL should be null.
    59     EXPECT_NULL(WKFrameCopyURL(frame));
     59    EXPECT_NULL(WKFrameCopyURL(WKPageGetMainFrame(page)));
    6060
    61     EXPECT_FALSE(state->didStartProvisionalLoadForFrame);
     61    EXPECT_FALSE(state->didStartProvisionalNavigation);
    6262
    63     state->didStartProvisionalLoadForFrame = true;
     63    state->didStartProvisionalNavigation = true;
    6464}
    6565
    66 static void didCommitLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)
     66static void didCommitNavigation(WKPageRef page, WKNavigationRef, WKTypeRef userData, const void* clientInfo)
    6767{
    6868    State* state = reinterpret_cast<State*>(const_cast<void*>(clientInfo));
    6969    EXPECT_TRUE(state->didDecidePolicyForNavigationAction);
    70     EXPECT_TRUE(state->didStartProvisionalLoadForFrame);
     70    EXPECT_TRUE(state->didStartProvisionalNavigation);
    7171
    7272    // The provisional URL should be null.
    73     EXPECT_NULL(WKFrameCopyProvisionalURL(frame));
     73    EXPECT_NULL(WKFrameCopyProvisionalURL(WKPageGetMainFrame(page)));
    7474
    75     state->didCommitLoadForFrame = true;
     75    state->didCommitNavigation = true;
    7676}
    7777
    78 static void didFinishLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)
     78static void didFinishNavigation(WKPageRef page, WKNavigationRef, WKTypeRef userData, const void* clientInfo)
    7979{
    8080    State* state = reinterpret_cast<State*>(const_cast<void*>(clientInfo));
    8181    EXPECT_TRUE(state->didDecidePolicyForNavigationAction);
    82     EXPECT_TRUE(state->didStartProvisionalLoadForFrame);
    83     EXPECT_TRUE(state->didCommitLoadForFrame);
     82    EXPECT_TRUE(state->didStartProvisionalNavigation);
     83    EXPECT_TRUE(state->didCommitNavigation);
    8484
    8585    // The provisional URL should be null.
    86     EXPECT_NULL(WKFrameCopyProvisionalURL(frame));
     86    EXPECT_NULL(WKFrameCopyProvisionalURL(WKPageGetMainFrame(page)));
    8787
    8888    test1Done = true;
    8989}
    9090
    91 static void decidePolicyForNavigationAction(WKPageRef page, WKFrameRef frame, WKFrameNavigationType navigationType, WKEventModifiers modifiers, WKEventMouseButton mouseButton, WKFrameRef originatingFrame, WKURLRequestRef request, WKFramePolicyListenerRef listener, WKTypeRef userData, const void* clientInfo)
     91static void decidePolicyForNavigationAction(WKPageRef page, WKNavigationActionRef navigationAction, WKFramePolicyListenerRef listener, WKTypeRef userData, const void* clientInfo)
    9292{
    9393    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);
    9796
    9897    state->didDecidePolicyForNavigationAction = true;
     
    101100}
    102101
    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)
     102static void decidePolicyForResponse(WKPageRef page, WKNavigationResponseRef navigationResponse, WKFramePolicyListenerRef listener, WKTypeRef userData, const void* clientInfo)
    110103{
    111104    WKFramePolicyListenerUse(listener);
     
    119112    PlatformWebView webView(context.get());
    120113
    121     WKPageLoaderClientV0 loaderClient;
     114    WKPageNavigationClientV0 loaderClient;
    122115    memset(&loaderClient, 0, sizeof(loaderClient));
    123116
    124117    loaderClient.base.version = 0;
    125118    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;
    129124
    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);
    142126
    143127    // Before loading anything, the active url should be null
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/PageLoadDidChangeLocationWithinPageForFrame.cpp

    r221505 r235123  
    3939
    4040static bool didFinishLoad;
    41 static void didFinishLoadForFrame(WKPageRef, WKFrameRef, WKTypeRef, const void*)
    42 {
    43     didFinishLoad = true;
    44 }
    45 
    4641static bool didPopStateWithinPage;
    4742static bool didChangeLocationWithinPage;
    48 static void didSameDocumentNavigationForFrame(WKPageRef, WKFrameRef, WKSameDocumentNavigationType type, WKTypeRef, const void*)
     43
     44static void didSameDocumentNavigation(WKPageRef, WKNavigationRef, WKSameDocumentNavigationType type, WKTypeRef, const void*)
    4945{
    5046    if (!didPopStateWithinPage) {
     
    5955}
    6056
    61 TEST(WebKit, PageLoadDidChangeLocationWithinPageForFrame)
     57TEST(WebKit, PageLoadDidChangeLocationWithinPage)
    6258{
    6359    WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreate());
    6460    PlatformWebView webView(context.get());
    6561
    66     WKPageLoaderClientV0 loaderClient;
     62    WKPageNavigationClientV0 loaderClient;
    6763    memset(&loaderClient, 0, sizeof(loaderClient));
    6864
    6965    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;
    7270
    73     WKPageSetPageLoaderClient(webView.page(), &loaderClient.base);
     71    WKPageSetPageNavigationClient(webView.page(), &loaderClient.base);
    7472
    7573    WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("file-with-anchor", "html"));
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/PrivateBrowsingPushStateNoHistoryCallback.cpp

    r224631 r235123  
    5050}
    5151
    52 static void didSameDocumentNavigationForFrame(WKPageRef page, WKFrameRef frame, WKSameDocumentNavigationType type, WKTypeRef userData, const void *clientInfo)
    53 {
    54     didSameDocumentNavigation = true;
    55 }
    56 
    5752TEST(WebKit, PrivateBrowsingPushStateNoHistoryCallback)
    5853{
     
    6964    PlatformWebView webView(context.get());
    7065
    71     WKPageLoaderClientV0 pageLoaderClient;
     66    WKPageNavigationClientV0 pageLoaderClient;
    7267    memset(&pageLoaderClient, 0, sizeof(pageLoaderClient));
    7368
    7469    pageLoaderClient.base.version = 0;
    75     pageLoaderClient.didSameDocumentNavigationForFrame = didSameDocumentNavigationForFrame;
     70    pageLoaderClient.didSameDocumentNavigation = [] (WKPageRef, WKNavigationRef, WKSameDocumentNavigationType, WKTypeRef, const void *) {
     71        didSameDocumentNavigation = true;
     72    };
    7673
    77     WKPageSetPageLoaderClient(webView.page(), &pageLoaderClient.base);
     74    WKPageSetPageNavigationClient(webView.page(), &pageLoaderClient.base);
    7875
    7976    WKRetainPtr<WKPreferencesRef> preferences(AdoptWK, WKPreferencesCreate());
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/ReloadPageAfterCrash.cpp

    r221505 r235123  
    3838static bool loadAfterCrash = false;
    3939
    40 static void didFinishLoad(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)
     40static void didFinishLoad(WKPageRef page, WKNavigationRef, WKTypeRef userData, const void* clientInfo)
    4141{
    4242    // First load before WebProcess was terminated.
     
    4848    // Next load after WebProcess was terminated (hopefully
    4949    // 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)));
    5151    EXPECT_FALSE(loadAfterCrash);
    5252
     
    6969    PlatformWebView webView(context.get());
    7070
    71     WKPageLoaderClientV0 loaderClient;
     71    WKPageNavigationClientV0 loaderClient;
    7272    memset(&loaderClient, 0, sizeof(loaderClient));
    7373
    7474    loaderClient.base.version = 0;
    75     loaderClient.didFinishLoadForFrame = didFinishLoad;
    76     loaderClient.processDidCrash = didCrash;
     75    loaderClient.didFinishNavigation = didFinishLoad;
     76    loaderClient.webProcessDidCrash = didCrash;
    7777
    78     WKPageSetPageLoaderClient(webView.page(), &loaderClient.base);
     78    WKPageSetPageNavigationClient(webView.page(), &loaderClient.base);
    7979
    8080    WKRetainPtr<WKURLRef> url = adoptWK(WKURLCreateWithUTF8CString("about:blank"));
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/WKBundleFileHandle.cpp

    r221505 r235123  
    4747}
    4848
    49 static void didFinishLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void*)
     49static void didFinishNavigation(WKPageRef page, WKNavigationRef, WKTypeRef userData, const void*)
    5050{
    5151    loadDone = true;
     
    6464    PlatformWebView webView(context.get());
    6565
    66     WKPageLoaderClientV0 loaderClient;
     66    WKPageNavigationClientV0 loaderClient;
    6767    memset(&loaderClient, 0, sizeof(loaderClient));
    6868    loaderClient.base.version = 0;
    69     loaderClient.didFinishLoadForFrame = didFinishLoadForFrame;
    70     WKPageSetPageLoaderClient(webView.page(), &loaderClient.base);
     69    loaderClient.didFinishNavigation = didFinishNavigation;
     70    WKPageSetPageNavigationClient(webView.page(), &loaderClient.base);
    7171
    7272    WKPageLoadURL(webView.page(), adoptWK(Util::createURLForResource("bundle-file", "html")).get());
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/mac/RestoreStateAfterTermination.mm

    r221505 r235123  
    4747}
    4848
    49 static void didFinishLoad(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)
     49static void didFinishLoad(WKPageRef page, WKNavigationRef, WKTypeRef userData, const void* clientInfo)
    5050{
    5151    // First load before WebProcess was terminated.
     
    5757    // Next load after WebProcess was terminated (hopefully
    5858    // 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)));
    6060    EXPECT_FALSE(loadAfterCrash);
    6161
     
    7979    [window.get().contentView addSubview:webView.platformView()];
    8080
    81     WKPageLoaderClientV0 loaderClient;
     81    WKPageNavigationClientV0 loaderClient;
    8282    memset(&loaderClient, 0, sizeof(loaderClient));
    8383    loaderClient.base.version = 0;
    84     loaderClient.didFinishLoadForFrame = didFinishLoad;
    85     loaderClient.processDidCrash = didCrash;
    86     WKPageSetPageLoaderClient(webView.page(), &loaderClient.base);
     84    loaderClient.didFinishNavigation = didFinishLoad;
     85    loaderClient.webProcessDidCrash = didCrash;
     86    WKPageSetPageNavigationClient(webView.page(), &loaderClient.base);
    8787
    8888    WKPageUIClientV0 uiClient;
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/CommandBackForward.mm

    r208455 r235123  
    113113    WKRetainPtr<WKURLRef> file2;
    114114
    115     static void didFinishLoadForFrame(WKPageRef, WKFrameRef, WKTypeRef, const void* clientInfo)
    116     {
    117         didFinishNavigation = true;
    118     }
    119 
    120115    virtual void SetUp()
    121116    {
     
    128123        webView = [[WKView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100) configurationRef:configuration.get()];
    129124
    130         WKPageLoaderClientV6 loaderClient;
     125        WKPageNavigationClientV0 loaderClient;
    131126        memset(&loaderClient, 0, sizeof(loaderClient));
    132127
    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);
    137134       
    138135        file1 = adoptWK(TestWebKitAPI::Util::createURLForResource("simple", "html"));
Note: See TracChangeset for help on using the changeset viewer.