Bug 205089 - Fix API test failure after r253351
Summary: Fix API test failure after r253351
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Per Arne Vollan
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-12-10 16:02 PST by Per Arne Vollan
Modified: 2019-12-10 17:20 PST (History)
4 users (show)

See Also:


Attachments
Patch (2.33 KB, patch)
2019-12-10 16:04 PST, Per Arne Vollan
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Per Arne Vollan 2019-12-10 16:02:45 PST
TestWebKitAPI.ContentFiltering.LazilyLoadPlatformFrameworks
        
        /Volumes/Data/worker/macOS-High-Sierra-Release-Build-EWS/build/Tools/TestWebKitAPI/Tests/WebKitCocoa/ContentFiltering.mm:364
        Expected equality of these values:
          static_cast<bool>(networkExtensionShouldBeLoaded)
            Which is: true
          static_cast<bool>(networkExtensionLoaded)
            Which is: false
        
        
        /Volumes/Data/worker/macOS-High-Sierra-Release-Build-EWS/build/Tools/TestWebKitAPI/Tests/WebKitCocoa/ContentFiltering.mm:364
        Expected equality of these values:
          static_cast<bool>(networkExtensionShouldBeLoaded)
            Which is: true
          static_cast<bool>(networkExtensionLoaded)
            Which is: false
Comment 1 Per Arne Vollan 2019-12-10 16:04:56 PST
Created attachment 385313 [details]
Patch
Comment 2 Brent Fulgham 2019-12-10 16:11:41 PST
Comment on attachment 385313 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=385313&action=review

> Tools/TestWebKitAPI/Tests/WebKitCocoa/ContentFiltering.mm:392
> +    method_setImplementation(method, reinterpret_cast<IMP>(filterRequired));

Could we have other clients that might need this? Or is this truly just a case of our test infrastructure needing this turned on.

How do client applications that will need content filtering signal this fact (e.g., Safari) opt into this feature?
Comment 3 Per Arne Vollan 2019-12-10 16:19:25 PST
(In reply to Brent Fulgham from comment #2)
> Comment on attachment 385313 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=385313&action=review
> 
> > Tools/TestWebKitAPI/Tests/WebKitCocoa/ContentFiltering.mm:392
> > +    method_setImplementation(method, reinterpret_cast<IMP>(filterRequired));
> 
> Could we have other clients that might need this? Or is this truly just a
> case of our test infrastructure needing this turned on.
> 
> How do client applications that will need content filtering signal this fact
> (e.g., Safari) opt into this feature?

I don't believe other clients need this. The API test is testing whether the network extension framework is loaded in the WebContent process, and the patch in r253351 avoids loading the framework unless it is needed, introducing the failure. The test fix swizzles [NEFilterSource filterRequired] in the UI process, which will cause the framework to be loaded in the WebContent process.

Thanks for reviewing!
Comment 4 Brent Fulgham 2019-12-10 16:22:11 PST
Comment on attachment 385313 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=385313&action=review

r=me

>>> Tools/TestWebKitAPI/Tests/WebKitCocoa/ContentFiltering.mm:392
>>> +    method_setImplementation(method, reinterpret_cast<IMP>(filterRequired));
>> 
>> Could we have other clients that might need this? Or is this truly just a case of our test infrastructure needing this turned on.
>> 
>> How do client applications that will need content filtering signal this fact (e.g., Safari) opt into this feature?
> 
> I don't believe other clients need this. The API test is testing whether the network extension framework is loaded in the WebContent process, and the patch in r253351 avoids loading the framework unless it is needed, introducing the failure. The test fix swizzles [NEFilterSource filterRequired] in the UI process, which will cause the framework to be loaded in the WebContent process.
> 
> Thanks for reviewing!

Sounds good.
Comment 5 Per Arne Vollan 2019-12-10 16:52:19 PST
(In reply to Brent Fulgham from comment #4)
> Comment on attachment 385313 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=385313&action=review
> 
> r=me
> 
> >>> Tools/TestWebKitAPI/Tests/WebKitCocoa/ContentFiltering.mm:392
> >>> +    method_setImplementation(method, reinterpret_cast<IMP>(filterRequired));
> >> 
> >> Could we have other clients that might need this? Or is this truly just a case of our test infrastructure needing this turned on.
> >> 
> >> How do client applications that will need content filtering signal this fact (e.g., Safari) opt into this feature?
> > 
> > I don't believe other clients need this. The API test is testing whether the network extension framework is loaded in the WebContent process, and the patch in r253351 avoids loading the framework unless it is needed, introducing the failure. The test fix swizzles [NEFilterSource filterRequired] in the UI process, which will cause the framework to be loaded in the WebContent process.
> > 
> > Thanks for reviewing!
> 
> Sounds good.

Thanks for reviewing :)
Comment 6 WebKit Commit Bot 2019-12-10 17:18:22 PST
The commit-queue encountered the following flaky tests while processing attachment 385313 [details]:

imported/w3c/web-platform-tests/content-security-policy/unsafe-eval/eval-scripts-setTimeout-blocked.sub.html bug 203973 (author: dbates@webkit.org)
The commit-queue is continuing to process your patch.
Comment 7 WebKit Commit Bot 2019-12-10 17:19:08 PST
Comment on attachment 385313 [details]
Patch

Clearing flags on attachment: 385313

Committed r253355: <https://trac.webkit.org/changeset/253355>
Comment 8 WebKit Commit Bot 2019-12-10 17:19:09 PST
All reviewed patches have been landed.  Closing bug.
Comment 9 Radar WebKit Bug Importer 2019-12-10 17:20:43 PST
<rdar://problem/57816052>