[webkit-changes] [WebKit/WebKit] fdb77b: Adding layout tests for postMessage CryptoKey for ...

Commit Queue noreply at github.com
Fri Mar 15 13:42:56 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: fdb77ba046f0ffbbf952879f1f6c7c0c5c4d63e9
      https://github.com/WebKit/WebKit/commit/fdb77ba046f0ffbbf952879f1f6c7c0c5c4d63e9
  Author: nmahendru <nitinmahendru at apple.com>
  Date:   2024-03-15 (Fri, 15 Mar 2024)

  Changed paths:
    M LayoutTests/http/tests/workers/service/indexeddb-cryptokey-put-get.https-expected.txt
    M LayoutTests/http/tests/workers/service/resources/indexeddb-cryptokey-put-get-worker.js
    M LayoutTests/http/tests/workers/service/resources/indexeddb-cryptokey-put-get.js
    M LayoutTests/http/tests/workers/service/resources/sw-test-pre.js
    M Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm
    M Source/WebKit/UIProcess/WebPageProxy.cpp
    M Source/WebKit/UIProcess/WebPageProxy.h
    M Source/WebKit/UIProcess/WebProcessProxy.cpp
    M Source/WebKit/UIProcess/WebProcessProxy.h
    M Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreClient.h
    M Tools/WebKitTestRunner/cocoa/TestWebsiteDataStoreDelegate.mm

  Log Message:
  -----------
  Adding layout tests for postMessage CryptoKey for ServiceWorkers.
https://bugs.webkit.org/show_bug.cgi?id=183167
rdar://124393477

Reviewed by Sihui Liu and Alex Christensen.

webCryptoMasterkey in WkWebsiteDataStoreDelegate and webCryptoMasterKeyforWebView in
WKNavigationDelegatePrivate both need to return the same masterKey. This is essential for
both postMessage from MainPage to ServiceWorker and vice versa to work for CryptoKeys.
Here we demonstrate it working via a test.

We can remove the webCryptoMasterKeyForWebView and only have the new one once
Safari can implement webCryptoMasterKey.(Just like in the
test implementation here).

Also, WebKitTestRunner is using the V3Navigation client which is actually using a hardcoded
value for the key for deterministic tests. So Setting the same value for WKWebsiteDataStoreDelegate.

Essentially, ServiceWorkers were enable to do PostMessage of a key but it's just that after
276088 at main it just so happened that the ServiceWorker was using the default key but the main Page
had a hardcoded key. This patch also fixes that.

* LayoutTests/http/tests/workers/service/indexeddb-cryptokey-put-get.https-expected.txt:
* LayoutTests/http/tests/workers/service/resources/indexeddb-cryptokey-put-get-worker.js:
(async runTest):
(async createKeys): Deleted.
(async testFetchedKeys): Deleted.
* LayoutTests/http/tests/workers/service/resources/indexeddb-cryptokey-put-get.js:
(async test):
(async checkKey):
(async createKeys):
(async testKey):
(async event):
(event.catch): Deleted.
* LayoutTests/http/tests/workers/service/resources/sw-test-pre.js:
(bytesToHexString):
* Tools/WebKitTestRunner/cocoa/TestWebsiteDataStoreDelegate.mm:
(-[TestWebsiteDataStoreDelegate webCryptoMasterKey]):

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



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list