Changeset 253355 in webkit


Ignore:
Timestamp:
Dec 10, 2019 5:19:00 PM (4 years ago)
Author:
pvollan@apple.com
Message:

Fix API test failure after r253351
https://bugs.webkit.org/show_bug.cgi?id=205089

Reviewed by Brent Fulgham.

With the patch landed in r253351, the NetworkExtension framework will not be loaded in the WebContent process unless
[NEFilterSource filterRequired] returns YES. Swizzle this method to return YES in the UI process.

  • TestWebKitAPI/Tests/WebKitCocoa/ContentFiltering.mm:

(filterRequired):
(TEST):

Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r253343 r253355  
     12019-12-10  Per Arne Vollan  <pvollan@apple.com>
     2
     3        Fix API test failure after r253351
     4        https://bugs.webkit.org/show_bug.cgi?id=205089
     5
     6        Reviewed by Brent Fulgham.
     7
     8        With the patch landed in r253351, the NetworkExtension framework will not be loaded in the WebContent process unless
     9        [NEFilterSource filterRequired] returns YES. Swizzle this method to return YES in the UI process.
     10
     11        * TestWebKitAPI/Tests/WebKitCocoa/ContentFiltering.mm:
     12        (filterRequired):
     13        (TEST):
     14
    1152019-12-10  Chris Dumez  <cdumez@apple.com>
    216
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ContentFiltering.mm

    r248673 r253355  
    3939#import <WebKit/_WKRemoteObjectInterface.h>
    4040#import <WebKit/_WKRemoteObjectRegistry.h>
     41#import <pal/spi/cocoa/NEFilterSourceSPI.h>
    4142#import <wtf/RetainPtr.h>
     43#import <wtf/SoftLinking.h>
     44
     45SOFT_LINK_FRAMEWORK_OPTIONAL(NetworkExtension);
     46SOFT_LINK_CLASS_OPTIONAL(NetworkExtension, NEFilterSource);
    4247
    4348using Decision = WebCore::MockContentFilterSettings::Decision;
     
    376381@end
    377382
     383static BOOL filterRequired(id self, SEL _cmd)
     384{
     385    return YES;
     386}
     387
    378388TEST(ContentFiltering, LazilyLoadPlatformFrameworks)
    379389{
     390    // Swizzle [NEFilterSource filterRequired] to return YES in the UI process since NetworkExtension will not be loaded otherwise.
     391    Method method = class_getClassMethod(getNEFilterSourceClass(), @selector(filterRequired));
     392    method_setImplementation(method, reinterpret_cast<IMP>(filterRequired));
     393
    380394    @autoreleasepool {
    381395        auto controller = adoptNS([[LazilyLoadPlatformFrameworksController alloc] init]);
Note: See TracChangeset for help on using the changeset viewer.