Bug 211255

Summary: clearApplicationBundleIdentifierTestingOverride() should set the bundle identifier to a null string, not an empty string
Product: WebKit Reporter: Kate Cheney <katherine_cheney>
Component: WebKit Misc.Assignee: Kate Cheney <katherine_cheney>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, pvollan, wilander
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch for landing none

Description Kate Cheney 2020-04-30 14:21:26 PDT
After the bundle identifier is cleared in a testing override call, subsequent calls to applicationBundleIdentifier() should check the NSBundle mainBundle object. This only happens if the testing bundle identifier is null (currently it is set to the empty string between calls).
Comment 1 Kate Cheney 2020-04-30 14:21:47 PDT
<rdar://problem/62651110>
Comment 2 Kate Cheney 2020-04-30 14:25:10 PDT
Created attachment 398091 [details]
Patch
Comment 3 Kate Cheney 2020-04-30 14:26:40 PDT
An empty bundle identifier is causing flaky tests. I was able to reproduce before using: 

run-webkit-tests LayoutTests/http/tests/in-app-browser-privacy/ LayoutTests/userscripts/mixed-case-stylesheet.html  LayoutTests/userscripts/simple-stylesheet.html LayoutTests/userscripts/user-style* -f --iphone-simulator --no-build --no-retry-failures --debug-rwt-logging --exit-after-n-failures 1 --force

But not able to reproduce with this patch.
Comment 4 John Wilander 2020-04-30 14:27:48 PDT
Comment on attachment 398091 [details]
Patch

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

r=me. Please address the comment.

> Source/WebCore/platform/cocoa/RuntimeApplicationChecksCocoa.mm:72
> +    applicationBundleIdentifierOverride() = String();

The bug title indicates that this should be nullptr. Either the title or this assignment should be changed.
Comment 5 Kate Cheney 2020-04-30 14:28:45 PDT
(In reply to John Wilander from comment #4)
> Comment on attachment 398091 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=398091&action=review
> 
> r=me. Please address the comment.
> 
> > Source/WebCore/platform/cocoa/RuntimeApplicationChecksCocoa.mm:72
> > +    applicationBundleIdentifierOverride() = String();
> 
> The bug title indicates that this should be nullptr. Either the title or
> this assignment should be changed.

You're right. It should be "null string" not just null.
Comment 6 Kate Cheney 2020-04-30 14:32:49 PDT
Created attachment 398093 [details]
Patch for landing
Comment 7 EWS 2020-04-30 14:58:13 PDT
Committed r260969: <https://trac.webkit.org/changeset/260969>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 398093 [details].