Skip to content

Commit

Permalink
[macOS] Fix SuspendServiceWorkerProcessBasedOnClientProcessesWithoutS…
Browse files Browse the repository at this point in the history
…eparateServiceWorkerProcess test when RunningBoard is enabled.

https://bugs.webkit.org/show_bug.cgi?id=247894
rdar://102320977

Reviewed by Darin Adler and Timothy Hatcher.

This test assumes that all webcontent processes associated with the
service worker have a suspended assertion. However, we currently 'leak'
a foreground assertion on every webcontent process by default when
we build with RunningBoard enabled. We should manually take a suspended
assertion on web content processes associated with this service worker
instead of assuming they already have a suspended assertion.

* Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:

Canonical link: https://commits.webkit.org/257141@main
  • Loading branch information
salinas-miguel authored and bnham committed Nov 29, 2022
1 parent acc8e95 commit e33ada3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm
Expand Up @@ -1753,6 +1753,9 @@ void testSuspendServiceWorkerProcessBasedOnClientProcesses(UseSeparateServiceWor

auto webViewToUpdate = useSeparateServiceWorkerProcess == UseSeparateServiceWorkerProcess::Yes ? webView : webView2;

if (useSeparateServiceWorkerProcess == UseSeparateServiceWorkerProcess::Yes)
[webView2 _setThrottleStateForTesting:0];

[webViewToUpdate _setThrottleStateForTesting:1];
EXPECT_TRUE(waitUntilEvaluatesToTrue([&] {
return ![webViewToUpdate _hasServiceWorkerForegroundActivityForTesting] && [webViewToUpdate _hasServiceWorkerBackgroundActivityForTesting];
Expand Down

0 comments on commit e33ada3

Please sign in to comment.