Bug 201574

Summary: Rewrite http/tests/workers/service/serviceworker-private-browsing.https.html as an API test
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: WebKit2Assignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, beidson, commit-queue, ggaren, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 201546    
Attachments:
Description Flags
Patch
none
Patch none

Description Chris Dumez 2019-09-06 20:46:34 PDT
Rewrite http/tests/workers/service/serviceworker-private-browsing.https.html as an API test so that we truly test private browsing. testRunner.setPrivateBrowsingEnabled_DEPRECATED() is a hack which does not work well for WK2.
Comment 1 Chris Dumez 2019-09-06 20:51:17 PDT
Created attachment 378271 [details]
Patch
Comment 2 Alex Christensen 2019-09-07 09:22:31 PDT
Comment on attachment 378271 [details]
Patch

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

> Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:1419
> +    auto ephemeralConfiguration = adoptNS([[WKWebViewConfiguration alloc] init]);

In order for this to be an equivalent test, don't you need to set the processPool to be the same as the defaultWebView?
Comment 3 Chris Dumez 2019-09-07 10:58:12 PDT
(In reply to Alex Christensen from comment #2)
> Comment on attachment 378271 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=378271&action=review
> 
> > Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:1419
> > +    auto ephemeralConfiguration = adoptNS([[WKWebViewConfiguration alloc] init]);
> 
> In order for this to be an equivalent test, don't you need to set the
> processPool to be the same as the defaultWebView?

Well, that is a good point. For some reason, I assumed this was the default behavior :/ will fix.
Comment 4 Chris Dumez 2019-09-07 11:26:42 PDT
Created attachment 378297 [details]
Patch
Comment 5 Chris Dumez 2019-09-07 11:26:57 PDT
(In reply to Chris Dumez from comment #3)
> (In reply to Alex Christensen from comment #2)
> > Comment on attachment 378271 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=378271&action=review
> > 
> > > Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:1419
> > > +    auto ephemeralConfiguration = adoptNS([[WKWebViewConfiguration alloc] init]);
> > 
> > In order for this to be an equivalent test, don't you need to set the
> > processPool to be the same as the defaultWebView?
> 
> Well, that is a good point. For some reason, I assumed this was the default
> behavior :/ will fix.

Done.
Comment 6 WebKit Commit Bot 2019-09-07 22:26:57 PDT
Comment on attachment 378297 [details]
Patch

Clearing flags on attachment: 378297

Committed r249626: <https://trac.webkit.org/changeset/249626>
Comment 7 WebKit Commit Bot 2019-09-07 22:26:59 PDT
All reviewed patches have been landed.  Closing bug.
Comment 8 Radar WebKit Bug Importer 2019-09-07 22:27:16 PDT
<rdar://problem/55155561>
Comment 9 Radar WebKit Bug Importer 2019-09-07 22:27:17 PDT
<rdar://problem/55155563>