Bug 211255 - clearApplicationBundleIdentifierTestingOverride() should set the bundle identifier to a null string, not an empty string
Summary: clearApplicationBundleIdentifierTestingOverride() should set the bundle ident...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Kate Cheney
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-04-30 14:21 PDT by Kate Cheney
Modified: 2020-04-30 14:58 PDT (History)
3 users (show)

See Also:


Attachments
Patch (1.86 KB, patch)
2020-04-30 14:25 PDT, Kate Cheney
no flags Details | Formatted Diff | Diff
Patch for landing (1.88 KB, patch)
2020-04-30 14:32 PDT, Kate Cheney
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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].