Changeset 227997 in webkit


Ignore:
Timestamp:
Feb 1, 2018 11:09:25 PM (6 years ago)
Author:
Chris Dumez
Message:

When SW install fails, null out registration.installing before setting worker state to "redundant"
https://bugs.webkit.org/show_bug.cgi?id=182416
<rdar://problem/37141997>

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

Rebaseline WPT test now that one more check is passing.

  • web-platform-tests/service-workers/service-worker/register-same-scope-different-script-url.https-expected.txt:

Source/WebCore:

When SW install fails, null out registration.installing before setting worker state to "redundant".
This does not match the spec but this is what Firefox and Chrome do. This is also what the
web-platform-tests expect.

Test: http/tests/workers/service/install-fails.html

  • workers/service/server/SWServerJobQueue.cpp:

(WebCore::SWServerJobQueue::didFinishInstall):

LayoutTests:

Add layout test coverage. I have verified that this test is passing in both Firefox and Chrome.

  • http/tests/workers/service/install-fails-expected.txt: Added.
  • http/tests/workers/service/install-fails.html: Added.
  • http/tests/workers/service/resources/install-fails-worker.js: Added.

(event.event.waitUntil.new.Promise):

Location:
trunk
Files:
3 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r227992 r227997  
     12018-02-01  Chris Dumez  <cdumez@apple.com>
     2
     3        When SW install fails, null out registration.installing before setting worker state to "redundant"
     4        https://bugs.webkit.org/show_bug.cgi?id=182416
     5        <rdar://problem/37141997>
     6
     7        Reviewed by Youenn Fablet.
     8
     9        Add layout test coverage. I have verified that this test is passing in both Firefox and Chrome.
     10
     11        * http/tests/workers/service/install-fails-expected.txt: Added.
     12        * http/tests/workers/service/install-fails.html: Added.
     13        * http/tests/workers/service/resources/install-fails-worker.js: Added.
     14        (event.event.waitUntil.new.Promise):
     15
    1162018-02-01  Megan Gardner  <megan_gardner@apple.com>
    217
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r227985 r227997  
     12018-02-01  Chris Dumez  <cdumez@apple.com>
     2
     3        When SW install fails, null out registration.installing before setting worker state to "redundant"
     4        https://bugs.webkit.org/show_bug.cgi?id=182416
     5        <rdar://problem/37141997>
     6
     7        Reviewed by Youenn Fablet.
     8
     9        Rebaseline WPT test now that one more check is passing.
     10
     11        * web-platform-tests/service-workers/service-worker/register-same-scope-different-script-url.https-expected.txt:
     12
    1132018-02-01  Chris Dumez  <cdumez@apple.com>
    214
  • trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/register-same-scope-different-script-url.https-expected.txt

    r225975 r227997  
    33PASS Register then register new script URL
    44PASS Register then register new script URL that 404s
    5 FAIL Register then register new script that does not install assert_unreached: unexpected rejection: assert_equals: on redundant, installing should be null expected null but got object "[object ServiceWorker]" Reached unreachable code
     5PASS Register then register new script that does not install
    66PASS Register same-scope new script url effect on controller
    77
  • trunk/Source/WebCore/ChangeLog

    r227995 r227997  
     12018-02-01  Chris Dumez  <cdumez@apple.com>
     2
     3        When SW install fails, null out registration.installing before setting worker state to "redundant"
     4        https://bugs.webkit.org/show_bug.cgi?id=182416
     5        <rdar://problem/37141997>
     6
     7        Reviewed by Youenn Fablet.
     8
     9        When SW install fails, null out registration.installing before setting worker state to "redundant".
     10        This does not match the spec but this is what Firefox and Chrome do. This is also what the
     11        web-platform-tests expect.
     12
     13        Test: http/tests/workers/service/install-fails.html
     14
     15        * workers/service/server/SWServerJobQueue.cpp:
     16        (WebCore::SWServerJobQueue::didFinishInstall):
     17
    1182018-02-01  Myles C. Maxfield  <mmaxfield@apple.com>
    219
  • trunk/Source/WebCore/workers/service/server/SWServerJobQueue.cpp

    r227796 r227997  
    186186
    187187    if (!wasSuccessful) {
    188         auto* worker = m_server.workerByID(identifier);
     188        RefPtr<SWServerWorker> worker = m_server.workerByID(identifier);
    189189        RELEASE_ASSERT(worker);
    190190
     191        worker->terminate();
     192        // Run the Update Registration State algorithm passing registration, "installing" and null as the arguments.
     193        registration->updateRegistrationState(ServiceWorkerRegistrationState::Installing, nullptr);
    191194        // Run the Update Worker State algorithm passing registration's installing worker and redundant as the arguments.
    192195        registration->updateWorkerState(*worker, ServiceWorkerState::Redundant);
    193         // Run the Update Registration State algorithm passing registration, "installing" and null as the arguments.
    194         registration->updateRegistrationState(ServiceWorkerRegistrationState::Installing, nullptr);
    195196
    196197        // If newestWorker is null, invoke Clear Registration algorithm passing registration as its argument.
Note: See TracChangeset for help on using the changeset viewer.