Changeset 268261 in webkit
- Timestamp:
- Oct 9, 2020, 9:24:25 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r268257 r268261 1 2020-10-09 Alex Christensen <achristensen@webkit.org> 2 3 Use sendWithAsyncReply for NetworkProcess::CancelDownload 4 https://bugs.webkit.org/show_bug.cgi?id=217420 5 6 Reviewed by Youenn Fablet. 7 8 This paves the way for a good download API that has a completion handler when you call cancel that gives you the resume data if it can. 9 Currently you have to call cancel on the download, wait for didCancel on the delegate, then get the resume data from the download again. 10 This has the side effect of DownloadMonitor cancellations calling didFailWithError instead of didCancel, which makes sense and shouldn't 11 cause any problems in practice. Safari is the only API client that uses this, and it behaves similarly in didCancel and didFailWithError. 12 13 * NetworkProcess/Downloads/Download.cpp: 14 (WebKit::Download::cancel): 15 (WebKit::Download::didCancel): 16 * NetworkProcess/Downloads/Download.h: 17 * NetworkProcess/Downloads/DownloadManager.cpp: 18 (WebKit::DownloadManager::cancelDownload): 19 * NetworkProcess/Downloads/DownloadManager.h: 20 * NetworkProcess/Downloads/DownloadMonitor.cpp: 21 (WebKit::DownloadMonitor::timerFired): 22 * NetworkProcess/Downloads/PendingDownload.cpp: 23 (WebKit::PendingDownload::cancel): 24 * NetworkProcess/Downloads/PendingDownload.h: 25 * NetworkProcess/Downloads/cocoa/WKDownloadProgress.mm: 26 (-[WKDownloadProgress performCancel]): 27 * NetworkProcess/NetworkProcess.cpp: 28 (WebKit::NetworkProcess::cancelDownload): 29 (WebKit::NetworkProcess::findPendingDownloadLocation): 30 (WebKit::NetworkProcess::pendingDownloadCanceled): Deleted. 31 * NetworkProcess/NetworkProcess.h: 32 * NetworkProcess/NetworkProcess.messages.in: 33 * UIProcess/Downloads/DownloadProxy.cpp: 34 (WebKit::createData): 35 (WebKit::DownloadProxy::cancel): 36 (WebKit::DownloadProxy::didCancel): Deleted. 37 * UIProcess/Downloads/DownloadProxy.h: 38 * UIProcess/Downloads/DownloadProxy.messages.in: 39 1 40 2020-10-09 Youenn Fablet <youenn@apple.com> 2 41 -
trunk/Source/WebKit/NetworkProcess/Downloads/Download.cpp
r268017 r268261 87 87 } 88 88 89 void Download::cancel( )89 void Download::cancel(CompletionHandler<void(const IPC::DataReference&)>&& completionHandler, IgnoreDidFailCallback ignoreDidFailCallback) 90 90 { 91 91 RELEASE_ASSERT(isMainThread()); 92 92 93 if (m_wasCanceled) 94 return; 95 m_wasCanceled = true; 93 // URLSession:task:didCompleteWithError: is still called after cancelByProducingResumeData's completionHandler. 94 // If this cancel request came from the API, we do not want to send DownloadProxy::DidFail because the 95 // completionHandler will inform the API that the cancellation succeeded. 96 m_ignoreDidFailCallback = ignoreDidFailCallback; 97 98 auto completionHandlerWrapper = [this, weakThis = makeWeakPtr(*this), completionHandler = WTFMove(completionHandler)] (const IPC::DataReference& resumeData) mutable { 99 completionHandler(resumeData); 100 if (!weakThis || m_ignoreDidFailCallback == IgnoreDidFailCallback::No) 101 return; 102 RELEASE_LOG_IF_ALLOWED("didCancel: (id = %" PRIu64 ")", downloadID().toUInt64()); 103 if (auto extension = std::exchange(m_sandboxExtension, nullptr)) 104 extension->revoke(); 105 m_downloadManager.downloadFinished(*this); 106 }; 96 107 97 108 if (m_download) { 98 109 m_download->cancel(); 99 didCancel({ });110 completionHandlerWrapper({ }); 100 111 return; 101 112 } 102 platformCancelNetworkLoad( );113 platformCancelNetworkLoad(WTFMove(completionHandlerWrapper)); 103 114 } 104 115 … … 146 157 void Download::didFail(const ResourceError& error, const IPC::DataReference& resumeData) 147 158 { 159 if (m_ignoreDidFailCallback == IgnoreDidFailCallback::Yes) 160 return; 161 148 162 RELEASE_LOG_IF_ALLOWED("didFail: (id = %" PRIu64 ", isTimeout = %d, isCancellation = %d, errCode = %d)", 149 163 downloadID().toUInt64(), error.isTimeout(), error.isCancellation(), error.errorCode()); 150 164 151 165 send(Messages::DownloadProxy::DidFail(error, resumeData)); 152 153 if (m_sandboxExtension) {154 m_sandboxExtension->revoke();155 m_sandboxExtension = nullptr;156 }157 m_downloadManager.downloadFinished(*this);158 }159 160 void Download::didCancel(const IPC::DataReference& resumeData)161 {162 RELEASE_LOG_IF_ALLOWED("didCancel: (id = %" PRIu64 ")", downloadID().toUInt64());163 164 send(Messages::DownloadProxy::DidCancel(resumeData));165 166 166 167 if (m_sandboxExtension) { … … 191 192 192 193 #if !PLATFORM(COCOA) 193 void Download::platformCancelNetworkLoad() 194 { 194 void Download::platformCancelNetworkLoad(CompletionHandler<void(const IPC::DataReference&)>&& completionHandler) 195 { 196 completionHandler({ }); 195 197 } 196 198 -
trunk/Source/WebKit/NetworkProcess/Downloads/Download.h
r261898 r268261 77 77 78 78 void resume(const IPC::DataReference& resumeData, const String& path, SandboxExtension::Handle&&); 79 void cancel(); 79 enum class IgnoreDidFailCallback : bool { No, Yes }; 80 void cancel(CompletionHandler<void(const IPC::DataReference&)>&&, IgnoreDidFailCallback); 80 81 #if PLATFORM(COCOA) 81 82 void publishProgress(const URL&, SandboxExtension::Handle&&); … … 92 93 void didFinish(); 93 94 void didFail(const WebCore::ResourceError&, const IPC::DataReference& resumeData); 94 void didCancel(const IPC::DataReference& resumeData);95 95 96 96 bool isAlwaysOnLoggingAllowed() const; 97 bool wasCanceled() const { return m_wasCanceled; }98 97 99 98 void applicationDidEnterBackground() { m_monitor.applicationDidEnterBackground(); } … … 108 107 uint64_t messageSenderDestinationID() const override; 109 108 110 void platformCancelNetworkLoad( );109 void platformCancelNetworkLoad(CompletionHandler<void(const IPC::DataReference&)>&&); 111 110 void platformDestroyDownload(); 112 111 … … 125 124 PAL::SessionID m_sessionID; 126 125 String m_suggestedName; 127 bool m_wasCanceled { false };128 126 bool m_hasReceivedData { false }; 127 IgnoreDidFailCallback m_ignoreDidFailCallback { IgnoreDidFailCallback::No }; 129 128 DownloadMonitor m_monitor { *this }; 130 129 unsigned m_testSpeedMultiplier { 1 }; 130 CompletionHandler<void(const IPC::DataReference&)> m_cancelCompletionHandler; 131 131 }; 132 132 -
trunk/Source/WebKit/NetworkProcess/Downloads/DownloadManager.cpp
r268008 r268261 110 110 } 111 111 112 void DownloadManager::cancelDownload(DownloadID downloadID )112 void DownloadManager::cancelDownload(DownloadID downloadID, CompletionHandler<void(const IPC::DataReference&)>&& completionHandler) 113 113 { 114 114 if (auto* download = m_downloads.get(downloadID)) { 115 115 ASSERT(!m_pendingDownloads.contains(downloadID)); 116 download->cancel( );116 download->cancel(WTFMove(completionHandler), Download::IgnoreDidFailCallback::Yes); 117 117 return; 118 118 } 119 if (auto pendingDownload = m_pendingDownloads.take(downloadID)) 120 pendingDownload->cancel(); 119 if (auto pendingDownload = m_pendingDownloads.take(downloadID)) { 120 pendingDownload->cancel(WTFMove(completionHandler)); 121 return; 122 } 123 ASSERT_NOT_REACHED(); 124 completionHandler({ }); 121 125 } 122 126 -
trunk/Source/WebKit/NetworkProcess/Downloads/DownloadManager.h
r268008 r268261 74 74 virtual IPC::Connection* parentProcessConnectionForDownloads() = 0; 75 75 virtual AuthenticationManager& downloadsAuthenticationManager() = 0; 76 virtual void pendingDownloadCanceled(DownloadID) = 0;77 76 virtual NetworkSession* networkSession(PAL::SessionID) const = 0; 78 77 virtual void ref() const = 0; … … 90 89 void resumeDownload(PAL::SessionID, DownloadID, const IPC::DataReference& resumeData, const String& path, SandboxExtension::Handle&&); 91 90 92 void cancelDownload(DownloadID );91 void cancelDownload(DownloadID, CompletionHandler<void(const IPC::DataReference&)>&&); 93 92 #if PLATFORM(COCOA) 94 93 void publishDownloadProgress(DownloadID, const URL&, SandboxExtension::Handle&&); -
trunk/Source/WebKit/NetworkProcess/Downloads/DownloadMonitor.cpp
r268017 r268261 119 119 if (measuredThroughputRate() < throughputIntervals[m_interval].bytesPerSecond) { 120 120 RELEASE_LOG_IF_ALLOWED("timerFired: cancelling download (id = %" PRIu64 ")", m_download.downloadID().toUInt64()); 121 m_download.cancel( );121 m_download.cancel([](auto&) { }, Download::IgnoreDidFailCallback::No); 122 122 } else if (m_interval + 1 < WTF_ARRAY_LENGTH(throughputIntervals)) { 123 123 RELEASE_LOG_IF_ALLOWED("timerFired: sufficient throughput rate (id = %" PRIu64 ")", m_download.downloadID().toUInt64()); -
trunk/Source/WebKit/NetworkProcess/Downloads/PendingDownload.cpp
r268017 r268261 73 73 } 74 74 75 void PendingDownload::cancel( )75 void PendingDownload::cancel(CompletionHandler<void(const IPC::DataReference&)>&& completionHandler) 76 76 { 77 77 ASSERT(m_networkLoad); 78 78 m_networkLoad->cancel(); 79 send(Messages::DownloadProxy::DidCancel({ }));79 completionHandler({ }); 80 80 } 81 81 -
trunk/Source/WebKit/NetworkProcess/Downloads/PendingDownload.h
r268017 r268261 54 54 55 55 void continueWillSendRequest(WebCore::ResourceRequest&&); 56 void cancel( );56 void cancel(CompletionHandler<void(const IPC::DataReference&)>&&); 57 57 58 58 #if PLATFORM(COCOA) -
trunk/Source/WebKit/NetworkProcess/Downloads/cocoa/DownloadCocoa.mm
r261153 r268261 32 32 #import <pal/spi/cf/CFNetworkSPI.h> 33 33 #import <pal/spi/cocoa/NSProgressSPI.h> 34 #import <wtf/BlockPtr.h> 34 35 35 36 namespace WebKit { … … 80 81 } 81 82 82 void Download::platformCancelNetworkLoad( )83 void Download::platformCancelNetworkLoad(CompletionHandler<void(const IPC::DataReference&)>&& completionHandler) 83 84 { 84 85 ASSERT(m_downloadTask); 85 86 // The download's resume data is accessed in the network session delegate 87 // method -URLSession:task:didCompleteWithError: instead of inside this block, 88 // to avoid race conditions between the two. Calling -cancel is not sufficient 89 // here because CFNetwork won't provide the resume data unless we ask for it. 90 [m_downloadTask cancelByProducingResumeData:^(NSData *resumeData) { 91 UNUSED_PARAM(resumeData); 92 }]; 86 [m_downloadTask cancelByProducingResumeData:makeBlockPtr([completionHandler = WTFMove(completionHandler)] (NSData *resumeData) mutable { 87 auto resumeDataReference = resumeData ? IPC::DataReference { static_cast<const uint8_t*>(resumeData.bytes), resumeData.length } : IPC::DataReference { }; 88 completionHandler(resumeDataReference); 89 }).get()]; 93 90 } 94 91 -
trunk/Source/WebKit/NetworkProcess/Downloads/cocoa/WKDownloadProgress.mm
r255455 r268261 47 47 { 48 48 if (m_download) 49 m_download->cancel( );49 m_download->cancel([](auto&) { }, WebKit::Download::IgnoreDidFailCallback::No); 50 50 m_download = nullptr; 51 51 } -
trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp
r268017 r268261 2072 2072 } 2073 2073 2074 void NetworkProcess::cancelDownload(DownloadID downloadID )2075 { 2076 downloadManager().cancelDownload(downloadID );2074 void NetworkProcess::cancelDownload(DownloadID downloadID, CompletionHandler<void(const IPC::DataReference&)>&& completionHandler) 2075 { 2076 downloadManager().cancelDownload(downloadID, WTFMove(completionHandler)); 2077 2077 } 2078 2078 … … 2087 2087 { 2088 2088 downloadManager().continueWillSendRequest(downloadID, WTFMove(request)); 2089 }2090 2091 void NetworkProcess::pendingDownloadCanceled(DownloadID downloadID)2092 {2093 downloadProxyConnection()->send(Messages::DownloadProxy::DidCancel({ }), downloadID.toUInt64());2094 2089 } 2095 2090 … … 2106 2101 downloadProxyConnection()->sendWithAsyncReply(Messages::DownloadProxy::DecideDestinationWithSuggestedFilename(suggestedFilename), [this, protectedThis = makeRef(*this), completionHandler = WTFMove(completionHandler), networkDataTask = makeRef(networkDataTask)] (String&& destination, SandboxExtension::Handle&& sandboxExtensionHandle, AllowOverwrite allowOverwrite) mutable { 2107 2102 auto downloadID = networkDataTask->pendingDownloadID(); 2108 if (destination.isEmpty()) { 2109 downloadManager().cancelDownload(downloadID); 2110 completionHandler(PolicyAction::Ignore); 2111 return; 2112 } 2103 if (destination.isEmpty()) 2104 return completionHandler(PolicyAction::Ignore); 2113 2105 networkDataTask->setPendingDownloadLocation(destination, WTFMove(sandboxExtensionHandle), allowOverwrite == AllowOverwrite::Yes); 2114 2106 completionHandler(PolicyAction::Download); -
trunk/Source/WebKit/NetworkProcess/NetworkProcess.h
r268017 r268261 404 404 IPC::Connection* parentProcessConnectionForDownloads() override { return parentProcessConnection(); } 405 405 AuthenticationManager& downloadsAuthenticationManager() override; 406 void pendingDownloadCanceled(DownloadID) override;407 406 408 407 // Message Handlers … … 425 424 void downloadRequest(PAL::SessionID, DownloadID, const WebCore::ResourceRequest&, Optional<NavigatingToAppBoundDomain>, const String& suggestedFilename); 426 425 void resumeDownload(PAL::SessionID, DownloadID, const IPC::DataReference& resumeData, const String& path, SandboxExtension::Handle&&); 427 void cancelDownload(DownloadID );426 void cancelDownload(DownloadID, CompletionHandler<void(const IPC::DataReference&)>&&); 428 427 #if PLATFORM(COCOA) 429 428 void publishDownloadProgress(DownloadID, const URL&, SandboxExtension::Handle&&); -
trunk/Source/WebKit/NetworkProcess/NetworkProcess.messages.in
r268008 r268261 52 52 DownloadRequest(PAL::SessionID sessionID, WebKit::DownloadID downloadID, WebCore::ResourceRequest request, enum:bool Optional<WebKit::NavigatingToAppBoundDomain> isNavigatingToAppBoundDomain, String suggestedFilename) 53 53 ResumeDownload(PAL::SessionID sessionID, WebKit::DownloadID downloadID, IPC::DataReference resumeData, String path, WebKit::SandboxExtension::Handle sandboxExtensionHandle) 54 CancelDownload(WebKit::DownloadID downloadID) 54 CancelDownload(WebKit::DownloadID downloadID) -> (IPC::DataReference resumeData) Async 55 55 #if PLATFORM(COCOA) 56 56 PublishDownloadProgress(WebKit::DownloadID downloadID, URL url, WebKit::SandboxExtension::Handle sandboxExtensionHandle) -
trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm
r268017 r268261 770 770 771 771 auto resumeDataReference = resumeData ? IPC::DataReference { static_cast<const uint8_t*>(resumeData.bytes), resumeData.length } : IPC::DataReference { }; 772 773 if (download->wasCanceled()) 774 download->didCancel(resumeDataReference); 775 else 776 download->didFail(error, resumeDataReference); 772 download->didFail(error, resumeDataReference); 777 773 } 778 774 } -
trunk/Source/WebKit/UIProcess/Downloads/DownloadProxy.cpp
r268065 r268261 62 62 DownloadProxy::~DownloadProxy() = default; 63 63 64 static RefPtr<API::Data> createData(const IPC::DataReference& data) 65 { 66 if (data.isEmpty()) 67 return nullptr; 68 return API::Data::create(data.data(), data.size()); 69 } 70 64 71 void DownloadProxy::cancel() 65 72 { 66 if (m_dataStore) 67 m_dataStore->networkProcess().send(Messages::NetworkProcess::CancelDownload(m_downloadID), 0); 73 if (m_dataStore) { 74 m_dataStore->networkProcess().sendWithAsyncReply(Messages::NetworkProcess::CancelDownload(m_downloadID), [this, protectedThis = makeRef(*this)] (const IPC::DataReference& resumeData) { 75 m_resumeData = createData(resumeData); 76 m_client->didCancel(*this); 77 m_downloadProxyMap.downloadFinished(*this); 78 }); 79 } 68 80 } 69 81 … … 162 174 } 163 175 164 static RefPtr<API::Data> createData(const IPC::DataReference& data)165 {166 if (data.isEmpty())167 return 0;168 169 return API::Data::create(data.data(), data.size());170 }171 172 176 void DownloadProxy::didFail(const ResourceError& error, const IPC::DataReference& resumeData) 173 177 { … … 180 184 } 181 185 182 void DownloadProxy::didCancel(const IPC::DataReference& resumeData)183 {184 m_resumeData = createData(resumeData);185 186 m_client->didCancel(*this);187 188 // This can cause the DownloadProxy object to be deleted.189 m_downloadProxyMap.downloadFinished(*this);190 }191 192 186 } // namespace WebKit 193 187 -
trunk/Source/WebKit/UIProcess/Downloads/DownloadProxy.h
r268065 r268261 117 117 void didFinish(); 118 118 void didFail(const WebCore::ResourceError&, const IPC::DataReference& resumeData); 119 void didCancel(const IPC::DataReference& resumeData);120 119 void willSendRequest(WebCore::ResourceRequest&& redirectRequest, const WebCore::ResourceResponse& redirectResponse); 121 120 void decideDestinationWithSuggestedFilename(const String& suggestedFilename, CompletionHandler<void(String, SandboxExtension::Handle, AllowOverwrite)>&&); -
trunk/Source/WebKit/UIProcess/Downloads/DownloadProxy.messages.in
r268008 r268261 32 32 DidFinish() 33 33 DidFail(WebCore::ResourceError error, IPC::DataReference resumeData) 34 DidCancel(IPC::DataReference resumeData)35 34 } -
trunk/Tools/ChangeLog
r268258 r268261 1 2020-10-09 Alex Christensen <achristensen@webkit.org> 2 3 Use sendWithAsyncReply for NetworkProcess::CancelDownload 4 https://bugs.webkit.org/show_bug.cgi?id=217420 5 6 Reviewed by Youenn Fablet. 7 8 * TestWebKitAPI/Tests/WebKitCocoa/Download.mm: 9 (-[WaitUntilDownloadCanceledDelegate _download:didFailWithError:]): 10 (-[DownloadMonitorTestDelegate _download:didFailWithError:]): 11 (-[DownloadMonitorTestDelegate waitForDidFail]): 12 (-[DownloadMonitorTestDelegate stopWaitingForDidFail]): 13 (TestWebKitAPI::monitorDelegate): 14 (TestWebKitAPI::webViewWithDownloadMonitorSpeedMultiplier): 15 (TestWebKitAPI::downloadAtRate): 16 (TestWebKitAPI::TEST): 17 (-[WaitUntilDownloadCanceledDelegate _downloadDidCancel:]): Deleted. 18 (-[DownloadMonitorTestDelegate _downloadDidCancel:]): Deleted. 19 1 20 2020-10-09 Lauro Moura <lmoura@igalia.com> 2 21 -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/Download.mm
r267763 r268261 770 770 } 771 771 772 - (void)_downloadDidCancel:(_WKDownload *)download 773 { 772 - (void)_download:(_WKDownload *)download didFailWithError:(NSError *)error 773 { 774 EXPECT_WK_STREQ(error.domain, NSURLErrorDomain); 775 EXPECT_EQ(error.code, NSURLErrorCancelled); 774 776 isDone = true; 775 777 } … … 799 801 800 802 static bool receivedData; 801 static bool didCancel;802 803 static RetainPtr<NSString> destination; 803 804 804 805 @interface DownloadMonitorTestDelegate : NSObject <_WKDownloadDelegate> 805 @end 806 807 @implementation DownloadMonitorTestDelegate 806 - (void)waitForDidFail; 807 - (void)stopWaitingForDidFail; 808 @end 809 810 @implementation DownloadMonitorTestDelegate { 811 bool didFail; 812 } 808 813 809 814 - (void)_downloadDidStart:(_WKDownload *)download … … 812 817 } 813 818 814 - (void)_downloadDidCancel:(_WKDownload *)download 815 { 816 didCancel = true; 819 - (void)_download:(_WKDownload *)download didFailWithError:(NSError *)error 820 { 821 EXPECT_WK_STREQ(error.domain, NSURLErrorDomain); 822 EXPECT_EQ(error.code, NSURLErrorCancelled); 823 didFail = true; 824 } 825 826 - (void)waitForDidFail 827 { 828 didFail = false; 829 while (!didFail) 830 TestWebKitAPI::Util::spinRunLoop(); 831 } 832 833 - (void)stopWaitingForDidFail 834 { 835 EXPECT_FALSE(didFail); 836 didFail = true; 817 837 } 818 838 … … 860 880 } 861 881 882 static RetainPtr<DownloadMonitorTestDelegate> monitorDelegate() 883 { 884 static auto delegate = adoptNS([DownloadMonitorTestDelegate new]); 885 return delegate; 886 } 887 862 888 RetainPtr<WKWebView> webViewWithDownloadMonitorSpeedMultiplier(size_t multiplier) 863 889 { 864 890 static auto navigationDelegate = adoptNS([DownloadNavigationDelegate new]); 865 static auto downloadDelegate = adoptNS([DownloadMonitorTestDelegate new]);866 891 auto processPoolConfiguration = adoptNS([_WKProcessPoolConfiguration new]); 867 892 auto processPool = adoptNS([[WKProcessPool alloc] _initWithConfiguration:processPoolConfiguration.get()]); … … 872 897 auto webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:webViewConfiguration.get()]); 873 898 [webView setNavigationDelegate:navigationDelegate.get()]; 874 [webView configuration].processPool._downloadDelegate = downloadDelegate.get();899 [webView configuration].processPool._downloadDelegate = monitorDelegate().get(); 875 900 return webView; 876 901 } … … 893 918 if (returnToForeground == AppReturnsToForeground::Yes) 894 919 [[webView configuration].websiteDataStore _synthesizeAppIsBackground:NO]; 895 didCancel = false; 896 Util::run(&didCancel); 920 [monitorDelegate() waitForDidFail]; 897 921 terminateServer = true; 898 922 [[NSFileManager defaultManager] removeItemAtURL:[NSURL fileURLWithPath:destination.get() isDirectory:NO] error:nil]; … … 909 933 __block BOOL timeoutReached = NO; 910 934 dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 2.5 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{ 911 EXPECT_FALSE(didCancel); 912 didCancel = true; 935 [monitorDelegate() stopWaitingForDidFail]; 913 936 timeoutReached = YES; 914 937 }); … … 924 947 __block BOOL timeoutReached = NO; 925 948 dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 2.5 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{ 926 EXPECT_FALSE(didCancel); 927 didCancel = true; 949 [monitorDelegate() stopWaitingForDidFail]; 928 950 timeoutReached = YES; 929 951 }); -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/DownloadProgress.mm
r255455 r268261 488 488 [testRunner.get() receiveData:50]; 489 489 [testRunner.get().progress cancel]; 490 [testRunner.get() waitForDownload Canceled];490 [testRunner.get() waitForDownloadFailed]; 491 491 [testRunner.get() waitToLoseProgress]; 492 492
Note:
See TracChangeset
for help on using the changeset viewer.