Changeset 285164 in webkit


Ignore:
Timestamp:
Nov 2, 2021 10:01:52 AM (9 months ago)
Author:
Patrick Angle
Message:

WebDriver: [Cocoa] support acceptInsecureCerts capability
https://bugs.webkit.org/show_bug.cgi?id=231789

Reviewed by BJ Burg.

Add necessary plumbing to support the acceptInsecureCerts WebDriver capability.

Source/JavaScriptCore:

  • inspector/remote/RemoteInspectorConstants.h:
  • inspector/remote/cocoa/RemoteInspectorCocoa.mm:

(Inspector::RemoteInspector::receivedAutomationSessionRequestMessage):

Source/WebKit:

  • UIProcess/API/Cocoa/_WKAutomationSessionConfiguration.h:
  • UIProcess/API/Cocoa/_WKAutomationSessionConfiguration.mm:

(-[_WKAutomationSessionConfiguration init]):
(-[_WKAutomationSessionConfiguration copyWithZone:]):

  • UIProcess/Cocoa/AutomationClient.mm:

(WebKit::AutomationClient::requestAutomationSession):

Location:
trunk/Source
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r285154 r285164  
     12021-11-02  Patrick Angle  <pangle@apple.com>
     2
     3        WebDriver: [Cocoa] support `acceptInsecureCerts` capability
     4        https://bugs.webkit.org/show_bug.cgi?id=231789
     5
     6        Reviewed by BJ Burg.
     7
     8        Add necessary plumbing to support the `acceptInsecureCerts` WebDriver capability.
     9
     10        * inspector/remote/RemoteInspectorConstants.h:
     11        * inspector/remote/cocoa/RemoteInspectorCocoa.mm:
     12        (Inspector::RemoteInspector::receivedAutomationSessionRequestMessage):
     13
    1142021-11-01  Mark Lam  <mark.lam@apple.com>
    215
  • trunk/Source/JavaScriptCore/inspector/remote/RemoteInspectorConstants.h

    r272889 r285164  
    104104// The value for WIRSessionCapabilitiesKey is a dictionary that holds these capability key-value pairs.
    105105
     106#define WIRAcceptInsecureCertificatesKey               @"org.webkit.webdriver.accept-insecure-certificates"
    106107#define WIRAllowInsecureMediaCaptureCapabilityKey      @"org.webkit.webdriver.webrtc.allow-insecure-media-capture"
    107108#define WIRSuppressICECandidateFilteringCapabilityKey  @"org.webkit.webdriver.webrtc.suppress-ice-candidate-filtering"
  • trunk/Source/JavaScriptCore/inspector/remote/cocoa/RemoteInspectorCocoa.mm

    r280370 r285164  
    730730
    731731    Client::SessionCapabilities sessionCapabilities;
     732    if (NSNumber *value = forwardedCapabilities[WIRAcceptInsecureCertificatesKey]) {
     733        if ([value isKindOfClass:[NSNumber class]])
     734            sessionCapabilities.acceptInsecureCertificates = value.boolValue;
     735    }
     736
    732737    if (NSNumber *value = forwardedCapabilities[WIRAllowInsecureMediaCaptureCapabilityKey]) {
    733738        if ([value isKindOfClass:[NSNumber class]])
  • trunk/Source/WebKit/ChangeLog

    r285163 r285164  
     12021-11-02  Patrick Angle  <pangle@apple.com>
     2
     3        WebDriver: [Cocoa] support `acceptInsecureCerts` capability
     4        https://bugs.webkit.org/show_bug.cgi?id=231789
     5
     6        Reviewed by BJ Burg.
     7
     8        Add necessary plumbing to support the `acceptInsecureCerts` WebDriver capability.
     9
     10        * UIProcess/API/Cocoa/_WKAutomationSessionConfiguration.h:
     11        * UIProcess/API/Cocoa/_WKAutomationSessionConfiguration.mm:
     12        (-[_WKAutomationSessionConfiguration init]):
     13        (-[_WKAutomationSessionConfiguration copyWithZone:]):
     14        * UIProcess/Cocoa/AutomationClient.mm:
     15        (WebKit::AutomationClient::requestAutomationSession):
     16
    1172021-11-02  Kate Cheney  <katherine_cheney@apple.com>
    218
  • trunk/Source/WebKit/UIProcess/API/Cocoa/_WKAutomationSessionConfiguration.h

    r245294 r285164  
    3333@interface _WKAutomationSessionConfiguration : NSObject <NSCopying>
    3434
     35@property (nonatomic) BOOL acceptInsecureCertificates;
    3536@property (nonatomic) BOOL allowsInsecureMediaCapture;
    3637@property (nonatomic) BOOL suppressesICECandidateFiltering;
  • trunk/Source/WebKit/UIProcess/API/Cocoa/_WKAutomationSessionConfiguration.mm

    r242339 r285164  
    3434        return nil;
    3535
     36    _acceptInsecureCertificates = NO;
    3637    _allowsInsecureMediaCapture = YES;
    3738    _suppressesICECandidateFiltering = NO;
     
    4445    _WKAutomationSessionConfiguration *configuration = [(_WKAutomationSessionConfiguration *)[[self class] allocWithZone:zone] init];
    4546
     47    configuration.acceptInsecureCertificates = self.acceptInsecureCertificates;
    4648    configuration.allowsInsecureMediaCapture = self.allowsInsecureMediaCapture;
    4749    configuration.suppressesICECandidateFiltering = self.suppressesICECandidateFiltering;
  • trunk/Source/WebKit/UIProcess/Cocoa/AutomationClient.mm

    r272936 r285164  
    7979{
    8080    auto configuration = adoptNS([[_WKAutomationSessionConfiguration alloc] init]);
     81    [configuration setAcceptInsecureCertificates:sessionCapabilities.acceptInsecureCertificates];
     82   
    8183    if (sessionCapabilities.allowInsecureMediaCapture)
    8284        [configuration setAllowsInsecureMediaCapture:sessionCapabilities.allowInsecureMediaCapture.value()];
Note: See TracChangeset for help on using the changeset viewer.