⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 286329 in webkit


Ignore:
Timestamp:
Nov 30, 2021, 2:58:27 PM (5 years ago)
Author:
BJ Burg
Message:

Web Inspector: add ExtensionTabActivation diagnostic event
https://bugs.webkit.org/show_bug.cgi?id=233101
<rdar://85264921>

Reviewed by Devin Rousso.

Source/WebInspectorUI:

Add new diagnostic event that reports the first activation of
an extension tab. Also report the number of active extension tabs.

  • UserInterface/Controllers/ExtensionTabActivationDiagnosticEventRecorder.js: Added.

(WI.ExtensionTabActivationDiagnosticEventRecorder):
(WI.ExtensionTabActivationDiagnosticEventRecorder.prototype.setup):
(WI.ExtensionTabActivationDiagnosticEventRecorder.prototype.teardown):
(WI.ExtensionTabActivationDiagnosticEventRecorder.prototype._selectedTabContentViewDidChange):
Report only the first activation. The extension tab iframe does not load until
the first time that the tab is selected and shown.

  • UserInterface/Base/Main.js:

(WI.contentLoaded): Add diagnostic event recorder if extensions are supported.

  • UserInterface/Controllers/WebInspectorExtensionController.js:

(WI.WebInspectorExtensionController.prototype.registerExtension):
Pass along the new extensionBundleIdentifier argument to the model object.

(WI.WebInspectorExtensionController.prototype.activeExtensionTabContentViews):
Added. This is a helper method for collecting diagnostic event data.

  • UserInterface/Debug/Bootstrap.js:

(updateMockWebExtensionTab):
(WI.runBootstrapOperations):
Pass new extensionBundleIdentifier argument for the Mock Extension.

  • UserInterface/Main.html: Add new file.
  • UserInterface/Models/WebInspectorExtension.js:

(WI.WebInspectorExtension):
(WI.WebInspectorExtension.prototype.get extensionBundleIdentifier):
Store the extension bundle identifier on the model object. Add a getter.

  • UserInterface/Protocol/InspectorFrontendAPI.js:

(InspectorFrontendAPI.registerExtension):
Pass new extensionBundleIdentifier argument.

  • UserInterface/Views/WebInspectorExtensionTabContentView.js:

(WI.WebInspectorExtensionTabContentView.prototype.get extension): Added.

Source/WebKit:

Add plumbing for new argument 'extensionBundleIdentifier' that's
passed to WebInspectorUI when registering an extension.

  • UIProcess/API/Cocoa/_WKInspector.mm:

(-[_WKInspector registerExtensionWithID:extensionBundleIdentifier:displayName:completionHandler:]):
(-[_WKInspector registerExtensionWithID:displayName:completionHandler:]): Deleted.

  • UIProcess/API/Cocoa/_WKInspectorExtensionHost.h:
  • UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm:

(-[_WKRemoteWebInspectorViewController registerExtensionWithID:extensionBundleIdentifier:displayName:completionHandler:]):
(-[_WKRemoteWebInspectorViewController registerExtensionWithID:displayName:completionHandler:]): Deleted.

  • UIProcess/Inspector/WebInspectorUIExtensionControllerProxy.cpp:

(WebKit::WebInspectorUIExtensionControllerProxy::registerExtension):

  • UIProcess/Inspector/WebInspectorUIExtensionControllerProxy.h:
  • WebProcess/Inspector/WebInspectorUIExtensionController.cpp:

(WebKit::WebInspectorUIExtensionController::registerExtension):

  • WebProcess/Inspector/WebInspectorUIExtensionController.h:
  • WebProcess/Inspector/WebInspectorUIExtensionController.messages.in:

Tools:

  • TestWebKitAPI/Tests/WebKitCocoa/WKInspectorExtension.mm:

(TEST):

  • TestWebKitAPI/Tests/WebKitCocoa/WKInspectorExtensionDelegate.mm:

(TEST):

  • TestWebKitAPI/Tests/WebKitCocoa/WKInspectorExtensionHost.mm:

(TEST):
Start using new method parameter 'extensionBundleIdentifier'.

Location:
trunk
Files:
1 added
21 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r286223 r286329  
     12021-11-30  BJ Burg  <bburg@apple.com>
     2
     3        Web Inspector: add ExtensionTabActivation diagnostic event
     4        https://bugs.webkit.org/show_bug.cgi?id=233101
     5        <rdar://85264921>
     6
     7        Reviewed by Devin Rousso.
     8
     9        Add new diagnostic event that reports the first activation of
     10        an extension tab. Also report the number of active extension tabs.
     11
     12        * UserInterface/Controllers/ExtensionTabActivationDiagnosticEventRecorder.js: Added.
     13        (WI.ExtensionTabActivationDiagnosticEventRecorder):
     14        (WI.ExtensionTabActivationDiagnosticEventRecorder.prototype.setup):
     15        (WI.ExtensionTabActivationDiagnosticEventRecorder.prototype.teardown):
     16        (WI.ExtensionTabActivationDiagnosticEventRecorder.prototype._selectedTabContentViewDidChange):
     17        Report only the first activation. The extension tab iframe does not load until
     18        the first time that the tab is selected and shown.
     19
     20        * UserInterface/Base/Main.js:
     21        (WI.contentLoaded): Add diagnostic event recorder if extensions are supported.
     22
     23        * UserInterface/Controllers/WebInspectorExtensionController.js:
     24        (WI.WebInspectorExtensionController.prototype.registerExtension):
     25        Pass along the new extensionBundleIdentifier argument to the model object.
     26
     27        (WI.WebInspectorExtensionController.prototype.activeExtensionTabContentViews):
     28        Added. This is a helper method for collecting diagnostic event data.
     29
     30        * UserInterface/Debug/Bootstrap.js:
     31        (updateMockWebExtensionTab):
     32        (WI.runBootstrapOperations):
     33        Pass new extensionBundleIdentifier argument for the Mock Extension.
     34
     35        * UserInterface/Main.html: Add new file.
     36        * UserInterface/Models/WebInspectorExtension.js:
     37        (WI.WebInspectorExtension):
     38        (WI.WebInspectorExtension.prototype.get extensionBundleIdentifier):
     39        Store the extension bundle identifier on the model object. Add a getter.
     40
     41        * UserInterface/Protocol/InspectorFrontendAPI.js:
     42        (InspectorFrontendAPI.registerExtension):
     43        Pass new extensionBundleIdentifier argument.
     44
     45        * UserInterface/Views/WebInspectorExtensionTabContentView.js:
     46        (WI.WebInspectorExtensionTabContentView.prototype.get extension): Added.
     47
    1482021-11-29  Simon Fraser  <simon.fraser@apple.com>
    249
  • trunk/Source/WebInspectorUI/UserInterface/Base/Main.js

    r285974 r286329  
    609609            WI.diagnosticController.addRecorder(new WI.GridOverlayConfigurationDiagnosticEventRecorder(WI.diagnosticController));
    610610        }
     611
     612        if (InspectorFrontendHost.supportsWebExtensions)
     613            WI.diagnosticController.addRecorder(new WI.ExtensionTabActivationDiagnosticEventRecorder(WI.diagnosticController));
    611614    }
    612615};
  • trunk/Source/WebInspectorUI/UserInterface/Controllers/WebInspectorExtensionController.js

    r284958 r286329  
    4545    }
    4646
    47     registerExtension(extensionID, displayName)
     47    registerExtension(extensionID, extensionBundleIdentifier, displayName)
    4848    {
    4949        if (this._extensionForExtensionIDMap.has(extensionID)) {
     
    5252        }
    5353
    54         let extension = new WI.WebInspectorExtension(extensionID, displayName);
     54        let extension = new WI.WebInspectorExtension(extensionID, extensionBundleIdentifier, displayName);
    5555        this._extensionForExtensionIDMap.set(extensionID, extension);
    5656
     
    231231            }, checked);
    232232        }
     233    }
     234
     235    activeExtensionTabContentViews()
     236    {
     237        return Array.from(this._extensionTabContentViewForExtensionTabIDMap.values()).filter((tab) => tab.visible || tab.tabBarItem.parentTabBar);
    233238    }
    234239
  • trunk/Source/WebInspectorUI/UserInterface/Debug/Bootstrap.js

    r283728 r286329  
    144144        let mockData = {
    145145            extensionID: "1234567890ABCDEF",
     146            extensionBundleIdentifier: "org.webkit.WebInspector.MockExtension",
    146147            displayName: WI.unlocalizedString("Mock Extension"),
    147148            tabName: WI.unlocalizedString("Mock"),
     
    158159        }
    159160
    160         let error = InspectorFrontendAPI.registerExtension(mockData.extensionID, mockData.displayName);
     161        let error = InspectorFrontendAPI.registerExtension(mockData.extensionID, mockData.extensionBundleIdentifier, mockData.displayName);
    161162        if (error) {
    162163            WI.reportInternalError("Problem creating mock web extension: " + error);
  • trunk/Source/WebInspectorUI/UserInterface/Main.html

    r285983 r286329  
    938938    <script src="Controllers/DiagnosticController.js"></script>
    939939    <script src="Controllers/DiagnosticEventRecorder.js"></script>
     940    <script src="Controllers/ExtensionTabActivationDiagnosticEventRecorder.js"></script>
    940941    <script src="Controllers/GridOverlayConfigurationDiagnosticEventRecorder.js"></script>
    941942    <script src="Controllers/GridOverlayDiagnosticEventRecorder.js"></script>
  • trunk/Source/WebInspectorUI/UserInterface/Models/WebInspectorExtension.js

    r273522 r286329  
    11/*
    2  * Copyright (C) 2020 Apple Inc. All rights reserved.
     2 * Copyright (C) 2020-2021 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2626WI.WebInspectorExtension = class WebInspectorExtension
    2727{
    28     constructor(extensionID, displayName)
     28    constructor(extensionID, extensionBundleIdentifier, displayName)
    2929    {
    3030        console.assert(typeof extensionID === "string", extensionID);
     31        console.assert(typeof extensionBundleIdentifier === "string", extensionBundleIdentifier);
    3132        console.assert(typeof displayName === "string", displayName);
    3233
    3334        this._extensionID = extensionID;
     35        this._extensionBundleIdentifier = extensionBundleIdentifier;
    3436        this._displayName = displayName;
    3537    }
     
    3840
    3941    get extensionID() { return this._extensionID; }
     42    get extensionBundleIdentifier() { return this._extensionBundleIdentifier; }
    4043    get displayName() { return this._displayName; }
    4144};
  • trunk/Source/WebInspectorUI/UserInterface/Protocol/InspectorFrontendAPI.js

    r284264 r286329  
    200200
    201201    // Returns a WI.WebInspectorExtension.ErrorCode if an error occurred, otherwise nothing.
    202     registerExtension(extensionID, displayName)
    203     {
    204         return WI.sharedApp.extensionController.registerExtension(extensionID, displayName);
     202    registerExtension(extensionID, extensionBundleIdentifier, displayName)
     203    {
     204        return WI.sharedApp.extensionController.registerExtension(extensionID, extensionBundleIdentifier, displayName);
    205205    },
    206206
  • trunk/Source/WebInspectorUI/UserInterface/Views/WebInspectorExtensionTabContentView.js

    r284958 r286329  
    6060    // Public
    6161
     62    get extension() { return this._extension; }
    6263    get extensionTabID() { return this._extensionTabID; }
    6364    get iframeElement() { return this._iframeElement; }
  • trunk/Source/WebKit/ChangeLog

    r286320 r286329  
     12021-11-30  BJ Burg  <bburg@apple.com>
     2
     3        Web Inspector: add ExtensionTabActivation diagnostic event
     4        https://bugs.webkit.org/show_bug.cgi?id=233101
     5        <rdar://85264921>
     6
     7        Reviewed by Devin Rousso.
     8
     9        Add plumbing for new argument 'extensionBundleIdentifier' that's
     10        passed to WebInspectorUI when registering an extension.
     11
     12        * UIProcess/API/Cocoa/_WKInspector.mm:
     13        (-[_WKInspector registerExtensionWithID:extensionBundleIdentifier:displayName:completionHandler:]):
     14        (-[_WKInspector registerExtensionWithID:displayName:completionHandler:]): Deleted.
     15        * UIProcess/API/Cocoa/_WKInspectorExtensionHost.h:
     16        * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm:
     17        (-[_WKRemoteWebInspectorViewController registerExtensionWithID:extensionBundleIdentifier:displayName:completionHandler:]):
     18        (-[_WKRemoteWebInspectorViewController registerExtensionWithID:displayName:completionHandler:]): Deleted.
     19        * UIProcess/Inspector/WebInspectorUIExtensionControllerProxy.cpp:
     20        (WebKit::WebInspectorUIExtensionControllerProxy::registerExtension):
     21        * UIProcess/Inspector/WebInspectorUIExtensionControllerProxy.h:
     22        * WebProcess/Inspector/WebInspectorUIExtensionController.cpp:
     23        (WebKit::WebInspectorUIExtensionController::registerExtension):
     24        * WebProcess/Inspector/WebInspectorUIExtensionController.h:
     25        * WebProcess/Inspector/WebInspectorUIExtensionController.messages.in:
     26
    1272021-11-30  Myles C. Maxfield  <mmaxfield@apple.com>
    228
  • trunk/Source/WebKit/UIProcess/API/Cocoa/_WKInspector.mm

    r283220 r286329  
    227227}
    228228
    229 - (void)registerExtensionWithID:(NSString *)extensionID displayName:(NSString *)displayName completionHandler:(void(^)(NSError *, _WKInspectorExtension *))completionHandler
     229- (void)registerExtensionWithID:(NSString *)extensionID extensionBundleIdentifier:(NSString *)extensionBundleIdentifier displayName:(NSString *)displayName completionHandler:(void(^)(NSError *, _WKInspectorExtension *))completionHandler
    230230{
    231231#if ENABLE(INSPECTOR_EXTENSIONS)
     
    236236    }
    237237
    238     _inspector->extensionController()->registerExtension(extensionID, displayName, [protectedSelf = retainPtr(self), capturedBlock = makeBlockPtr(completionHandler)] (Expected<RefPtr<API::InspectorExtension>, Inspector::ExtensionError> result) mutable {
     238    _inspector->extensionController()->registerExtension(extensionID, extensionBundleIdentifier, displayName, [protectedSelf = retainPtr(self), capturedBlock = makeBlockPtr(completionHandler)] (Expected<RefPtr<API::InspectorExtension>, Inspector::ExtensionError> result) mutable {
    239239        if (!result) {
    240240            capturedBlock([NSError errorWithDomain:WKErrorDomain code:WKErrorUnknown userInfo:@{ NSLocalizedFailureReasonErrorKey: Inspector::extensionErrorToString(result.error())}], nil);
  • trunk/Source/WebKit/UIProcess/API/Cocoa/_WKInspectorExtensionHost.h

    r283196 r286329  
    3838 * @abstract Registers a Web Extension with the associated Web Inspector.
    3939 * @param extensionID A unique identifier for the extension.
     40 * @param extensionBundleIdentifier A bundle identifier for the extension.
    4041 * @param displayName A localized display name for the extension.
    4142 * @param completionHandler The completion handler to be called when registration succeeds or fails.
     
    4344 * Web Extensions in Web Inspector are active as soon as they are registered.
    4445 */
    45 - (void)registerExtensionWithID:(NSString *)extensionID displayName:(NSString *)displayName completionHandler:(void(^)(NSError * _Nullable, _WKInspectorExtension * _Nullable))completionHandler;
     46- (void)registerExtensionWithID:(NSString *)extensionID extensionBundleIdentifier:(NSString *)extensionBundleIdentifier displayName:(NSString *)displayName completionHandler:(void(^)(NSError * _Nullable, _WKInspectorExtension * _Nullable))completionHandler;
    4647
    4748/**
  • trunk/Source/WebKit/UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm

    r284329 r286329  
    171171}
    172172
    173 - (void)registerExtensionWithID:(NSString *)extensionID displayName:(NSString *)displayName completionHandler:(void(^)(NSError *, _WKInspectorExtension * _Nullable))completionHandler
     173- (void)registerExtensionWithID:(NSString *)extensionID extensionBundleIdentifier:(NSString *)extensionBundleIdentifier displayName:(NSString *)displayName completionHandler:(void(^)(NSError *, _WKInspectorExtension * _Nullable))completionHandler
    174174{
    175175#if ENABLE(INSPECTOR_EXTENSIONS)
     
    180180    }
    181181
    182     m_remoteInspectorProxy->extensionController()->registerExtension(extensionID, displayName, [protectedExtensionID = retainPtr(extensionID), protectedSelf = retainPtr(self), capturedBlock = makeBlockPtr(completionHandler)] (Expected<RefPtr<API::InspectorExtension>, Inspector::ExtensionError> result) mutable {
     182    m_remoteInspectorProxy->extensionController()->registerExtension(extensionID, extensionBundleIdentifier, displayName, [protectedExtensionID = retainPtr(extensionID), protectedSelf = retainPtr(self), capturedBlock = makeBlockPtr(completionHandler)] (Expected<RefPtr<API::InspectorExtension>, Inspector::ExtensionError> result) mutable {
    183183        if (!result) {
    184184            capturedBlock([NSError errorWithDomain:WKErrorDomain code:WKErrorUnknown userInfo:@{ NSLocalizedFailureReasonErrorKey: Inspector::extensionErrorToString(result.error()) }], nil);
  • trunk/Source/WebKit/UIProcess/Inspector/WebInspectorUIExtensionControllerProxy.cpp

    r286306 r286329  
    9393// API
    9494
    95 void WebInspectorUIExtensionControllerProxy::registerExtension(const Inspector::ExtensionID& extensionID, const String& displayName, WTF::CompletionHandler<void(Expected<RefPtr<API::InspectorExtension>, Inspector::ExtensionError>)>&& completionHandler)
    96 {
    97     whenFrontendHasLoaded([weakThis = WeakPtr { *this }, extensionID, displayName, completionHandler = WTFMove(completionHandler)] () mutable {
     95void WebInspectorUIExtensionControllerProxy::registerExtension(const Inspector::ExtensionID& extensionID, const String& extensionBundleIdentifier, const String& displayName, WTF::CompletionHandler<void(Expected<RefPtr<API::InspectorExtension>, Inspector::ExtensionError>)>&& completionHandler)
     96{
     97    whenFrontendHasLoaded([weakThis = WeakPtr { *this }, extensionID, extensionBundleIdentifier, displayName, completionHandler = WTFMove(completionHandler)] () mutable {
    9898        if (!weakThis || !weakThis->m_inspectorPage) {
    9999            completionHandler(makeUnexpected(Inspector::ExtensionError::InvalidRequest));
     
    101101        }
    102102
    103         weakThis->m_inspectorPage->sendWithAsyncReply(Messages::WebInspectorUIExtensionController::RegisterExtension { extensionID, displayName }, [strongThis = Ref { *weakThis.get() }, extensionID, completionHandler = WTFMove(completionHandler)](Expected<void, Inspector::ExtensionError> result) mutable {
     103        weakThis->m_inspectorPage->sendWithAsyncReply(Messages::WebInspectorUIExtensionController::RegisterExtension { extensionID, extensionBundleIdentifier, displayName }, [strongThis = Ref { *weakThis.get() }, extensionID, completionHandler = WTFMove(completionHandler)](Expected<void, Inspector::ExtensionError> result) mutable {
    104104            if (!result) {
    105105                completionHandler(makeUnexpected(Inspector::ExtensionError::RegistrationFailed));
  • trunk/Source/WebKit/UIProcess/Inspector/WebInspectorUIExtensionControllerProxy.h

    r283857 r286329  
    5656
    5757    // API.
    58     void registerExtension(const Inspector::ExtensionID&, const String& displayName, WTF::CompletionHandler<void(Expected<RefPtr<API::InspectorExtension>, Inspector::ExtensionError>)>&&);
     58    void registerExtension(const Inspector::ExtensionID&, const String& extensionBundleIdentifier, const String& displayName, WTF::CompletionHandler<void(Expected<RefPtr<API::InspectorExtension>, Inspector::ExtensionError>)>&&);
    5959    void unregisterExtension(const Inspector::ExtensionID&, WTF::CompletionHandler<void(Expected<void, Inspector::ExtensionError>)>&&);
    6060    void createTabForExtension(const Inspector::ExtensionID&, const String& tabName, const URL& tabIconURL, const URL& sourceURL, WTF::CompletionHandler<void(Expected<Inspector::ExtensionTabID, Inspector::ExtensionError>)>&&);
  • trunk/Source/WebKit/WebProcess/Inspector/WebInspectorUIExtensionController.cpp

    r284264 r286329  
    110110// WebInspectorUIExtensionController IPC messages.
    111111
    112 void WebInspectorUIExtensionController::registerExtension(const Inspector::ExtensionID& extensionID, const String& displayName, CompletionHandler<void(Expected<void, Inspector::ExtensionError>)>&& completionHandler)
     112void WebInspectorUIExtensionController::registerExtension(const Inspector::ExtensionID& extensionID, const String& extensionBundleIdentifier, const String& displayName, CompletionHandler<void(Expected<void, Inspector::ExtensionError>)>&& completionHandler)
    113113{
    114114    if (!m_frontendClient) {
     
    119119    Vector<Ref<JSON::Value>> arguments {
    120120        JSON::Value::create(extensionID),
     121        JSON::Value::create(extensionBundleIdentifier),
    121122        JSON::Value::create(displayName),
    122123    };
  • trunk/Source/WebKit/WebProcess/Inspector/WebInspectorUIExtensionController.h

    r283857 r286329  
    6464
    6565    // WebInspectorUIExtensionController IPC messages.
    66     void registerExtension(const Inspector::ExtensionID&, const String& displayName, CompletionHandler<void(Expected<void, Inspector::ExtensionError>)>&&);
     66    void registerExtension(const Inspector::ExtensionID&, const String& extensionBundleIdentifier, const String& displayName, CompletionHandler<void(Expected<void, Inspector::ExtensionError>)>&&);
    6767    void unregisterExtension(const Inspector::ExtensionID&, CompletionHandler<void(Expected<void, Inspector::ExtensionError>)>&&);
    6868    void createTabForExtension(const Inspector::ExtensionID&, const String& tabName, const URL& tabIconURL, const URL& sourceURL, CompletionHandler<void(Expected<Inspector::ExtensionTabID, Inspector::ExtensionError>)>&&);
  • trunk/Source/WebKit/WebProcess/Inspector/WebInspectorUIExtensionController.messages.in

    r283276 r286329  
    2424
    2525messages -> WebInspectorUIExtensionController NotRefCounted {
    26     RegisterExtension(String extensionID, String displayName) -> (Expected<void, Inspector::ExtensionError> result) Async
     26    RegisterExtension(String extensionID, String extensionBundleIdentifier, String displayName) -> (Expected<void, Inspector::ExtensionError> result) Async
    2727    UnregisterExtension(String extensionID) -> (Expected<void, Inspector::ExtensionError> result) Async
    2828
  • trunk/Tools/ChangeLog

    r286311 r286329  
     12021-11-30  BJ Burg  <bburg@apple.com>
     2
     3        Web Inspector: add ExtensionTabActivation diagnostic event
     4        https://bugs.webkit.org/show_bug.cgi?id=233101
     5        <rdar://85264921>
     6
     7        Reviewed by Devin Rousso.
     8
     9        * TestWebKitAPI/Tests/WebKitCocoa/WKInspectorExtension.mm:
     10        (TEST):
     11        * TestWebKitAPI/Tests/WebKitCocoa/WKInspectorExtensionDelegate.mm:
     12        (TEST):
     13        * TestWebKitAPI/Tests/WebKitCocoa/WKInspectorExtensionHost.mm:
     14        (TEST):
     15        Start using new method parameter 'extensionBundleIdentifier'.
     16
    1172021-11-30  Brent Fulgham  <bfulgham@apple.com>
    218
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKInspectorExtension.mm

    r285547 r286329  
    101101
    102102    auto extensionID = [NSUUID UUID].UUIDString;
     103    auto extensionBundleIdentifier = @"org.webkit.TestWebKitAPI.FirstExtension";
    103104    auto extensionDisplayName = @"FirstExtension";
    104105
    105106    // Register the test extension.
    106107    pendingCallbackWasCalled = false;
    107     [[webView _inspector] registerExtensionWithID:extensionID displayName:extensionDisplayName completionHandler:^(NSError * _Nullable error, _WKInspectorExtension * _Nullable extension) {
     108    [[webView _inspector] registerExtensionWithID:extensionID extensionBundleIdentifier:extensionBundleIdentifier displayName:extensionDisplayName completionHandler:^(NSError * _Nullable error, _WKInspectorExtension * _Nullable extension) {
    108109        EXPECT_NULL(error);
    109110        EXPECT_NOT_NULL(extension);
     
    191192
    192193    auto extensionID = [NSUUID UUID].UUIDString;
     194    auto extensionBundleIdentifier = @"org.webkit.TestWebKitAPI.SecondExtension";
    193195    auto extensionDisplayName = @"SecondExtension";
    194196
    195197    // Register the test extension.
    196198    pendingCallbackWasCalled = false;
    197     [[webView _inspector] registerExtensionWithID:extensionID displayName:extensionDisplayName completionHandler:^(NSError * _Nullable error, _WKInspectorExtension * _Nullable extension) {
     199    [[webView _inspector] registerExtensionWithID:extensionID extensionBundleIdentifier:extensionBundleIdentifier displayName:extensionDisplayName completionHandler:^(NSError * _Nullable error, _WKInspectorExtension * _Nullable extension) {
    198200        EXPECT_NULL(error);
    199201        EXPECT_NOT_NULL(extension);
     
    308310
    309311    auto extensionID = [NSUUID UUID].UUIDString;
     312    auto extensionBundleIdentifier = @"org.webkit.TestWebKitAPI.ThirdExtension";
    310313    auto extensionDisplayName = @"ThirdExtension";
    311314
    312315    // Register the test extension.
    313316    pendingCallbackWasCalled = false;
    314     [[webView _inspector] registerExtensionWithID:extensionID displayName:extensionDisplayName completionHandler:^(NSError * _Nullable error, _WKInspectorExtension * _Nullable extension) {
     317    [[webView _inspector] registerExtensionWithID:extensionID extensionBundleIdentifier:extensionBundleIdentifier displayName:extensionDisplayName completionHandler:^(NSError * _Nullable error, _WKInspectorExtension * _Nullable extension) {
    315318        EXPECT_NULL(error);
    316319        EXPECT_NOT_NULL(extension);
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKInspectorExtensionDelegate.mm

    r285957 r286329  
    109109
    110110    auto extensionID = [NSUUID UUID].UUIDString;
     111    auto extensionBundleIdentifier = @"com.apple.webkit.FirstExtension";
    111112    auto extensionDisplayName = @"FirstExtension";
    112113
    113114    // Register the test extension.
    114115    pendingCallbackWasCalled = false;
    115     [[webView _inspector] registerExtensionWithID:extensionID displayName:extensionDisplayName completionHandler:^(NSError * _Nullable error, _WKInspectorExtension * _Nullable extension) {
     116    [[webView _inspector] registerExtensionWithID:extensionID extensionBundleIdentifier:extensionBundleIdentifier displayName:extensionDisplayName completionHandler:^(NSError * _Nullable error, _WKInspectorExtension * _Nullable extension) {
    116117        EXPECT_NULL(error);
    117118        EXPECT_NOT_NULL(extension);
     
    188189    // Register the test extension.
    189190    auto extensionID = [NSUUID UUID].UUIDString;
     191    auto extensionBundleIdentifier = @"com.apple.webkit.SecondExtension";
    190192    auto extensionDisplayName = @"SecondExtension";
    191193    pendingCallbackWasCalled = false;
    192     [[webView _inspector] registerExtensionWithID:extensionID displayName:extensionDisplayName completionHandler:^(NSError * _Nullable error, _WKInspectorExtension * _Nullable extension) {
     194    [[webView _inspector] registerExtensionWithID:extensionID extensionBundleIdentifier:extensionBundleIdentifier displayName:extensionDisplayName completionHandler:^(NSError * _Nullable error, _WKInspectorExtension * _Nullable extension) {
    193195        EXPECT_NULL(error);
    194196        EXPECT_NOT_NULL(extension);
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKInspectorExtensionHost.mm

    r285547 r286329  
    7070    // Normal registration.
    7171    pendingCallbackWasCalled = false;
    72     [[webView _inspector] registerExtensionWithID:firstID displayName:@"FirstExtension" completionHandler:^(NSError * _Nullable error, _WKInspectorExtension * _Nullable extension) {
     72    [[webView _inspector] registerExtensionWithID:firstID extensionBundleIdentifier:@"com.apple.webkit.FirstExtension" displayName:@"FirstExtension" completionHandler:^(NSError * _Nullable error, _WKInspectorExtension * _Nullable extension) {
    7373        EXPECT_NULL(error);
    7474        EXPECT_NOT_NULL(extension);
     
    8080    // Double registration.
    8181    pendingCallbackWasCalled = false;
    82     [[webView _inspector] registerExtensionWithID:firstID displayName:@"FirstExtension" completionHandler:^(NSError * _Nullable error, _WKInspectorExtension * _Nullable extension) {
     82    [[webView _inspector] registerExtensionWithID:firstID extensionBundleIdentifier:@"com.apple.webkit.FirstExtension" displayName:@"FirstExtension" completionHandler:^(NSError * _Nullable error, _WKInspectorExtension * _Nullable extension) {
    8383        EXPECT_NOT_NULL(error);
    8484        EXPECT_NULL(extension);
     
    9191    // Two registrations.
    9292    pendingCallbackWasCalled = false;
    93     [[webView _inspector] registerExtensionWithID:secondID displayName:@"SecondExtension" completionHandler:^(NSError * _Nullable error, _WKInspectorExtension * _Nullable extension) {
     93    [[webView _inspector] registerExtensionWithID:secondID extensionBundleIdentifier:@"com.apple.webkit.SecondExtension" displayName:@"SecondExtension" completionHandler:^(NSError * _Nullable error, _WKInspectorExtension * _Nullable extension) {
    9494        EXPECT_NULL(error);
    9595        EXPECT_NOT_NULL(extension);
     
    120120    // Unregister a known extension.
    121121    pendingCallbackWasCalled = false;
    122     [[webView _inspector] registerExtensionWithID:firstID displayName:@"FirstExtension" completionHandler:^(NSError * _Nullable error, _WKInspectorExtension * _Nullable extension) {
     122    [[webView _inspector] registerExtensionWithID:firstID extensionBundleIdentifier:@"com.apple.webkit.FirstExtension" displayName:@"FirstExtension" completionHandler:^(NSError * _Nullable error, _WKInspectorExtension * _Nullable extension) {
    123123        EXPECT_NULL(error);
    124124        EXPECT_NOT_NULL(extension);
     
    136136    // Re-register an extension.
    137137    pendingCallbackWasCalled = false;
    138     [[webView _inspector] registerExtensionWithID:firstID displayName:@"FirstExtension" completionHandler:^(NSError * _Nullable error, _WKInspectorExtension * _Nullable extension) {
     138    [[webView _inspector] registerExtensionWithID:firstID extensionBundleIdentifier:@"com.apple.webkit.FirstExtension" displayName:@"FirstExtension" completionHandler:^(NSError * _Nullable error, _WKInspectorExtension * _Nullable extension) {
    139139        EXPECT_NULL(error);
    140140        EXPECT_NOT_NULL(extension);
Note: See TracChangeset for help on using the changeset viewer.