Changeset 198955 in webkit
- Timestamp:
- Apr 1, 2016 2:10:41 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 9 added
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r198954 r198955 1 2016-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 1 34 2016-04-01 Ryan Haddad <ryanhaddad@apple.com> 2 35 -
trunk/LayoutTests/TestExpectations
r198951 r198955 1024 1024 fast/scrolling/rtl-scrollbars-listbox-simple.html [ ImageOnlyFailure ] 1025 1025 fast/scrolling/rtl-scrollbars-listbox.html [ ImageOnlyFailure ] 1026 1027 # <a download> does not support Blobs 1028 webkit.org/b/156099 http/tests/security/anchor-download-allow-blob.html [ Failure ] 1029 1030 # <a download> does not honor cross-origin restrictions 1031 webkit.org/b/156100 http/tests/security/anchor-download-block-crossorigin.html [ Failure ] -
trunk/LayoutTests/fast/dom/HTMLAnchorElement/anchor-download-expected.txt
r91797 r198955 1 Download started. 2 Download failed. 3 Failed: NSURLErrorDomain, code=-1002, description=unsupported URL 1 4 Blob URL -
trunk/LayoutTests/fast/dom/HTMLAnchorElement/anchor-nodownload-set-expected.txt
r91797 r198955 1 Download started. 2 Download failed. 3 Failed: NSURLErrorDomain, code=-1002, description=unsupported URL 1 4 Blob URL -
trunk/LayoutTests/platform/ios-simulator-wk1/TestExpectations
r198394 r198955 1346 1346 1347 1347 webkit.org/b/155495 compositing/visible-rect/animated-from-none.html [ Failure ] 1348 1349 # <a download> is not support in WK1 yet. 1350 webkit.org/b/156069 http/tests/security/anchor-download-allow-blob.html [ Skip ] 1351 webkit.org/b/156069 http/tests/security/anchor-download-allow-data.html [ Skip ] 1352 webkit.org/b/156069 http/tests/security/anchor-download-allow-sameorigin.html [ Skip ] 1353 webkit.org/b/156069 http/tests/security/anchor-download-block-crossorigin.html [ Skip ] -
trunk/LayoutTests/platform/ios-simulator-wk2/TestExpectations
r198910 r198955 1956 1956 1957 1957 webkit.org/b/155948 transitions/cancel-transition.html [ Pass Failure ] 1958 1959 # <a download> is not supported with NETWORK_SESSION yet. 1960 webkit.org/b/156067 http/tests/security/anchor-download-allow-blob.html [ Skip ] 1961 webkit.org/b/156067 http/tests/security/anchor-download-allow-data.html [ Skip ] 1962 webkit.org/b/156067 http/tests/security/anchor-download-allow-sameorigin.html [ Skip ] 1963 webkit.org/b/156067 http/tests/security/anchor-download-block-crossorigin.html [ Skip ] -
trunk/LayoutTests/platform/mac-wk1/TestExpectations
r198941 r198955 202 202 # This hit-test test doesn't work on DRT 203 203 webkit.org/b/156084 accessibility/mac/video-tag-hit-test.html [ Skip ] 204 205 # <a download> is not support in WK1 yet. 206 webkit.org/b/156069 fast/dom/HTMLAnchorElement/anchor-nodownload-set.html [ Failure ] 207 webkit.org/b/156069 fast/dom/HTMLAnchorElement/anchor-download.html [ Failure ] 208 webkit.org/b/156069 http/tests/security/anchor-download-allow-blob.html [ Skip ] 209 webkit.org/b/156069 http/tests/security/anchor-download-allow-data.html [ Skip ] 210 webkit.org/b/156069 http/tests/security/anchor-download-allow-sameorigin.html [ Skip ] 211 webkit.org/b/156069 http/tests/security/anchor-download-block-crossorigin.html [ Skip ] -
trunk/LayoutTests/platform/mac/TestExpectations
r198946 r198955 260 260 storage/storagequota-request-quota.html 261 261 fast/workers/worker-storagequota-query-usage.html 262 263 # Tests that require ENABLE(DOWNLOAD_ATTRIBUTE).264 fast/dom/HTMLAnchorElement/anchor-nodownload.html265 fast/dom/HTMLAnchorElement/anchor-download.html266 fast/dom/HTMLAnchorElement/anchor-nodownload-set.html267 fast/dom/HTMLAnchorElement/anchor-download-unset.html268 262 269 263 # HTTP 204 (No Content) should be ignored -
trunk/Source/WebKit2/ChangeLog
r198948 r198955 1 2016-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 1 16 2016-04-01 Alex Christensen <achristensen@webkit.org> 2 17 -
trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNavigationAction.cpp
r186664 r198955 77 77 return toImpl(navigationActionRef)->shouldTryAppLinks(); 78 78 } 79 80 WKStringRef WKBundleNavigationActionCopyDownloadAttribute(WKBundleNavigationActionRef navigationActionRef) 81 { 82 return toCopiedAPI(toImpl(navigationActionRef)->downloadAttribute()); 83 } -
trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNavigationActionPrivate.h
r186664 r198955 35 35 WK_EXPORT bool WKBundleNavigationActionGetShouldOpenExternalURLs(WKBundleNavigationActionRef); 36 36 WK_EXPORT bool WKBundleNavigationActionGetShouldTryAppLinks(WKBundleNavigationActionRef); 37 WK_EXPORT WKStringRef WKBundleNavigationActionCopyDownloadAttribute(WKBundleNavigationActionRef); 37 38 38 39 #ifdef __cplusplus -
trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp
r197150 r198955 1 1 /* 2 * Copyright (C) 2011 Apple Inc. All rights reserved.2 * Copyright (C) 2011-2016 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 92 92 , m_modifiers(modifiersForNavigationAction(navigationAction)) 93 93 , m_mouseButton(WebMouseEvent::NoButton) 94 , m_downloadAttribute(navigationAction.downloadAttribute()) 94 95 , m_shouldOpenExternalURLs(navigationAction.shouldOpenExternalURLsPolicy() == ShouldOpenExternalURLsPolicy::ShouldAllow || navigationAction.shouldOpenExternalURLsPolicy() == ShouldOpenExternalURLsPolicy::ShouldAllowExternalSchemes) 95 96 , m_shouldTryAppLinks(navigationAction.shouldOpenExternalURLsPolicy() == ShouldOpenExternalURLsPolicy::ShouldAllow) -
trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleNavigationAction.h
r186664 r198955 59 59 bool shouldOpenExternalURLs() const { return m_shouldOpenExternalURLs; } 60 60 bool shouldTryAppLinks() const { return m_shouldTryAppLinks; } 61 AtomicString downloadAttribute() const { return m_downloadAttribute; } 61 62 62 63 private: … … 68 69 RefPtr<InjectedBundleHitTestResult> m_hitTestResult; 69 70 RefPtr<InjectedBundleNodeHandle> m_formElement; 71 AtomicString m_downloadAttribute; 70 72 bool m_shouldOpenExternalURLs; 71 73 bool m_shouldTryAppLinks; -
trunk/Tools/ChangeLog
r198947 r198955 1 2016-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 1 36 2016-04-01 Alex Christensen <achristensen@webkit.org> 2 37 -
trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl
r197114 r198955 30 30 void waitForPolicyDelegate(); 31 31 void waitUntilDone(); 32 void waitUntilDownloadFinished(); 32 33 void notifyDone(); 33 34 double preciseTime(); -
trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
r197921 r198955 1 1 /* 2 * Copyright (C) 2010 , 2011, 2012Apple Inc. All rights reserved.2 * Copyright (C) 2010-2016 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 237 237 } 238 238 239 if (WKStringIsEqualToUTF8CString(messageName, "NotifyDownloadDone")) { 240 m_testRunner->notifyDone(); 241 return; 242 } 243 239 244 if (WKStringIsEqualToUTF8CString(messageName, "CallUISideScriptCallback")) { 240 245 WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody); -
trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
r193924 r198955 1 1 /* 2 * Copyright (C) 2010 , 2011, 2012Apple Inc. All rights reserved.2 * Copyright (C) 2010-2016 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 1318 1318 return WKBundlePagePolicyActionPassThrough; 1319 1319 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 } 1322 1325 1323 1326 WKRetainPtr<WKURLRef> url = adoptWK(WKURLRequestCopyURL(request)); -
trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
r197921 r198955 142 142 } 143 143 144 void TestRunner::waitUntilDownloadFinished() 145 { 146 m_shouldFinishAfterDownload = true; 147 waitUntilDone(); 148 } 149 144 150 void TestRunner::waitUntilDone() 145 151 { -
trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h
r197921 r198955 1 1 /* 2 * Copyright (C) 2010 , 2011, 2012Apple Inc. All rights reserved.2 * Copyright (C) 2010-2016 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 68 68 void waitForPolicyDelegate(); 69 69 void dumpChildFramesAsText() { m_whatToDump = AllFramesText; } 70 void waitUntilDownloadFinished(); 70 71 void waitUntilDone(); 71 72 void notifyDone(); … … 196 197 void waitToDumpWatchdogTimerFired(); 197 198 void invalidateWaitToDumpWatchdogTimer(); 199 bool shouldFinishAfterDownload() const { return m_shouldFinishAfterDownload; } 198 200 199 201 bool shouldAllowEditing() const { return m_shouldAllowEditing; } … … 290 292 291 293 bool secureEventInputIsEnabled() const; 292 294 293 295 JSValueRef failNextNewCodeBlock(); 294 296 JSValueRef numberOfDFGCompiles(JSValueRef theFunction); … … 365 367 366 368 bool m_shouldDecideNavigationPolicyAfterDelay { false }; 369 bool m_shouldFinishAfterDownload { false }; 367 370 368 371 bool m_userStyleSheetEnabled; -
trunk/Tools/WebKitTestRunner/TestController.cpp
r198189 r198955 1 1 /* 2 * Copyright (C) 2010, 2014-201 5Apple Inc. All rights reserved.2 * Copyright (C) 2010, 2014-2016 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 586 586 WKPageSetPageNavigationClient(m_mainWebView->page(), &pageNavigationClient.base); 587 587 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 589 604 // this should just be done on the page? 590 605 WKPageInjectedBundleClientV0 injectedBundleClient = { … … 1629 1644 } 1630 1645 1646 1647 // WKContextDownloadClient 1648 1649 void TestController::downloadDidStart(WKContextRef context, WKDownloadRef download, const void* clientInfo) 1650 { 1651 static_cast<TestController*>(const_cast<void*>(clientInfo))->downloadDidStart(context, download); 1652 } 1653 1654 WKStringRef 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 1659 void TestController::downloadDidFinish(WKContextRef context, WKDownloadRef download, const void* clientInfo) 1660 { 1661 static_cast<TestController*>(const_cast<void*>(clientInfo))->downloadDidFinish(context, download); 1662 } 1663 1664 void 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 1669 void TestController::downloadDidCancel(WKContextRef context, WKDownloadRef download, const void* clientInfo) 1670 { 1671 static_cast<TestController*>(const_cast<void*>(clientInfo))->downloadDidCancel(context, download); 1672 } 1673 1674 void TestController::downloadDidStart(WKContextRef context, WKDownloadRef download) 1675 { 1676 m_currentInvocation->outputText("Download started.\n"); 1677 } 1678 1679 WKStringRef 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 1691 void TestController::downloadDidFinish(WKContextRef, WKDownloadRef) 1692 { 1693 m_currentInvocation->outputText("Download completed.\n"); 1694 m_currentInvocation->notifyDownloadDone(); 1695 } 1696 1697 void 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 1719 void TestController::downloadDidCancel(WKContextRef, WKDownloadRef) 1720 { 1721 m_currentInvocation->outputText("Download cancelled.\n"); 1722 m_currentInvocation->notifyDownloadDone(); 1723 } 1724 1631 1725 void TestController::processDidCrash() 1632 1726 { -
trunk/Tools/WebKitTestRunner/TestController.h
r197956 r198955 204 204 void didFinishNavigation(WKPageRef, WKNavigationRef); 205 205 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 206 219 static void processDidCrash(WKPageRef, const void* clientInfo); 207 220 void processDidCrash(); -
trunk/Tools/WebKitTestRunner/TestInvocation.cpp
r197114 r198955 763 763 } 764 764 765 void TestInvocation::notifyDownloadDone() 766 { 767 WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("NotifyDownloadDone")); 768 WKPagePostMessageToInjectedBundle(TestController::singleton().mainWebView()->page(), messageName.get(), 0); 769 } 770 765 771 } // namespace WTR -
trunk/Tools/WebKitTestRunner/TestInvocation.h
r194721 r198955 66 66 void didRemoveSwipeSnapshot(); 67 67 68 void notifyDownloadDone(); 69 68 70 private: 69 71 void dumpResults();
Note: See TracChangeset
for help on using the changeset viewer.