Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 6a2efe71cf30402d9fd66706ccbf59d27363cdca
      
https://github.com/WebKit/WebKit/commit/6a2efe71cf30402d9fd66706ccbf59d27363cdca
  Author: Chris Dumez <[email protected]>
  Date:   2022-11-09 (Wed, 09 Nov 2022)

  Changed paths:
    M LayoutTests/fast/workers/resources/dedicated-worker-lifecycle.js
    M LayoutTests/inspector/worker/worker-create-and-terminate-expected.txt
    M LayoutTests/inspector/worker/worker-create-and-terminate.html
    M LayoutTests/platform/ios/TestExpectations
    M LayoutTests/platform/mac/TestExpectations
    M Source/WebCore/workers/DedicatedWorkerGlobalScope.cpp
    M Source/WebCore/workers/DedicatedWorkerGlobalScope.h
    M Source/WebCore/workers/DedicatedWorkerThread.cpp
    M Source/WebCore/workers/DedicatedWorkerThread.h
    M Source/WebCore/workers/Worker.cpp
    M Source/WebCore/workers/Worker.h
    M Source/WebCore/workers/WorkerGlobalScopeProxy.h
    M Source/WebCore/workers/WorkerMessagingProxy.cpp
    M Source/WebCore/workers/WorkerMessagingProxy.h
    M Source/WebCore/workers/WorkerObjectProxy.h
    M Source/WebCore/workers/service/context/ServiceWorkerThread.cpp
    M Source/WebCore/workers/shared/context/SharedWorkerThreadProxy.h

  Log Message:
  -----------
  Test addition (243907@main): [ iOS ][ macOS ] 
imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/dynamic-import/blob-url-workers.window.html
 is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=244549
rdar://99341974

Reviewed by Geoffrey Garen.

The test was flaky because the Worker object was getting garbage collected too
aggressively and message event listeners on the Worker object wouldn't get
called as a result.

Basically, the worker can fire events as long as:
1. Its script is being loaded
2. Its script is running since the script can post messages at any point

This patch updates Worker::virtualHasPendingActivity() accordingly to address
the issue.

Our new behavior seems more inline with the specification [1] and Blink.

[1] https://html.spec.whatwg.org/#the-worker's-lifetime

* LayoutTests/platform/ios/TestExpectations:
* LayoutTests/platform/mac/TestExpectations:
* Source/WebCore/workers/Worker.cpp:
(WebCore::Worker::virtualHasPendingActivity const):
(WebCore::Worker::notifyFinished):
* Source/WebCore/workers/Worker.h:

Canonical link: https://commits.webkit.org/256496@main


_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to