<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[248823] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/248823">248823</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2019-08-17 12:13:59 -0700 (Sat, 17 Aug 2019)</dd>
</dl>

<h3>Log Message</h3>
<pre>Source/WebKit:
Use bundlePath SPI in AccessibilitySupport for WebProcessLoader
https://bugs.webkit.org/show_bug.cgi?id=200367

Patch by Eric Liang <ericliang@apple.com> on 2019-08-17
Reviewed by Darin Adler.

* Platform/spi/ios/AccessibilitySupportSPI.h:
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::accessibilityWebProcessLoaderBundlePath):
(WebKit::registerWithAccessibility):

Source/WTF:
Added HAVE_ACCESSIBILITY_BUNDLES_PATH
https://bugs.webkit.org/show_bug.cgi?id=200367

Patch by Eric Liang <ericliang@apple.com> on 2019-08-17
Reviewed by Darin Adler.

* wtf/Platform.h:

Tools:
Tested that accessibility WebProcessLoader bundle is loaded for the correct path.
https://bugs.webkit.org/show_bug.cgi?id=200367

Patch by Eric Liang <ericliang@apple.com> on 2019-08-17
Reviewed by Darin Adler.

Added AccessibilityTestPlugin on the web process to report whether a bundle is loaded and its path, so that it can be tested on WKContentView.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/AccessibilityTestPlugin.mm: Added.
(-[AccessibilityTestPlugin webProcessPlugIn:didCreateBrowserContextController:]):
(-[AccessibilityTestPlugin checkAccessibilityWebProcessLoaderBundleIsLoaded:]):
* TestWebKitAPI/Tests/WebKitCocoa/AccessibilityTestSupportProtocol.h: Added.
* TestWebKitAPI/Tests/ios/AccessibilityTestsIOS.mm:
(TestWebKitAPI::TEST):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWTFChangeLog">trunk/Source/WTF/ChangeLog</a></li>
<li><a href="#trunkSourceWTFwtfPlatformh">trunk/Source/WTF/wtf/Platform.h</a></li>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitPlatformspiiosAccessibilitySupportSPIh">trunk/Source/WebKit/Platform/spi/ios/AccessibilitySupportSPI.h</a></li>
<li><a href="#trunkSourceWebKitWebProcesscocoaWebProcessCocoamm">trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsTestWebKitAPITestWebKitAPIxcodeprojprojectpbxproj">trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsiosAccessibilityTestsIOSmm">trunk/Tools/TestWebKitAPI/Tests/ios/AccessibilityTestsIOS.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkToolsTestWebKitAPITestsWebKitCocoaAccessibilityTestPluginmm">trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/AccessibilityTestPlugin.mm</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKitCocoaAccessibilityTestSupportProtocolh">trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/AccessibilityTestSupportProtocol.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/ChangeLog (248822 => 248823)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/ChangeLog       2019-08-17 18:49:37 UTC (rev 248822)
+++ trunk/Source/WTF/ChangeLog  2019-08-17 19:13:59 UTC (rev 248823)
</span><span class="lines">@@ -1,3 +1,12 @@
</span><ins>+2019-08-17  Eric Liang  <ericliang@apple.com>
+
+        Added HAVE_ACCESSIBILITY_BUNDLES_PATH
+        https://bugs.webkit.org/show_bug.cgi?id=200367
+
+        Reviewed by Darin Adler.
+
+        * wtf/Platform.h:
+
</ins><span class="cx"> 2019-08-17  Sam Weinig  <weinig@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Rename StringBuilder::flexibleAppend(...) to StringBuilder::append(...)
</span></span></pre></div>
<a id="trunkSourceWTFwtfPlatformh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/Platform.h (248822 => 248823)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/Platform.h  2019-08-17 18:49:37 UTC (rev 248822)
+++ trunk/Source/WTF/wtf/Platform.h     2019-08-17 19:13:59 UTC (rev 248823)
</span><span class="lines">@@ -1498,6 +1498,10 @@
</span><span class="cx"> #define HAVE_ACCESSIBILITY_SUPPORT 1
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000
+#define HAVE_ACCESSIBILITY_BUNDLES_PATH 1
+#endif
+
</ins><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx"> #define ENABLE_FULL_KEYBOARD_ACCESS 1
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (248822 => 248823)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog    2019-08-17 18:49:37 UTC (rev 248822)
+++ trunk/Source/WebKit/ChangeLog       2019-08-17 19:13:59 UTC (rev 248823)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2019-08-17  Eric Liang  <ericliang@apple.com>
+
+        Use bundlePath SPI in AccessibilitySupport for WebProcessLoader
+        https://bugs.webkit.org/show_bug.cgi?id=200367
+
+        Reviewed by Darin Adler.
+
+        * Platform/spi/ios/AccessibilitySupportSPI.h:
+        * WebProcess/cocoa/WebProcessCocoa.mm:
+        (WebKit::accessibilityWebProcessLoaderBundlePath):
+        (WebKit::registerWithAccessibility):
+
</ins><span class="cx"> 2019-08-17  Sam Weinig  <weinig@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Rename StringBuilder::flexibleAppend(...) to StringBuilder::append(...)
</span></span></pre></div>
<a id="trunkSourceWebKitPlatformspiiosAccessibilitySupportSPIh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Platform/spi/ios/AccessibilitySupportSPI.h (248822 => 248823)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Platform/spi/ios/AccessibilitySupportSPI.h   2019-08-17 18:49:37 UTC (rev 248822)
+++ trunk/Source/WebKit/Platform/spi/ios/AccessibilitySupportSPI.h      2019-08-17 19:13:59 UTC (rev 248823)
</span><span class="lines">@@ -42,8 +42,12 @@
</span><span class="cx"> extern Boolean _AXSKeyRepeatEnabled();
</span><span class="cx"> extern Boolean _AXSApplicationAccessibilityEnabled();
</span><span class="cx"> extern CFStringRef kAXSApplicationAccessibilityEnabledNotification;
</span><ins>+#if HAVE(ACCESSIBILITY_BUNDLES_PATH)
+extern CFStringRef _AXSAccessibilityBundlesPath();
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#endif // PLATFORM(IOS_FAMILY)
+
</ins><span class="cx"> #if PLATFORM(IOS_FAMILY) && ENABLE(FULL_KEYBOARD_ACCESS)
</span><span class="cx"> extern CFStringRef kAXSFullKeyboardAccessEnabledNotification;
</span><span class="cx"> extern Boolean _AXSFullKeyboardAccessEnabled();
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcesscocoaWebProcessCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm (248822 => 248823)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm  2019-08-17 18:49:37 UTC (rev 248822)
+++ trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm     2019-08-17 19:13:59 UTC (rev 248823)
</span><span class="lines">@@ -88,6 +88,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS_FAMILY)
</span><ins>+#import "AccessibilitySupportSPI.h"
</ins><span class="cx"> #import "WKAccessibilityWebPageObjectIOS.h"
</span><span class="cx"> #import <UIKit/UIAccessibility.h>
</span><span class="cx"> #import <pal/spi/ios/GraphicsServicesSPI.h>
</span><span class="lines">@@ -315,20 +316,34 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS_FAMILY)
+static NSString *webProcessLoaderAccessibilityBundlePath()
+{
+    NSString *accessibilityBundlesPath = nil;
+#if HAVE(ACCESSIBILITY_BUNDLES_PATH)
+    accessibilityBundlesPath = (__bridge NSString *)_AXSAccessibilityBundlesPath();
+#else
+    accessibilityBundlesPath = (__bridge NSString *)GSSystemRootDirectory();
+#if PLATFORM(MACCATALYST)
+    accessibilityBundlesPath = [accessibilityBundlesPath stringByAppendingPathComponent:@"System/iOSSupport"];
+#endif
+    accessibilityBundlesPath = [accessibilityBundlesPath stringByAppendingPathComponent:@"System/Library/AccessibilityBundles"];
+#endif // HAVE(ACCESSIBILITY_BUNDLES_PATH)
+    return [accessibilityBundlesPath stringByAppendingPathComponent:@"WebProcessLoader.axbundle"];
+}
+#endif
+
</ins><span class="cx"> static void registerWithAccessibility()
</span><span class="cx"> {
</span><span class="cx"> #if USE(APPKIT)
</span><span class="cx">     [NSAccessibilityRemoteUIElement setRemoteUIApp:YES];
</span><span class="cx"> #endif
</span><ins>+
</ins><span class="cx"> #if PLATFORM(IOS_FAMILY)
</span><del>-    NSString *accessibilityBundlePath = (NSString *)GSSystemRootDirectory();
-#if PLATFORM(MACCATALYST)
-    accessibilityBundlePath = [accessibilityBundlePath stringByAppendingString:@"System/iOSSupport"];
-#endif
-    accessibilityBundlePath = [accessibilityBundlePath stringByAppendingString:@"System/Library/AccessibilityBundles/WebProcessLoader.axbundle"];
</del><ins>+    NSString *bundlePath = webProcessLoaderAccessibilityBundlePath();
</ins><span class="cx">     NSError *error = nil;
</span><del>-    if (![[NSBundle bundleWithPath:accessibilityBundlePath] loadAndReturnError:&error])
-        LOG_ERROR("Failed to load accessibility bundle at %@: %@", accessibilityBundlePath, error);
</del><ins>+    if (![[NSBundle bundleWithPath:bundlePath] loadAndReturnError:&error])
+        LOG_ERROR("Failed to load accessibility bundle at %@: %@", bundlePath, error);
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (248822 => 248823)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog    2019-08-17 18:49:37 UTC (rev 248822)
+++ trunk/Tools/ChangeLog       2019-08-17 19:13:59 UTC (rev 248823)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2019-08-17  Eric Liang  <ericliang@apple.com>
+
+        Tested that accessibility WebProcessLoader bundle is loaded for the correct path.
+        https://bugs.webkit.org/show_bug.cgi?id=200367
+
+        Reviewed by Darin Adler.
+
+        Added AccessibilityTestPlugin on the web process to report whether a bundle is loaded and its path, so that it can be tested on WKContentView. 
+
+        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+        * TestWebKitAPI/Tests/WebKitCocoa/AccessibilityTestPlugin.mm: Added.
+        (-[AccessibilityTestPlugin webProcessPlugIn:didCreateBrowserContextController:]):
+        (-[AccessibilityTestPlugin checkAccessibilityWebProcessLoaderBundleIsLoaded:]):
+        * TestWebKitAPI/Tests/WebKitCocoa/AccessibilityTestSupportProtocol.h: Added.
+        * TestWebKitAPI/Tests/ios/AccessibilityTestsIOS.mm:
+        (TestWebKitAPI::TEST):
+
</ins><span class="cx"> 2019-08-17  Sam Weinig  <weinig@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Rename StringBuilder::flexibleAppend(...) to StringBuilder::append(...)
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestWebKitAPIxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (248822 => 248823)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj        2019-08-17 18:49:37 UTC (rev 248822)
+++ trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj   2019-08-17 19:13:59 UTC (rev 248823)
</span><span class="lines">@@ -53,6 +53,7 @@
</span><span class="cx">          074994421EA5034B000DA44F /* ondevicechange.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 4A410F4D19AF7BEF002EBAB6 /* ondevicechange.html */; };
</span><span class="cx">          074994421EA5034B000DA45E /* getUserMediaAudioVideoCapture.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 4A410F4D19AF7BEF002EBAC5 /* getUserMediaAudioVideoCapture.html */; };
</span><span class="cx">          076E507F1F4513D6006E9F5A /* Logging.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 076E507E1F45031E006E9F5A /* Logging.cpp */; };
</span><ins>+               077A5AF3230638A600A7105C /* AccessibilityTestPlugin.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0746645822FF630500E3451A /* AccessibilityTestPlugin.mm */; };
</ins><span class="cx">           0799C3491EBA2D7B003B7532 /* UserMediaDisabled.mm in Sources */ = {isa = PBXBuildFile; fileRef = 07EDEFAC1EB9400C00D43292 /* UserMediaDisabled.mm */; };
</span><span class="cx">          0799C34B1EBA3301003B7532 /* disableGetUserMedia.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 0799C34A1EBA32F4003B7532 /* disableGetUserMedia.html */; };
</span><span class="cx">          07C046CA1E4262A8007201E7 /* CARingBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07C046C91E42573E007201E7 /* CARingBuffer.cpp */; };
</span><span class="lines">@@ -1434,6 +1435,8 @@
</span><span class="cx">          00CD9F6215BE312C002DA2CE /* BackForwardList.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = BackForwardList.mm; sourceTree = "<group>"; };
</span><span class="cx">          041A1E33216FFDBC00789E0A /* PublicSuffix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PublicSuffix.cpp; sourceTree = "<group>"; };
</span><span class="cx">          0711DF51226A95FB003DD2F7 /* AVFoundationSoftLinkTest.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AVFoundationSoftLinkTest.mm; sourceTree = "<group>"; };
</span><ins>+               0746645722FF62D000E3451A /* AccessibilityTestSupportProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AccessibilityTestSupportProtocol.h; sourceTree = "<group>"; };
+               0746645822FF630500E3451A /* AccessibilityTestPlugin.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = AccessibilityTestPlugin.mm; sourceTree = "<group>"; };
</ins><span class="cx">           07492B391DF8ADA400633DE1 /* enumerateMediaDevices.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = enumerateMediaDevices.html; sourceTree = "<group>"; };
</span><span class="cx">          07492B3A1DF8AE2D00633DE1 /* EnumerateMediaDevices.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EnumerateMediaDevices.cpp; sourceTree = "<group>"; };
</span><span class="cx">          0766DD1F1A5AD5200023E3BB /* PendingAPIRequestURL.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PendingAPIRequestURL.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -2686,6 +2689,8 @@
</span><span class="cx">                          A16F66B81C40E9E100BD4D24 /* Resources */,
</span><span class="cx">                          5CEAB5DF1FA937CB00A77FAA /* _WKInputDelegate.mm */,
</span><span class="cx">                          7CEFA9641AC0B9E200B910FD /* _WKUserContentExtensionStore.mm */,
</span><ins>+                               0746645822FF630500E3451A /* AccessibilityTestPlugin.mm */,
+                               0746645722FF62D000E3451A /* AccessibilityTestSupportProtocol.h */,
</ins><span class="cx">                           37E7DD631EA06FF2009B396D /* AdditionalReadAccessAllowedURLs.mm */,
</span><span class="cx">                          37E7DD661EA071F3009B396D /* AdditionalReadAccessAllowedURLsPlugin.mm */,
</span><span class="cx">                          37E7DD651EA0715B009B396D /* AdditionalReadAccessAllowedURLsProtocol.h */,
</span><span class="lines">@@ -4841,6 +4846,7 @@
</span><span class="cx">                  isa = PBXSourcesBuildPhase;
</span><span class="cx">                  buildActionMask = 2147483647;
</span><span class="cx">                  files = (
</span><ins>+                               077A5AF3230638A600A7105C /* AccessibilityTestPlugin.mm in Sources */,
</ins><span class="cx">                           37E7DD671EA071F3009B396D /* AdditionalReadAccessAllowedURLsPlugin.mm in Sources */,
</span><span class="cx">                          754CEC811F6722F200D0039A /* AutoFillAvailable.mm in Sources */,
</span><span class="cx">                          5C4259462266A68A0039AA7A /* BasicProposedCredentialPlugIn.mm in Sources */,
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKitCocoaAccessibilityTestPluginmm"></a>
<div class="addfile"><h4>Added: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/AccessibilityTestPlugin.mm (0 => 248823)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/AccessibilityTestPlugin.mm                           (rev 0)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/AccessibilityTestPlugin.mm      2019-08-17 19:13:59 UTC (rev 248823)
</span><span class="lines">@@ -0,0 +1,79 @@
</span><ins>+/*
+ * Copyright (C) 2019 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+#import "AccessibilityTestSupportProtocol.h"
+#import <WebKit/WKBundlePage.h>
+#import <WebKit/WKBundlePageResourceLoadClient.h>
+#import <WebKit/WKWebProcessPlugIn.h>
+#import <WebKit/WKWebProcessPlugInBrowserContextControllerPrivate.h>
+#import <WebKit/WKWebProcessPlugInLoadDelegate.h>
+#import <WebKit/_WKRemoteObjectInterface.h>
+#import <WebKit/_WKRemoteObjectRegistry.h>
+#import <wtf/RetainPtr.h>
+
+@interface AccessibilityTestPlugin : NSObject<WKWebProcessPlugIn, WKWebProcessPlugInLoadDelegate, AccessibilityTestSupportProtocol>
+@end
+
+@implementation AccessibilityTestPlugin {
+    RetainPtr<WKWebProcessPlugInBrowserContextController> _browserContextController;
+    RetainPtr<WKWebProcessPlugInController> _plugInController;
+    RetainPtr<_WKRemoteObjectInterface> _interface;
+}
+
+- (void)webProcessPlugIn:(WKWebProcessPlugInController *)plugInController didCreateBrowserContextController:(WKWebProcessPlugInBrowserContextController *)browserContextController
+{
+    ASSERT(!_browserContextController);
+    ASSERT(!_plugInController);
+    _browserContextController = browserContextController;
+    _plugInController = plugInController;
+
+    _interface = [_WKRemoteObjectInterface remoteObjectInterfaceWithProtocol:@protocol(AccessibilityTestSupportProtocol)];
+    [[browserContextController _remoteObjectRegistry] registerExportedObject:self interface:_interface.get()];
+}
+
+- (void)checkAccessibilityWebProcessLoaderBundleIsLoaded:(void (^)(BOOL bundleLoaded, NSString *loadedPath))completionHandler
+{
+    BOOL accessibilityBundleLoaded = NO;
+    NSString *loadedPath = nil;
+    NSArray<NSBundle *> *allBundles = NSBundle.allBundles;
+    for (NSBundle *bundle in allBundles) {
+        if ([bundle.bundleIdentifier isEqualToString:@"com.apple.WebProcessLoader.axbundle"]) {
+            accessibilityBundleLoaded = [bundle isLoaded];
+            loadedPath = [bundle bundlePath];
+            break;
+        }
+    }
+    completionHandler(accessibilityBundleLoaded, loadedPath);
+}
+
+- (void)dealloc
+{
+    [[_browserContextController _remoteObjectRegistry] unregisterExportedObject:self interface:_interface.get()];
+    [super dealloc];
+}
+
+@end
+
</ins></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKitCocoaAccessibilityTestSupportProtocolh"></a>
<div class="addfile"><h4>Added: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/AccessibilityTestSupportProtocol.h (0 => 248823)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/AccessibilityTestSupportProtocol.h                           (rev 0)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/AccessibilityTestSupportProtocol.h      2019-08-17 19:13:59 UTC (rev 248823)
</span><span class="lines">@@ -0,0 +1,30 @@
</span><ins>+/*
+ * Copyright (C) 2019 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import <WebKit/WKFoundation.h>
+
+@protocol AccessibilityTestSupportProtocol <NSObject>
+- (void)checkAccessibilityWebProcessLoaderBundleIsLoaded:(void (^)(BOOL bundleLoaded, NSString *loadedPath))completionHandler;
+@end
</ins></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsiosAccessibilityTestsIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/ios/AccessibilityTestsIOS.mm (248822 => 248823)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/ios/AccessibilityTestsIOS.mm     2019-08-17 18:49:37 UTC (rev 248822)
+++ trunk/Tools/TestWebKitAPI/Tests/ios/AccessibilityTestsIOS.mm        2019-08-17 19:13:59 UTC (rev 248823)
</span><span class="lines">@@ -27,9 +27,13 @@
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS_FAMILY)
</span><span class="cx"> 
</span><ins>+#import "AccessibilityTestSupportProtocol.h"
</ins><span class="cx"> #import "PlatformUtilities.h"
</span><span class="cx"> #import "TestWKWebView.h"
</span><ins>+#import "WKWebViewConfigurationExtras.h"
</ins><span class="cx"> #import <WebKit/WKWebViewPrivate.h>
</span><ins>+#import <WebKit/_WKRemoteObjectInterface.h>
+#import <WebKit/_WKRemoteObjectRegistry.h>
</ins><span class="cx"> 
</span><span class="cx"> @implementation WKWebView (WKAccessibilityTesting)
</span><span class="cx"> - (NSArray<NSValue *> *)rectsAtSelectionOffset:(NSInteger)offset withText:(NSString *)text
</span><span class="lines">@@ -114,6 +118,33 @@
</span><span class="cx">     checkCGRectValueAtIndex([webView rectsAtSelectionOffset:0 withText:@"first"], CGRectMake(8, 27, 26, 20), 0);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+TEST(AccessibilityTests, WebProcessLoaderBundleLoaded)
+{
+    WKWebViewConfiguration *configuration = [WKWebViewConfiguration _test_configurationWithTestPlugInClassName:@"AccessibilityTestPlugin"];
+    auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500) configuration:configuration]);
+    _WKRemoteObjectInterface *interface = [_WKRemoteObjectInterface remoteObjectInterfaceWithProtocol:@protocol(AccessibilityTestSupportProtocol)];
+    id <AccessibilityTestSupportProtocol> remoteObjectProxy = [[webView _remoteObjectRegistry] remoteObjectProxyWithInterface:interface];
+
+    [webView synchronouslyLoadHTMLString:@"<meta name='viewport' content='width=device-width,initial-scale=1'><span id='first'>first</span><br><span id='second'>first</span>"];
+
+    __block bool isDone = false;
+    [remoteObjectProxy checkAccessibilityWebProcessLoaderBundleIsLoaded:^(BOOL bundleLoaded, NSString *loadedPath) {
+#if PLATFORM(IOS_FAMILY)
+        EXPECT_TRUE(bundleLoaded);
+#if PLATFORM(MACCATALYST)
+        EXPECT_TRUE([loadedPath hasSuffix:@"/System/iOSSupport/System/Library/AccessibilityBundles/WebProcessLoader.axbundle"]);
+#else
+        EXPECT_TRUE([loadedPath hasSuffix:@"/System/Library/AccessibilityBundles/WebProcessLoader.axbundle"]);
+        EXPECT_FALSE([loadedPath hasSuffix:@"/System/iOSSupport/System/Library/AccessibilityBundles/WebProcessLoader.axbundle"]);
+#endif
+#elif PLATFORM(MAC)
+        EXPECT_FALSE(bundleLoaded);
+#endif // PLATFORM(IOS_FAMILY)
+        isDone = true;
+    }];
+    TestWebKitAPI::Util::run(&isDone);
+}
+
</ins><span class="cx"> } // namespace TestWebKitAPI
</span><span class="cx"> 
</span><span class="cx"> #endif // PLATFORM(IOS_FAMILY)
</span></span></pre>
</div>
</div>

</body>
</html>