source: webkit/trunk/Tools/TestWebKitAPI/Configurations/TestWebKitAPI-iOS.entitlements@ 286764

Last change on this file since 286764 was 286764, checked in by beidson@apple.com, 3 years ago

Add ability to inject messages into webpushd
https://bugs.webkit.org/show_bug.cgi?id=233988

Reviewed by Alex Christensen.

Source/WebKit:

Covered by API tests.

This patch:

  • Adds WKWebsiteDataStore SPI to fetch pending push messages for the embedding application
  • Gives webpushd code to inject a push message for a given bundle identifier
  • Gives webpushtool the ability to send one of these fake messages
  • Gives webpushtool the ability to reconnect to the next daemon instance after the current connection is dropped
  • Tests the injection and fetching of push messages via TestWebKitAPI
  • Configurations/webpushtool.xcconfig:
  • WebKit.xcodeproj/project.pbxproj:
  • Resources/webpushtool.entitlements:
  • NetworkProcess/NetworkProcess.cpp:

(WebKit::NetworkProcess::getPendingPushMessages):
(WebKit::NetworkProcess::processPushMessage):

  • NetworkProcess/NetworkProcess.h:
  • NetworkProcess/NetworkProcess.messages.in:
  • NetworkProcess/Notifications/NetworkNotificationManager.cpp:

(WebKit::NetworkNotificationManager::getPendingPushMessages):
(WebKit::ReplyCaller<Vector<WebPushMessage>::callReply):

  • NetworkProcess/Notifications/NetworkNotificationManager.h:
  • Shared/Cocoa/WebPushMessageCocoa.mm: Copied from Source/WebKit/webpushd/webpushtool/WebPushToolConnection.h.

(WebKit::WebPushMessage::fromDictionary):
(WebKit::WebPushMessage::toDictionary const):

  • Shared/PushMessageForTesting.h: Copied from Source/WebKit/Shared/WebPushDaemonConstants.h.

(WebKit::WebPushD::PushMessageForTesting::encode const):
(WebKit::WebPushD::PushMessageForTesting::decode):

  • Shared/WebPushDaemonConstants.h:

(WebKit::WebPushD::messageTypeSendsReply):

  • Shared/WebPushMessage.h: Copied from Source/WebKit/webpushd/webpushtool/WebPushToolConnection.h.

(WebKit::WebPushMessage::encode const):
(WebKit::WebPushMessage::decode):

  • UIProcess/API/Cocoa/WKWebsiteDataStore.mm:

(-[WKWebsiteDataStore _getPendingPushMessages:]):
(-[WKWebsiteDataStore _processPushMessage:completionHandler:]):
(-[WKWebsiteDataStore _processPushMessage:registration:completionHandler:]): Deleted.

  • UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
  • UIProcess/Network/NetworkProcessProxy.cpp:

(WebKit::NetworkProcessProxy::getPendingPushMessages):
(WebKit::NetworkProcessProxy::processPushMessage):

  • UIProcess/Network/NetworkProcessProxy.h:

Tools:

  • TestWebKitAPI/Configurations/TestWebKitAPI-iOS.entitlements:
  • TestWebKitAPI/Configurations/TestWebKitAPI-macOS-internal.entitlements:
  • TestWebKitAPI/Configurations/TestWebKitAPI-macOS.entitlements:
  • TestWebKitAPI/Tests/WebKitCocoa/PushAPI.mm:

(messageDictionary):

  • TestWebKitAPI/Tests/WebKitCocoa/WebPushDaemon.mm:

(TestWebKitAPI::createMessageDictionary):
(TestWebKitAPI::sendMessageToDaemon):
(TestWebKitAPI::sendMessageToDaemonWaitingForReply):
(TestWebKitAPI::sendConfigurationWithAuditToken):
(TestWebKitAPI::createAndConfigureConnectionToService):
(TestWebKitAPI::encodeString):
(TestWebKitAPI::TEST):
(TestWebKitAPI::function):

  • TestWebKitAPI/cocoa/TestWKWebView.h:
File size: 607 bytes
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3<plist version="1.0">
4<dict>
5 <key>keychain-access-groups</key>
6 <array>
7 <string>com.apple.TestWebKitAPI</string>
8 </array>
9 <key>com.apple.developer.WebKit.ServiceWorkers</key>
10 <true/>
11 <key>com.apple.Pasteboard.paste-unchecked</key>
12 <true/>
13 <key>com.apple.private.webkit.webpush</key>
14 <true/>
15 <key>com.apple.private.webkit.webpush.inject</key>
16 <true/>
17 <key>com.apple.private.xpc.launchd.job-manager</key>
18 <string>TestWebKitAPI</string>
19</dict>
20</plist>
Note: See TracBrowser for help on using the repository browser.