Changeset 198955 in webkit


Ignore:
Timestamp:
Apr 1, 2016 2:10:41 PM (8 years ago)
Author:
Brent Fulgham
Message:

Confirm <a download> satisfies specification criteria
https://bugs.webkit.org/show_bug.cgi?id=156057

Reviewed by Andy Estes.

Source/WebKit2:

  • WebProcess/InjectedBundle/API/c/WKBundleNavigationAction.cpp:

(WKBundleNavigationActionGetHasDownloadAttribute): Added.

  • WebProcess/InjectedBundle/API/c/WKBundleNavigationActionPrivate.h:
  • WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp:

(WebKit::InjectedBundleNavigationAction::InjectedBundleNavigationAction):

  • WebProcess/InjectedBundle/InjectedBundleNavigationAction.h:

(WebKit::InjectedBundleNavigationAction::hasDownloadAttribute): Added.

Tools:

Revise WebKitTestRunner:
(1) Provide a download client delegate.
(2) Teach WKTR to wait to finish a test until a download finishes.
(3) Allow WKTR to notify the current TestRunner that it can finish.

  • WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
  • WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:

(WTR::InjectedBundle::didReceiveMessageToPage): Update to recognize a new
message "NotifyDownloadDone".

  • WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:

(WTR::InjectedBundlePage::decidePolicyForNavigationAction): Handle 'download'
attribute case.

  • WebKitTestRunner/InjectedBundle/TestRunner.cpp:

(WTR::TestRunner::waitUntilDownload): Added.

  • WebKitTestRunner/InjectedBundle/TestRunner.h:

(WTR::TestRunner::shouldFinishAfterDownload): Added.

  • WebKitTestRunner/TestController.cpp:

(WTR::TestController::createWebViewWithOptions): Set up the download client.
(WTR::TestController::downloadDidStart): Added.
(WTR::TestController::decideDestinationWithSuggestedFilename): Added.
(WTR::TestController::downloadDidFinish): Added.
(WTR::TestController::downloadDidFail): Added.
(WTR::TestController::downloadDidCancel): Added.

  • WebKitTestRunner/TestController.h:
  • WebKitTestRunner/TestInvocation.cpp:

(WTR::TestInvocation::notifyDownloadDone): Added.

  • WebKitTestRunner/TestInvocation.h:

LayoutTests:

Import <a download> tests from the Blink project.

Based on a Blink change (patch by <asanka@chromium.org>):
<https://src.chromium.org/viewvc/blink?revision=172767&view=revision>

  • TestExpectations: Mark two expected failures with the new tests.
  • fast/dom/HTMLAnchorElement/anchor-download-expected.txt: Updated for

expected output (blob URL currently not working).

  • fast/dom/HTMLAnchorElement/anchor-nodownload-set-expected.txt: Ditto.
  • http/tests/security/anchor-download-allow-blob-expected.txt: Added.
  • http/tests/security/anchor-download-allow-blob.html: Added.
  • http/tests/security/anchor-download-allow-data-expected.txt: Added.
  • http/tests/security/anchor-download-allow-data.html: Added.
  • http/tests/security/anchor-download-allow-sameorigin-expected.txt: Added.
  • http/tests/security/anchor-download-allow-sameorigin.html: Added.
  • http/tests/security/anchor-download-block-crossorigin-expected.txt: Added.
  • http/tests/security/anchor-download-block-crossorigin.html: Added.
  • http/tests/security/resources/attachment.php: Added.
  • platform/ios-simulator-wk1/TestExpectations: Disable download tests until WK1 support

is implemented.

  • platform/ios-simulator-wk2/TestExpectations: Disable download tests until

NETWORK_SESSION support exists.

  • platform/mac/TestExpectations: Reactivate the HTMLAnchorElement tests.
  • platform/mac-wk1/TestExpectations: Disable download tests until WK1 support

is implemented.

Location:
trunk
Files:
9 added
23 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r198954 r198955  
     12016-04-01  Brent Fulgham  <bfulgham@apple.com>
     2
     3        Confirm <a download> satisfies specification criteria
     4        https://bugs.webkit.org/show_bug.cgi?id=156057
     5
     6        Reviewed by Andy Estes.
     7
     8        Import <a download> tests from the Blink project.
     9
     10        Based on a Blink change (patch by <asanka@chromium.org>):
     11        <https://src.chromium.org/viewvc/blink?revision=172767&view=revision>
     12
     13        * TestExpectations: Mark two expected failures with the new tests.
     14        * fast/dom/HTMLAnchorElement/anchor-download-expected.txt: Updated for
     15        expected output (blob URL currently not working).
     16        * fast/dom/HTMLAnchorElement/anchor-nodownload-set-expected.txt: Ditto.
     17        * http/tests/security/anchor-download-allow-blob-expected.txt: Added.
     18        * http/tests/security/anchor-download-allow-blob.html: Added.
     19        * http/tests/security/anchor-download-allow-data-expected.txt: Added.
     20        * http/tests/security/anchor-download-allow-data.html: Added.
     21        * http/tests/security/anchor-download-allow-sameorigin-expected.txt: Added.
     22        * http/tests/security/anchor-download-allow-sameorigin.html: Added.
     23        * http/tests/security/anchor-download-block-crossorigin-expected.txt: Added.
     24        * http/tests/security/anchor-download-block-crossorigin.html: Added.
     25        * http/tests/security/resources/attachment.php: Added.
     26        * platform/ios-simulator-wk1/TestExpectations: Disable download tests until WK1 support
     27        is implemented.
     28        * platform/ios-simulator-wk2/TestExpectations: Disable download tests until
     29        NETWORK_SESSION support exists.
     30        * platform/mac/TestExpectations: Reactivate the HTMLAnchorElement tests.
     31        * platform/mac-wk1/TestExpectations: Disable download tests until WK1 support
     32        is implemented.
     33
    1342016-04-01  Ryan Haddad  <ryanhaddad@apple.com>
    235
  • trunk/LayoutTests/TestExpectations

    r198951 r198955  
    10241024fast/scrolling/rtl-scrollbars-listbox-simple.html [ ImageOnlyFailure ]
    10251025fast/scrolling/rtl-scrollbars-listbox.html [ ImageOnlyFailure ]
     1026
     1027# <a download> does not support Blobs
     1028webkit.org/b/156099 http/tests/security/anchor-download-allow-blob.html [ Failure ]
     1029
     1030# <a download> does not honor cross-origin restrictions
     1031webkit.org/b/156100 http/tests/security/anchor-download-block-crossorigin.html [ Failure ]
  • trunk/LayoutTests/fast/dom/HTMLAnchorElement/anchor-download-expected.txt

    r91797 r198955  
     1Download started.
     2Download failed.
     3Failed: NSURLErrorDomain, code=-1002, description=unsupported URL
    14Blob URL
  • trunk/LayoutTests/fast/dom/HTMLAnchorElement/anchor-nodownload-set-expected.txt

    r91797 r198955  
     1Download started.
     2Download failed.
     3Failed: NSURLErrorDomain, code=-1002, description=unsupported URL
    14Blob URL
  • trunk/LayoutTests/platform/ios-simulator-wk1/TestExpectations

    r198394 r198955  
    13461346
    13471347webkit.org/b/155495 compositing/visible-rect/animated-from-none.html [ Failure ]
     1348
     1349# <a download> is not support in WK1 yet.
     1350webkit.org/b/156069 http/tests/security/anchor-download-allow-blob.html [ Skip ]
     1351webkit.org/b/156069 http/tests/security/anchor-download-allow-data.html [ Skip ]
     1352webkit.org/b/156069 http/tests/security/anchor-download-allow-sameorigin.html [ Skip ]
     1353webkit.org/b/156069 http/tests/security/anchor-download-block-crossorigin.html [ Skip ]
  • trunk/LayoutTests/platform/ios-simulator-wk2/TestExpectations

    r198910 r198955  
    19561956
    19571957webkit.org/b/155948 transitions/cancel-transition.html [ Pass Failure ]
     1958
     1959# <a download> is not supported with NETWORK_SESSION yet.
     1960webkit.org/b/156067 http/tests/security/anchor-download-allow-blob.html [ Skip ]
     1961webkit.org/b/156067 http/tests/security/anchor-download-allow-data.html [ Skip ]
     1962webkit.org/b/156067 http/tests/security/anchor-download-allow-sameorigin.html [ Skip ]
     1963webkit.org/b/156067 http/tests/security/anchor-download-block-crossorigin.html [ Skip ]
  • trunk/LayoutTests/platform/mac-wk1/TestExpectations

    r198941 r198955  
    202202# This hit-test test doesn't work on DRT
    203203webkit.org/b/156084 accessibility/mac/video-tag-hit-test.html [ Skip ]
     204
     205# <a download> is not support in WK1 yet.
     206webkit.org/b/156069 fast/dom/HTMLAnchorElement/anchor-nodownload-set.html [ Failure ]
     207webkit.org/b/156069 fast/dom/HTMLAnchorElement/anchor-download.html [ Failure ]
     208webkit.org/b/156069 http/tests/security/anchor-download-allow-blob.html [ Skip ]
     209webkit.org/b/156069 http/tests/security/anchor-download-allow-data.html [ Skip ]
     210webkit.org/b/156069 http/tests/security/anchor-download-allow-sameorigin.html [ Skip ]
     211webkit.org/b/156069 http/tests/security/anchor-download-block-crossorigin.html [ Skip ]
  • trunk/LayoutTests/platform/mac/TestExpectations

    r198946 r198955  
    260260storage/storagequota-request-quota.html
    261261fast/workers/worker-storagequota-query-usage.html
    262 
    263 # Tests that require ENABLE(DOWNLOAD_ATTRIBUTE).
    264 fast/dom/HTMLAnchorElement/anchor-nodownload.html
    265 fast/dom/HTMLAnchorElement/anchor-download.html
    266 fast/dom/HTMLAnchorElement/anchor-nodownload-set.html
    267 fast/dom/HTMLAnchorElement/anchor-download-unset.html
    268262
    269263# HTTP 204 (No Content) should be ignored
  • trunk/Source/WebKit2/ChangeLog

    r198948 r198955  
     12016-04-01  Brent Fulgham  <bfulgham@apple.com>
     2
     3        Confirm <a download> satisfies specification criteria
     4        https://bugs.webkit.org/show_bug.cgi?id=156057
     5
     6        Reviewed by Andy Estes.
     7
     8        * WebProcess/InjectedBundle/API/c/WKBundleNavigationAction.cpp:
     9        (WKBundleNavigationActionGetHasDownloadAttribute): Added.
     10        * WebProcess/InjectedBundle/API/c/WKBundleNavigationActionPrivate.h:
     11        * WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp:
     12        (WebKit::InjectedBundleNavigationAction::InjectedBundleNavigationAction):
     13        * WebProcess/InjectedBundle/InjectedBundleNavigationAction.h:
     14        (WebKit::InjectedBundleNavigationAction::hasDownloadAttribute): Added.
     15
    1162016-04-01  Alex Christensen  <achristensen@webkit.org>
    217
  • trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNavigationAction.cpp

    r186664 r198955  
    7777    return toImpl(navigationActionRef)->shouldTryAppLinks();
    7878}
     79
     80WKStringRef WKBundleNavigationActionCopyDownloadAttribute(WKBundleNavigationActionRef navigationActionRef)
     81{
     82    return toCopiedAPI(toImpl(navigationActionRef)->downloadAttribute());
     83}
  • trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNavigationActionPrivate.h

    r186664 r198955  
    3535WK_EXPORT bool WKBundleNavigationActionGetShouldOpenExternalURLs(WKBundleNavigationActionRef);
    3636WK_EXPORT bool WKBundleNavigationActionGetShouldTryAppLinks(WKBundleNavigationActionRef);
     37WK_EXPORT WKStringRef WKBundleNavigationActionCopyDownloadAttribute(WKBundleNavigationActionRef);
    3738
    3839#ifdef __cplusplus
  • trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp

    r197150 r198955  
    11/*
    2  * Copyright (C) 2011 Apple Inc. All rights reserved.
     2 * Copyright (C) 2011-2016 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    9292    , m_modifiers(modifiersForNavigationAction(navigationAction))
    9393    , m_mouseButton(WebMouseEvent::NoButton)
     94    , m_downloadAttribute(navigationAction.downloadAttribute())
    9495    , m_shouldOpenExternalURLs(navigationAction.shouldOpenExternalURLsPolicy() == ShouldOpenExternalURLsPolicy::ShouldAllow || navigationAction.shouldOpenExternalURLsPolicy() == ShouldOpenExternalURLsPolicy::ShouldAllowExternalSchemes)
    9596    , m_shouldTryAppLinks(navigationAction.shouldOpenExternalURLsPolicy() == ShouldOpenExternalURLsPolicy::ShouldAllow)
  • trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleNavigationAction.h

    r186664 r198955  
    5959    bool shouldOpenExternalURLs() const { return m_shouldOpenExternalURLs; }
    6060    bool shouldTryAppLinks() const { return m_shouldTryAppLinks; }
     61    AtomicString downloadAttribute() const { return m_downloadAttribute; }
    6162
    6263private:
     
    6869    RefPtr<InjectedBundleHitTestResult> m_hitTestResult;
    6970    RefPtr<InjectedBundleNodeHandle> m_formElement;
     71    AtomicString m_downloadAttribute;
    7072    bool m_shouldOpenExternalURLs;
    7173    bool m_shouldTryAppLinks;
  • trunk/Tools/ChangeLog

    r198947 r198955  
     12016-04-01  Brent Fulgham  <bfulgham@apple.com>
     2
     3        Confirm <a download> satisfies specification criteria
     4        https://bugs.webkit.org/show_bug.cgi?id=156057
     5
     6        Reviewed by Andy Estes.
     7
     8        Revise WebKitTestRunner:
     9        (1) Provide a download client delegate.
     10        (2) Teach WKTR to wait to finish a test until a download finishes.
     11        (3) Allow WKTR to notify the current TestRunner that it can finish.
     12
     13        * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
     14        * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
     15        (WTR::InjectedBundle::didReceiveMessageToPage): Update to recognize a new
     16        message "NotifyDownloadDone".
     17        * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
     18        (WTR::InjectedBundlePage::decidePolicyForNavigationAction): Handle 'download'
     19        attribute case.
     20        * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
     21        (WTR::TestRunner::waitUntilDownload): Added.
     22        * WebKitTestRunner/InjectedBundle/TestRunner.h:
     23        (WTR::TestRunner::shouldFinishAfterDownload): Added.
     24        * WebKitTestRunner/TestController.cpp:
     25        (WTR::TestController::createWebViewWithOptions): Set up the download client.
     26        (WTR::TestController::downloadDidStart): Added.
     27        (WTR::TestController::decideDestinationWithSuggestedFilename): Added.
     28        (WTR::TestController::downloadDidFinish): Added.
     29        (WTR::TestController::downloadDidFail): Added.
     30        (WTR::TestController::downloadDidCancel): Added.
     31        * WebKitTestRunner/TestController.h:
     32        * WebKitTestRunner/TestInvocation.cpp:
     33        (WTR::TestInvocation::notifyDownloadDone): Added.
     34        * WebKitTestRunner/TestInvocation.h:
     35
    1362016-04-01  Alex Christensen  <achristensen@webkit.org>
    237
  • trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl

    r197114 r198955  
    3030    void waitForPolicyDelegate();
    3131    void waitUntilDone();
     32    void waitUntilDownloadFinished();
    3233    void notifyDone();
    3334    double preciseTime();
  • trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp

    r197921 r198955  
    11/*
    2  * Copyright (C) 2010, 2011, 2012 Apple Inc. All rights reserved.
     2 * Copyright (C) 2010-2016 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    237237    }
    238238
     239    if (WKStringIsEqualToUTF8CString(messageName, "NotifyDownloadDone")) {
     240        m_testRunner->notifyDone();
     241        return;
     242    }
     243
    239244    if (WKStringIsEqualToUTF8CString(messageName, "CallUISideScriptCallback")) {
    240245        WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody);
  • trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp

    r193924 r198955  
    11/*
    2  * Copyright (C) 2010, 2011, 2012 Apple Inc. All rights reserved.
     2 * Copyright (C) 2010-2016 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    13181318        return WKBundlePagePolicyActionPassThrough;
    13191319
    1320     if (!injectedBundle.testRunner()->isPolicyDelegateEnabled())
    1321         return WKBundlePagePolicyActionUse;
     1320    if (!injectedBundle.testRunner()->isPolicyDelegateEnabled()) {
     1321        WKRetainPtr<WKStringRef> downloadAttributeRef(AdoptWK, WKBundleNavigationActionCopyDownloadAttribute(navigationAction));
     1322        String downloadAttribute = toWTFString(downloadAttributeRef);
     1323        return downloadAttribute.isNull() ? WKBundlePagePolicyActionUse : WKBundlePagePolicyActionPassThrough;
     1324    }
    13221325
    13231326    WKRetainPtr<WKURLRef> url = adoptWK(WKURLRequestCopyURL(request));
  • trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp

    r197921 r198955  
    142142}
    143143
     144void TestRunner::waitUntilDownloadFinished()
     145{
     146    m_shouldFinishAfterDownload = true;
     147    waitUntilDone();
     148}
     149
    144150void TestRunner::waitUntilDone()
    145151{
  • trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h

    r197921 r198955  
    11/*
    2  * Copyright (C) 2010, 2011, 2012 Apple Inc. All rights reserved.
     2 * Copyright (C) 2010-2016 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    6868    void waitForPolicyDelegate();
    6969    void dumpChildFramesAsText() { m_whatToDump = AllFramesText; }
     70    void waitUntilDownloadFinished();
    7071    void waitUntilDone();
    7172    void notifyDone();
     
    196197    void waitToDumpWatchdogTimerFired();
    197198    void invalidateWaitToDumpWatchdogTimer();
     199    bool shouldFinishAfterDownload() const { return m_shouldFinishAfterDownload; }
    198200
    199201    bool shouldAllowEditing() const { return m_shouldAllowEditing; }
     
    290292
    291293    bool secureEventInputIsEnabled() const;
    292    
     294
    293295    JSValueRef failNextNewCodeBlock();
    294296    JSValueRef numberOfDFGCompiles(JSValueRef theFunction);
     
    365367
    366368    bool m_shouldDecideNavigationPolicyAfterDelay { false };
     369    bool m_shouldFinishAfterDownload { false };
    367370
    368371    bool m_userStyleSheetEnabled;
  • trunk/Tools/WebKitTestRunner/TestController.cpp

    r198189 r198955  
    11/*
    2  * Copyright (C) 2010, 2014-2015 Apple Inc. All rights reserved.
     2 * Copyright (C) 2010, 2014-2016 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    586586    WKPageSetPageNavigationClient(m_mainWebView->page(), &pageNavigationClient.base);
    587587
    588 
     588    WKContextDownloadClientV0 downloadClient = {
     589        { 0, this },
     590        downloadDidStart,
     591        0, // didReceiveAuthenticationChallenge
     592        0, // didReceiveResponse
     593        0, // didReceiveData
     594        0, // shouldDecodeSourceDataOfMIMEType
     595        decideDestinationWithSuggestedFilename,
     596        0, // didCreateDestination
     597        downloadDidFinish,
     598        downloadDidFail,
     599        downloadDidCancel,
     600        0 // processDidCrash;
     601    };
     602    WKContextSetDownloadClient(context(), &downloadClient.base);
     603   
    589604    // this should just be done on the page?
    590605    WKPageInjectedBundleClientV0 injectedBundleClient = {
     
    16291644}
    16301645
     1646   
     1647// WKContextDownloadClient
     1648
     1649void TestController::downloadDidStart(WKContextRef context, WKDownloadRef download, const void* clientInfo)
     1650{
     1651    static_cast<TestController*>(const_cast<void*>(clientInfo))->downloadDidStart(context, download);
     1652}
     1653   
     1654WKStringRef TestController::decideDestinationWithSuggestedFilename(WKContextRef context, WKDownloadRef download, WKStringRef filename, bool* allowOverwrite, const void* clientInfo)
     1655{
     1656    return static_cast<TestController*>(const_cast<void*>(clientInfo))->decideDestinationWithSuggestedFilename(context, download, filename, allowOverwrite);
     1657}
     1658
     1659void TestController::downloadDidFinish(WKContextRef context, WKDownloadRef download, const void* clientInfo)
     1660{
     1661    static_cast<TestController*>(const_cast<void*>(clientInfo))->downloadDidFinish(context, download);
     1662}
     1663
     1664void TestController::downloadDidFail(WKContextRef context, WKDownloadRef download, WKErrorRef error, const void* clientInfo)
     1665{
     1666    static_cast<TestController*>(const_cast<void*>(clientInfo))->downloadDidFail(context, download, error);
     1667}
     1668
     1669void TestController::downloadDidCancel(WKContextRef context, WKDownloadRef download, const void* clientInfo)
     1670{
     1671    static_cast<TestController*>(const_cast<void*>(clientInfo))->downloadDidCancel(context, download);
     1672}
     1673
     1674void TestController::downloadDidStart(WKContextRef context, WKDownloadRef download)
     1675{
     1676    m_currentInvocation->outputText("Download started.\n");
     1677}
     1678
     1679WKStringRef TestController::decideDestinationWithSuggestedFilename(WKContextRef, WKDownloadRef, WKStringRef filename, bool*& allowOverwrite)
     1680{
     1681    StringBuilder builder;
     1682    builder.append("Downloading URL with suggested filename \"");
     1683    builder.append(toWTFString(filename));
     1684    builder.append("\"\n");
     1685
     1686    m_currentInvocation->outputText(builder.toString());
     1687
     1688    return nullptr;
     1689}
     1690
     1691void TestController::downloadDidFinish(WKContextRef, WKDownloadRef)
     1692{
     1693    m_currentInvocation->outputText("Download completed.\n");
     1694    m_currentInvocation->notifyDownloadDone();
     1695}
     1696
     1697void TestController::downloadDidFail(WKContextRef, WKDownloadRef, WKErrorRef error)
     1698{
     1699    String message = String::format("Download failed.\n");
     1700    m_currentInvocation->outputText(message);
     1701   
     1702    WKRetainPtr<WKStringRef> errorDomain = adoptWK(WKErrorCopyDomain(error));
     1703    WKRetainPtr<WKStringRef> errorDescription = adoptWK(WKErrorCopyLocalizedDescription(error));
     1704    int errorCode = WKErrorGetErrorCode(error);
     1705
     1706    StringBuilder errorBuilder;
     1707    errorBuilder.append("Failed: ");
     1708    errorBuilder.append(toWTFString(errorDomain));
     1709    errorBuilder.append(", code=");
     1710    errorBuilder.appendNumber(errorCode);
     1711    errorBuilder.append(", description=");
     1712    errorBuilder.append(toWTFString(errorDescription));
     1713    errorBuilder.append("\n");
     1714
     1715    m_currentInvocation->outputText(errorBuilder.toString());
     1716    m_currentInvocation->notifyDownloadDone();
     1717}
     1718
     1719void TestController::downloadDidCancel(WKContextRef, WKDownloadRef)
     1720{
     1721    m_currentInvocation->outputText("Download cancelled.\n");
     1722    m_currentInvocation->notifyDownloadDone();
     1723}
     1724
    16311725void TestController::processDidCrash()
    16321726{
  • trunk/Tools/WebKitTestRunner/TestController.h

    r197956 r198955  
    204204    void didFinishNavigation(WKPageRef, WKNavigationRef);
    205205
     206   
     207    // WKContextDownloadClient
     208    static void downloadDidStart(WKContextRef, WKDownloadRef, const void*);
     209    void downloadDidStart(WKContextRef, WKDownloadRef);
     210    static WKStringRef decideDestinationWithSuggestedFilename(WKContextRef, WKDownloadRef, WKStringRef filename, bool* allowOverwrite, const void *clientInfo);
     211    WKStringRef decideDestinationWithSuggestedFilename(WKContextRef, WKDownloadRef, WKStringRef filename, bool*& allowOverwrite);
     212    static void downloadDidFinish(WKContextRef, WKDownloadRef, const void*);
     213    void downloadDidFinish(WKContextRef, WKDownloadRef);
     214    static void downloadDidFail(WKContextRef, WKDownloadRef, WKErrorRef, const void*);
     215    void downloadDidFail(WKContextRef, WKDownloadRef, WKErrorRef);
     216    static void downloadDidCancel(WKContextRef, WKDownloadRef, const void*);
     217    void downloadDidCancel(WKContextRef, WKDownloadRef);
     218   
    206219    static void processDidCrash(WKPageRef, const void* clientInfo);
    207220    void processDidCrash();
  • trunk/Tools/WebKitTestRunner/TestInvocation.cpp

    r197114 r198955  
    763763}
    764764
     765void TestInvocation::notifyDownloadDone()
     766{
     767    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("NotifyDownloadDone"));
     768    WKPagePostMessageToInjectedBundle(TestController::singleton().mainWebView()->page(), messageName.get(), 0);
     769}
     770
    765771} // namespace WTR
  • trunk/Tools/WebKitTestRunner/TestInvocation.h

    r194721 r198955  
    6666    void didRemoveSwipeSnapshot();
    6767
     68    void notifyDownloadDone();
     69
    6870private:
    6971    void dumpResults();
Note: See TracChangeset for help on using the changeset viewer.