Changeset 220722 in webkit
- Timestamp:
- Aug 14, 2017 4:21:03 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 6 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r220718 r220722 1 2017-08-14 Andy Estes <aestes@apple.com> 2 3 REGRESSION (r220456): Crash in PreviewLoader::shouldCreateForMIMEType() when a ResourceResponse has a null MIME type 4 https://bugs.webkit.org/show_bug.cgi?id=175548 5 <rdar://problem/33866206> 6 7 Reviewed by Brady Eidson. 8 9 New API test: QuickLook.ShouldCreateForMIMEType 10 11 * WebCore.xcodeproj/project.pbxproj: 12 * loader/ios/PreviewLoader.h: 13 * loader/ios/PreviewLoader.mm: 14 (WebCore::PreviewLoader::shouldCreateForMIMEType): Check if mimeType is a null String before 15 calling HashSet::contains(). 16 1 17 2017-08-14 Andy Estes <aestes@apple.com> 2 18 -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r220707 r220722 4343 4343 A182D5B71BE722670087A7CC /* SettingsCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = A182D5B61BE722620087A7CC /* SettingsCocoa.mm */; }; 4344 4344 A185B4291E8211A100DC9118 /* PreviewLoader.mm in Sources */ = {isa = PBXBuildFile; fileRef = A185B4271E8211A100DC9118 /* PreviewLoader.mm */; }; 4345 A185B42A1E8211A100DC9118 /* PreviewLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = A185B4281E8211A100DC9118 /* PreviewLoader.h */; };4345 A185B42A1E8211A100DC9118 /* PreviewLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = A185B4281E8211A100DC9118 /* PreviewLoader.h */; settings = {ATTRIBUTES = (Private, ); }; }; 4346 4346 A18890AE1AA13F250026C301 /* ParentalControlsContentFilter.mm in Sources */ = {isa = PBXBuildFile; fileRef = A18890AC1AA13F250026C301 /* ParentalControlsContentFilter.mm */; }; 4347 4347 A18890AF1AA13F250026C301 /* ParentalControlsContentFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = A18890AD1AA13F250026C301 /* ParentalControlsContentFilter.h */; }; … … 26558 26558 29A812360FBB9C1D00510293 /* AccessibilityObject.h in Headers */, 26559 26559 A409C985116D0DDD007197BD /* AccessibilityProgressIndicator.h in Headers */, 26560 51F175641F3EBC8300C74950 /* ServiceWorkerJobClient.h in Headers */,26561 26560 29A812390FBB9C1D00510293 /* AccessibilityRenderObject.h in Headers */, 26562 26561 93C4F6EB1108F9A50099D0DB /* AccessibilityScrollbar.h in Headers */, … … 26845 26844 43EDD67F1B485DBF00640E75 /* CombinedFiltersAlphabet.h in Headers */, 26846 26845 26E944D91AC4B2DD007B85B5 /* CombinedURLFilters.h in Headers */, 26847 51F175691F3EBC8300C74950 /* ServiceWorkerRegistrationOptions.h in Headers */,26848 26846 A584FE351864D5AF00843B10 /* CommandLineAPIHost.h in Headers */, 26849 26847 A584FE2C1863870F00843B10 /* CommandLineAPIModule.h in Headers */, 26850 26848 A584FE2618637DAB00843B10 /* CommandLineAPIModuleSource.h in Headers */, 26851 26849 6550B6A2099DF0270090D781 /* Comment.h in Headers */, 26852 511CA67E1F3905A60019E074 /* ServiceWorkerJob.h in Headers */,26853 26850 57E664FC1E73703300765536 /* CommonCryptoDERUtilities.h in Headers */, 26854 26851 E1FE137518402A6700892F13 /* CommonCryptoUtilities.h in Headers */, … … 27188 27185 CECADFC7153778FF00E37068 /* DictationAlternative.h in Headers */, 27189 27186 CECADFC9153778FF00E37068 /* DictationCommand.h in Headers */, 27190 51F175631F3EBC8300C74950 /* ServiceWorkerJob.h in Headers */,27191 27187 D0BD4F5D1408850F006839B6 /* DictationCommandIOS.h in Headers */, 27192 27188 937FF3D51A1012D6008EBA31 /* DictionaryLookup.h in Headers */, … … 27242 27238 52B6C9C315E3F4DF00690B05 /* DOMNamedFlowCollection.h in Headers */, 27243 27239 1ACE53E80A8D18E70022947D /* DOMParser.h in Headers */, 27244 51F1755F1F3EBC8300C74950 /* ServiceWorkerContainer.h in Headers */,27245 27240 7A54881714E432A1006AE05A /* DOMPatchSupport.h in Headers */, 27246 27241 FB91392416AE4C17001FE682 /* DOMPath.h in Headers */, … … 27575 27570 977B3867122883E900B81FF8 /* HTMLDocumentParser.h in Headers */, 27576 27571 93F198E608245E59001E9ABC /* HTMLElement.h in Headers */, 27577 51BEB6391F3B94B0005029B9 /* ServiceWorkerRegistrationOptions.h in Headers */,27578 27572 A17C81230F2A5CF7005DAAEB /* HTMLElementFactory.h in Headers */, 27579 27573 977B37241228721700B81FF8 /* HTMLElementStack.h in Headers */, … … 28322 28316 5E2C43721BCF0D750001E2BD /* JSRTCRtpTransceiver.h in Headers */, 28323 28317 316DCB221E78CA55001B5F87 /* JSRTCRtpTransceiverDirection.h in Headers */, 28324 51F1756C1F3EBC8300C74950 /* ServiceWorkerUpdateViaCache.h in Headers */,28325 28318 07969DBC17D14151007FF842 /* JSRTCSessionDescription.h in Headers */, 28326 28319 316DCB501E7910A6001B5F87 /* JSRTCSignalingState.h in Headers */, … … 28408 28401 B2FA3D830AB75A6F000E5AC4 /* JSSVGFEGaussianBlurElement.h in Headers */, 28409 28402 B2FA3D850AB75A6F000E5AC4 /* JSSVGFEImageElement.h in Headers */, 28410 51F175681F3EBC8300C74950 /* ServiceWorkerRegistration.h in Headers */,28411 28403 B2FA3D870AB75A6F000E5AC4 /* JSSVGFEMergeElement.h in Headers */, 28412 28404 B2FA3D890AB75A6F000E5AC4 /* JSSVGFEMergeNodeElement.h in Headers */, … … 28681 28673 935207BE09BD410A00F2038D /* LocalizedStrings.h in Headers */, 28682 28674 BCE1C41B0D982980003B02F2 /* Location.h in Headers */, 28683 51F175611F3EBC8300C74950 /* ServiceWorkerGlobalScope.h in Headers */,28684 28675 A8239E0109B3CF8A00B60641 /* Logging.h in Headers */, 28685 28676 9BA273F4172206BB0097CE47 /* LogicalSelectionOffsetCaches.h in Headers */, … … 28837 28828 07EE76EF1BEA619800F89133 /* MockRealtimeVideoSourceMac.h in Headers */, 28838 28829 CDF2B0171820540700F2B424 /* MockSourceBufferPrivate.h in Headers */, 28839 511CA6801F39331F0019E074 /* ServiceWorkerJobClient.h in Headers */,28840 28830 CDF2B0191820540700F2B424 /* MockTracks.h in Headers */, 28841 28831 C6D74AD509AA282E000B0A52 /* ModifySelectionListLevel.h in Headers */, … … 29050 29040 0562F9611573F88F0031CA16 /* PlatformLayer.h in Headers */, 29051 29041 F544F78915CFB2A800AF33A8 /* PlatformLocale.h in Headers */, 29052 51F1755D1F3EBC8300C74950 /* ServiceWorker.h in Headers */,29053 29042 CEEFCD7C19DB33DC003876D7 /* PlatformMediaResourceLoader.h in Headers */, 29054 29043 070E09191875EEFC003A1D3C /* PlatformMediaSession.h in Headers */, … … 29151 29140 41103AAC1E39791000769F03 /* RealtimeOutgoingAudioSource.h in Headers */, 29152 29141 BC4368E80C226E32005EFB5F /* Rect.h in Headers */, 29153 511CA6841F3A3CD90019E074 /* ServiceWorkerRegistrationParameters.h in Headers */,29154 29142 FD45A958175D414C00C21EC8 /* RectangleShape.h in Headers */, 29155 29143 9831AE4A154225C900FE2644 /* ReferrerPolicy.h in Headers */, … … 29426 29414 0F1774801378B772009DA76A /* ScrollAnimatorIOS.h in Headers */, 29427 29415 BCAE1FA712939DB7004CB026 /* ScrollAnimatorMac.h in Headers */, 29428 51F1756B1F3EBC8300C74950 /* ServiceWorkerRegistrationParameters.h in Headers */,29429 29416 5CB37FFF1C62D2A100F20188 /* ScrollAnimatorMock.h in Headers */, 29430 29417 93F199B808245E59001E9ABC /* Scrollbar.h in Headers */, … … 29494 29481 516F7F6D1C31E39A00F111DC /* ServerOpenDBRequest.h in Headers */, 29495 29482 2D93AEE319DF5641002A86C3 /* ServicesOverlayController.h in Headers */, 29483 51F1755D1F3EBC8300C74950 /* ServiceWorker.h in Headers */, 29496 29484 5182C23F1F313A090059BA7C /* ServiceWorker.h in Headers */, 29485 51F1755F1F3EBC8300C74950 /* ServiceWorkerContainer.h in Headers */, 29497 29486 5182C2411F313A090059BA7C /* ServiceWorkerContainer.h in Headers */, 29487 51F175611F3EBC8300C74950 /* ServiceWorkerGlobalScope.h in Headers */, 29498 29488 5182C2431F313A090059BA7C /* ServiceWorkerGlobalScope.h in Headers */, 29489 51F175631F3EBC8300C74950 /* ServiceWorkerJob.h in Headers */, 29490 511CA67E1F3905A60019E074 /* ServiceWorkerJob.h in Headers */, 29491 51F175641F3EBC8300C74950 /* ServiceWorkerJobClient.h in Headers */, 29492 511CA6801F39331F0019E074 /* ServiceWorkerJobClient.h in Headers */, 29493 511CA67A1F3904B10019E074 /* ServiceWorkerProvider.h in Headers */, 29494 51F175661F3EBC8300C74950 /* ServiceWorkerProvider.h in Headers */, 29495 51F175681F3EBC8300C74950 /* ServiceWorkerRegistration.h in Headers */, 29499 29496 5182C2451F313A090059BA7C /* ServiceWorkerRegistration.h in Headers */, 29497 51F175691F3EBC8300C74950 /* ServiceWorkerRegistrationOptions.h in Headers */, 29498 51F1756B1F3EBC8300C74950 /* ServiceWorkerRegistrationParameters.h in Headers */, 29499 51F1756C1F3EBC8300C74950 /* ServiceWorkerUpdateViaCache.h in Headers */, 29500 29500 51F174FF1F35899700C74950 /* ServiceWorkerUpdateViaCache.h in Headers */, 29501 29501 756B2CE118B7101600FECFAA /* SessionID.h in Headers */, … … 29831 29831 B2227A780D00BF220071B782 /* SVGPathSegLinetoHorizontal.h in Headers */, 29832 29832 83C1D430178D5AB500141E68 /* SVGPathSegLinetoHorizontalAbs.h in Headers */, 29833 511CA67A1F3904B10019E074 /* ServiceWorkerProvider.h in Headers */,29834 29833 83C1D431178D5AB500141E68 /* SVGPathSegLinetoHorizontalRel.h in Headers */, 29835 29834 83C1D432178D5AB500141E68 /* SVGPathSegLinetoRel.h in Headers */, … … 30012 30011 49E912AE0EFAC906009D0CAF /* TimingFunction.h in Headers */, 30013 30012 0F54DD081881D5F5003EEDBB /* Touch.h in Headers */, 30014 51F175661F3EBC8300C74950 /* ServiceWorkerProvider.h in Headers */,30015 30013 0F54DD091881D5F5003EEDBB /* TouchEvent.h in Headers */, 30016 30014 0F54DD0A1881D5F5003EEDBB /* TouchList.h in Headers */, … … 31222 31220 CECADFC8153778FF00E37068 /* DictationCommand.cpp in Sources */, 31223 31221 D0BD4F5C1408850F006839B6 /* DictationCommandIOS.cpp in Sources */, 31224 51F1756A1F3EBC8300C74950 /* ServiceWorkerRegistrationParameters.cpp in Sources */,31225 31222 937FF3D71A10131B008EBA31 /* DictionaryLookup.mm in Sources */, 31226 31223 FDAF19981513D131008DB0C3 /* DirectConvolver.cpp in Sources */, … … 31552 31549 5160F4980B0AA75F00C1D2AF /* HistoryItemMac.mm in Sources */, 31553 31550 4969B0F213D0B33F00DF3521 /* HitTestingTransformState.cpp in Sources */, 31554 511CA6831F3A3CD90019E074 /* ServiceWorkerRegistrationParameters.cpp in Sources */,31555 31551 2D8287F616E4A0380086BD00 /* HitTestLocation.cpp in Sources */, 31556 31552 9307F1D70AF2D59000DBA31A /* HitTestResult.cpp in Sources */, … … 31735 31731 555B87EC1CAAF0AB00349425 /* ImageDecoderCG.cpp in Sources */, 31736 31732 97205AB51239291000B17380 /* ImageDocument.cpp in Sources */, 31737 51F1755C1F3EBC8300C74950 /* ServiceWorker.cpp in Sources */,31738 31733 5576A5641D88A70800CCC04C /* ImageFrame.cpp in Sources */, 31739 31734 5597F8261D91C3130066BC21 /* ImageFrameCache.cpp in Sources */, … … 32110 32105 1AE2AA300A1CDAB400B42B25 /* JSHTMLHRElement.cpp in Sources */, 32111 32106 1A85B18F0A1B18A200D8C87C /* JSHTMLHtmlElement.cpp in Sources */, 32112 51F175621F3EBC8300C74950 /* ServiceWorkerJob.cpp in Sources */,32113 32107 BC4918C80BFEA050009D6316 /* JSHTMLIFrameElement.cpp in Sources */, 32114 32108 1AE2AA970A1CDD2D00B42B25 /* JSHTMLImageElement.cpp in Sources */, … … 32626 32620 E182568F0EF2B02D00933242 /* JSWorkerGlobalScope.cpp in Sources */, 32627 32621 E1C36D340EB0A094007410BC /* JSWorkerGlobalScopeBase.cpp in Sources */, 32628 511CA6791F3904B10019E074 /* ServiceWorkerProvider.cpp in Sources */,32629 32622 E18258AC0EF3CD7000933242 /* JSWorkerGlobalScopeCustom.cpp in Sources */, 32630 32623 E1C362F00EAF2AA9007410BC /* JSWorkerLocation.cpp in Sources */, … … 33109 33102 BCEA4875097D93020094C9E4 /* RenderImage.cpp in Sources */, 33110 33103 08F2F0091213E61700DCEC48 /* RenderImageResource.cpp in Sources */, 33111 51F175671F3EBC8300C74950 /* ServiceWorkerRegistration.cpp in Sources */,33112 33104 08641D4712142F7D008DE9F6 /* RenderImageResourceStyleImage.cpp in Sources */, 33113 33105 BCEA4877097D93020094C9E4 /* RenderInline.cpp in Sources */, … … 33154 33146 A871DFE20A15376B00B12A68 /* RenderReplaced.cpp in Sources */, 33155 33147 BCA846D60DC67A350026C309 /* RenderReplica.cpp in Sources */, 33156 51F1755E1F3EBC8300C74950 /* ServiceWorkerContainer.cpp in Sources */,33157 33148 1479FAED109AE37500DED655 /* RenderRuby.cpp in Sources */, 33158 33149 1479FAEF109AE37500DED655 /* RenderRubyBase.cpp in Sources */, … … 33175 33166 A8DF4AF00980C42C0052981B /* RenderTableRow.cpp in Sources */, 33176 33167 A8DF4AED0980C42C0052981B /* RenderTableSection.cpp in Sources */, 33177 511CA67D1F3905A60019E074 /* ServiceWorkerJob.cpp in Sources */,33178 33168 BCEA488B097D93020094C9E4 /* RenderText.cpp in Sources */, 33179 33169 AB67D1A8097F3AE300F9392E /* RenderTextControl.cpp in Sources */, … … 33358 33348 516F7F6E1C31E39C00F111DC /* ServerOpenDBRequest.cpp in Sources */, 33359 33349 2D93AEE419DF5641002A86C3 /* ServicesOverlayController.mm in Sources */, 33350 51F1755C1F3EBC8300C74950 /* ServiceWorker.cpp in Sources */, 33360 33351 5182C23E1F313A090059BA7C /* ServiceWorker.cpp in Sources */, 33352 51F1755E1F3EBC8300C74950 /* ServiceWorkerContainer.cpp in Sources */, 33361 33353 5182C2401F313A090059BA7C /* ServiceWorkerContainer.cpp in Sources */, 33362 33354 5182C2421F313A090059BA7C /* ServiceWorkerGlobalScope.cpp in Sources */, 33355 51F175601F3EBC8300C74950 /* ServiceWorkerGlobalScope.cpp in Sources */, 33356 51F175621F3EBC8300C74950 /* ServiceWorkerJob.cpp in Sources */, 33357 511CA67D1F3905A60019E074 /* ServiceWorkerJob.cpp in Sources */, 33358 511CA6791F3904B10019E074 /* ServiceWorkerProvider.cpp in Sources */, 33359 51F175651F3EBC8300C74950 /* ServiceWorkerProvider.cpp in Sources */, 33360 51F175671F3EBC8300C74950 /* ServiceWorkerRegistration.cpp in Sources */, 33363 33361 5182C2441F313A090059BA7C /* ServiceWorkerRegistration.cpp in Sources */, 33362 51F1756A1F3EBC8300C74950 /* ServiceWorkerRegistrationParameters.cpp in Sources */, 33363 511CA6831F3A3CD90019E074 /* ServiceWorkerRegistrationParameters.cpp in Sources */, 33364 33364 511F7D441EB1C39100E47B83 /* SessionID.cpp in Sources */, 33365 33365 93309E0F099E64920056E581 /* SetNodeAttributeCommand.cpp in Sources */, … … 33639 33639 B2227AA20D00BF220071B782 /* SVGScriptElement.cpp in Sources */, 33640 33640 B2227AA50D00BF220071B782 /* SVGSetElement.cpp in Sources */, 33641 51F175601F3EBC8300C74950 /* ServiceWorkerGlobalScope.cpp in Sources */,33642 33641 E4AFD00F0DAF335500F5F55C /* SVGSMILElement.cpp in Sources */, 33643 33642 B2227AA80D00BF220071B782 /* SVGStopElement.cpp in Sources */, … … 33741 33740 1F72BF0A187FD4490009BCB3 /* TileControllerMemoryHandlerIOS.cpp in Sources */, 33742 33741 7AA3A6A3194B5C22001CBD24 /* TileCoverageMap.cpp in Sources */, 33743 51F175651F3EBC8300C74950 /* ServiceWorkerProvider.cpp in Sources */,33744 33742 7AA3A69B194A64E7001CBD24 /* TileGrid.cpp in Sources */, 33745 33743 498770F21242C535002226BA /* TilingData.cpp in Sources */, -
trunk/Source/WebCore/loader/ios/PreviewLoader.h
r214266 r220722 42 42 WTF_MAKE_NONCOPYABLE(PreviewLoader); 43 43 public: 44 static bool shouldCreateForMIMEType(const String&);44 WEBCORE_EXPORT static bool shouldCreateForMIMEType(const String&); 45 45 static std::unique_ptr<PreviewLoader> create(ResourceLoader&, const ResourceResponse&); 46 46 ~PreviewLoader(); -
trunk/Source/WebCore/loader/ios/PreviewLoader.mm
r220456 r220722 211 211 }); 212 212 213 if (mimeType.isNull()) 214 return false; 215 213 216 return supportedMIMETypes.get().contains(mimeType); 214 217 } -
trunk/Tools/ChangeLog
r220719 r220722 1 2017-08-14 Andy Estes <aestes@apple.com> 2 3 REGRESSION (r220456): Crash in PreviewLoader::shouldCreateForMIMEType() when a ResourceResponse has a null MIME type 4 https://bugs.webkit.org/show_bug.cgi?id=175548 5 <rdar://problem/33866206> 6 7 Reviewed by Brady Eidson. 8 9 * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: 10 * TestWebKitAPI/Tests/WebCore/ios/PreviewLoader.cpp: Added. 11 (TestWebKitAPI::TEST): Added an API test for PreviewLoader::shouldCreateForMIMEType(). 12 1 13 2017-08-14 Youenn Fablet <youenn@apple.com> 2 14 -
trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
r220709 r220722 559 559 A1C4FB731BACD1CA003742D0 /* pages.pages in Copy Resources */ = {isa = PBXBuildFile; fileRef = A1C4FB721BACD1B7003742D0 /* pages.pages */; }; 560 560 A1DF74321C41B65800A2F4D0 /* AlwaysRevalidatedURLSchemes.mm in Sources */ = {isa = PBXBuildFile; fileRef = A1DF74301C41B65800A2F4D0 /* AlwaysRevalidatedURLSchemes.mm */; }; 561 A1EC11881F42541200D0146E /* PreviewLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1EC11871F42541200D0146E /* PreviewLoader.cpp */; }; 561 562 A57A34F216AF6B2B00C2501F /* PageVisibilityStateWithWindowChanges.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = A57A34F116AF69E200C2501F /* PageVisibilityStateWithWindowChanges.html */; }; 562 563 A57D54F31F338C3600A97AA7 /* NeverDestroyed.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A57D54F21F338C3600A97AA7 /* NeverDestroyed.cpp */; }; … … 1481 1482 A1C4FB721BACD1B7003742D0 /* pages.pages */ = {isa = PBXFileReference; lastKnownFileType = file; name = pages.pages; path = ios/pages.pages; sourceTree = SOURCE_ROOT; }; 1482 1483 A1DF74301C41B65800A2F4D0 /* AlwaysRevalidatedURLSchemes.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AlwaysRevalidatedURLSchemes.mm; sourceTree = "<group>"; }; 1484 A1EC11871F42541200D0146E /* PreviewLoader.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = PreviewLoader.cpp; sourceTree = "<group>"; }; 1483 1485 A1FDFD2E19C288BB005148A4 /* WKImageCreateCGImageCrash.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKImageCreateCGImageCrash.cpp; sourceTree = "<group>"; }; 1484 1486 A57A34EF16AF677200C2501F /* PageVisibilityStateWithWindowChanges.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PageVisibilityStateWithWindowChanges.mm; sourceTree = "<group>"; }; … … 2001 2003 children = ( 2002 2004 CD89D0371C4EDB1300040A04 /* cocoa */, 2005 A1EC11851F4253D900D0146E /* ios */, 2003 2006 3162AE9A1E6F2F8F000E4DBC /* mac */, 2004 2007 7A909A6F1D877475007E10F8 /* AffineTransform.cpp */, … … 2216 2219 ); 2217 2220 name = Resources; 2221 sourceTree = "<group>"; 2222 }; 2223 A1EC11851F4253D900D0146E /* ios */ = { 2224 isa = PBXGroup; 2225 children = ( 2226 A1EC11871F42541200D0146E /* PreviewLoader.cpp */, 2227 ); 2228 path = ios; 2218 2229 sourceTree = "<group>"; 2219 2230 }; … … 3239 3250 7CCE7F0B1A411AE600447C4C /* PreventEmptyUserAgent.cpp in Sources */, 3240 3251 7CCE7F2C1A411B1000447C4C /* PreventImageLoadWithAutoResizing.mm in Sources */, 3252 A1EC11881F42541200D0146E /* PreviewLoader.cpp in Sources */, 3241 3253 7CCE7F0C1A411AE600447C4C /* PrivateBrowsingPushStateNoHistoryCallback.cpp in Sources */, 3242 3254 4647B1261EBA3B850041D7EF /* ProcessDidTerminate.cpp in Sources */, -
trunk/Tools/TestWebKitAPI/Tests/WebCore/ios/PreviewLoader.cpp
r220721 r220722 1 1 /* 2 * Copyright (C) 20 09-2017 Apple Inc. All rights reserved.2 * Copyright (C) 2017 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 # pragma once26 #include "config.h" 27 27 28 #include <wtf/Forward.h> 29 #include <wtf/Noncopyable.h> 30 #include <wtf/RetainPtr.h> 28 #if PLATFORM(IOS) 31 29 32 OBJC_CLASS WebPreviewLoader; 30 #include <WebCore/PreviewLoader.h> 31 #include <wtf/text/WTFString.h> 33 32 34 namespace WebCore { 33 using namespace WebCore; 35 34 36 class PreviewLoaderClient; 37 class ResourceLoader; 38 class ResourceResponse; 39 class SharedBuffer; 35 namespace TestWebKitAPI { 40 36 41 class PreviewLoader { 42 WTF_MAKE_NONCOPYABLE(PreviewLoader); 43 public: 44 static bool shouldCreateForMIMEType(const String&); 45 static std::unique_ptr<PreviewLoader> create(ResourceLoader&, const ResourceResponse&); 46 ~PreviewLoader(); 37 TEST(QuickLook, ShouldCreateForMIMEType) 38 { 39 // FIXME: Expand this to cover all the MIME types we expect to support. 40 EXPECT_FALSE(PreviewLoader::shouldCreateForMIMEType(String())); 41 EXPECT_FALSE(PreviewLoader::shouldCreateForMIMEType(emptyString())); 42 EXPECT_TRUE(PreviewLoader::shouldCreateForMIMEType(ASCIILiteral("application/vnd.ms-excel.sheet.macroEnabled.12"))); 43 } 47 44 48 bool didReceiveData(const char* data, unsigned length); 49 bool didReceiveBuffer(const SharedBuffer&); 50 bool didFinishLoading(); 51 void didFail(); 45 } // namespace TestWebKitAPI 52 46 53 WEBCORE_EXPORT static void setClientForTesting(RefPtr<PreviewLoaderClient>&&); 54 55 private: 56 friend std::unique_ptr<PreviewLoader> std::make_unique<PreviewLoader>(ResourceLoader&, const ResourceResponse&); 57 PreviewLoader(ResourceLoader&, const ResourceResponse&); 58 59 RetainPtr<WebPreviewLoader> m_previewLoader; 60 bool m_finishedLoadingDataIntoConverter { false }; 61 }; 62 63 } // namespace WebCore 47 #endif // PLATFORM(IOS)
Note: See TracChangeset
for help on using the changeset viewer.