<!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>[188844] trunk/Tools</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/188844">188844</a></dd>
<dt>Author</dt> <dd>aestes@apple.com</dd>
<dt>Date</dt> <dd>2015-08-23 15:31:32 -0700 (Sun, 23 Aug 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>[Cocoa] API tests using the Modern WebKit API should be able to create web process plug-ins
https://bugs.webkit.org/show_bug.cgi?id=148317

Reviewed by Dan Bernstein.

Added the ability for Modern WebKit API tests to create WKWebProcessPlugIns. A test can create a plug-in by
creating a class that conforms to WKWebProcessPlugIn, adding it to the WebProcessPlugIn target, and using the
WKWebViewConfiguration returned by +[WKWebViewConfiguration testwebkitapi_configurationWithTestPlugInClassName:]
when creating WKWebViews.

Since TestWebKitAPI relies on a bundle parameter to know which test class to instantiate in the plug-in, I also
added a new API test for bundle parameters.

* TestWebKitAPI/Configurations/WebProcessPlugIn.xcconfig: Added. Named the bundle TestWebKitAPI.wkbundle and
named its executable TestWebKitAPI.bundle.
* TestWebKitAPI/PlatformUtilities.h: Declared TestPlugInClassNameParameter.
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: Added the WebProcessPlugIn target.
* TestWebKitAPI/Tests/WebKit2Cocoa/BundleParameters.mm: Added.
(TEST): Tested bundle parameters by verifying that parameter changes in the UI process are observed in the bundle.
* TestWebKitAPI/Tests/WebKit2Cocoa/BundleParametersPlugIn.mm: Added.
(-[BundleParametersPlugIn webProcessPlugIn:didCreateBrowserContextController:]): Started observing changes to a
bundle parameter and asked for an initial notification.
(-[BundleParametersPlugIn dealloc]): Stopped observing changes to a bundle parameter.
(-[BundleParametersPlugIn observeValueForKeyPath:ofObject:change:context:]): When a bundle parameter changes,
mirror its value in the main frame's JSContext.
* TestWebKitAPI/WKWebViewConfigurationExtras.h: Added.
* TestWebKitAPI/WKWebViewConfigurationExtras.mm: Added.
(+[WKWebViewConfiguration testwebkitapi_configurationWithTestPlugInClassName:]): Created a configuration with
TestWebKitAPI's bundle URL and set a bundle parameter indicating the test plug-in's class name.
* TestWebKitAPI/cocoa/PlatformUtilitiesCocoa.mm: Defined TestPlugInClassNameParameter.
* TestWebKitAPI/cocoa/WebProcessPlugIn/Info.plist: Added. Set the principal class to WebProcessPlugIn.
* TestWebKitAPI/cocoa/WebProcessPlugIn/WebProcessPlugIn.mm: Added.
(-[WebProcessPlugIn webProcessPlugIn:initializeWithObject:]): Forwarded to a newly-created test class instance.
(-[WebProcessPlugIn respondsToSelector:]): Returned YES if the test class instance response.
(-[WebProcessPlugIn forwardingTargetForSelector:]): Forwarded unimplemented methods to the test class instance.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsTestWebKitAPIPlatformUtilitiesh">trunk/Tools/TestWebKitAPI/PlatformUtilities.h</a></li>
<li><a href="#trunkToolsTestWebKitAPITestWebKitAPIxcodeprojprojectpbxproj">trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkToolsTestWebKitAPIcocoaPlatformUtilitiesCocoamm">trunk/Tools/TestWebKitAPI/cocoa/PlatformUtilitiesCocoa.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkToolsTestWebKitAPIConfigurationsWebProcessPlugInxcconfig">trunk/Tools/TestWebKitAPI/Configurations/WebProcessPlugIn.xcconfig</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2CocoaBundleParametersmm">trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/BundleParameters.mm</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2CocoaBundleParametersPlugInmm">trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/BundleParametersPlugIn.mm</a></li>
<li><a href="#trunkToolsTestWebKitAPIWKWebViewConfigurationExtrash">trunk/Tools/TestWebKitAPI/WKWebViewConfigurationExtras.h</a></li>
<li><a href="#trunkToolsTestWebKitAPIWKWebViewConfigurationExtrasmm">trunk/Tools/TestWebKitAPI/WKWebViewConfigurationExtras.mm</a></li>
<li>trunk/Tools/TestWebKitAPI/cocoa/WebProcessPlugIn/</li>
<li><a href="#trunkToolsTestWebKitAPIcocoaWebProcessPlugInInfoplist">trunk/Tools/TestWebKitAPI/cocoa/WebProcessPlugIn/Info.plist</a></li>
<li><a href="#trunkToolsTestWebKitAPIcocoaWebProcessPlugInWebProcessPlugInmm">trunk/Tools/TestWebKitAPI/cocoa/WebProcessPlugIn/WebProcessPlugIn.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (188843 => 188844)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2015-08-23 21:42:50 UTC (rev 188843)
+++ trunk/Tools/ChangeLog        2015-08-23 22:31:32 UTC (rev 188844)
</span><span class="lines">@@ -1,3 +1,41 @@
</span><ins>+2015-08-22  Andy Estes  &lt;aestes@apple.com&gt;
+
+        [Cocoa] API tests using the Modern WebKit API should be able to create web process plug-ins
+        https://bugs.webkit.org/show_bug.cgi?id=148317
+
+        Reviewed by Dan Bernstein.
+
+        Added the ability for Modern WebKit API tests to create WKWebProcessPlugIns. A test can create a plug-in by
+        creating a class that conforms to WKWebProcessPlugIn, adding it to the WebProcessPlugIn target, and using the
+        WKWebViewConfiguration returned by +[WKWebViewConfiguration testwebkitapi_configurationWithTestPlugInClassName:]
+        when creating WKWebViews.
+
+        Since TestWebKitAPI relies on a bundle parameter to know which test class to instantiate in the plug-in, I also
+        added a new API test for bundle parameters.
+
+        * TestWebKitAPI/Configurations/WebProcessPlugIn.xcconfig: Added. Named the bundle TestWebKitAPI.wkbundle and
+        named its executable TestWebKitAPI.bundle.
+        * TestWebKitAPI/PlatformUtilities.h: Declared TestPlugInClassNameParameter.
+        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: Added the WebProcessPlugIn target.
+        * TestWebKitAPI/Tests/WebKit2Cocoa/BundleParameters.mm: Added.
+        (TEST): Tested bundle parameters by verifying that parameter changes in the UI process are observed in the bundle.
+        * TestWebKitAPI/Tests/WebKit2Cocoa/BundleParametersPlugIn.mm: Added.
+        (-[BundleParametersPlugIn webProcessPlugIn:didCreateBrowserContextController:]): Started observing changes to a
+        bundle parameter and asked for an initial notification.
+        (-[BundleParametersPlugIn dealloc]): Stopped observing changes to a bundle parameter.
+        (-[BundleParametersPlugIn observeValueForKeyPath:ofObject:change:context:]): When a bundle parameter changes,
+        mirror its value in the main frame's JSContext.
+        * TestWebKitAPI/WKWebViewConfigurationExtras.h: Added.
+        * TestWebKitAPI/WKWebViewConfigurationExtras.mm: Added.
+        (+[WKWebViewConfiguration testwebkitapi_configurationWithTestPlugInClassName:]): Created a configuration with
+        TestWebKitAPI's bundle URL and set a bundle parameter indicating the test plug-in's class name.
+        * TestWebKitAPI/cocoa/PlatformUtilitiesCocoa.mm: Defined TestPlugInClassNameParameter.
+        * TestWebKitAPI/cocoa/WebProcessPlugIn/Info.plist: Added. Set the principal class to WebProcessPlugIn.
+        * TestWebKitAPI/cocoa/WebProcessPlugIn/WebProcessPlugIn.mm: Added.
+        (-[WebProcessPlugIn webProcessPlugIn:initializeWithObject:]): Forwarded to a newly-created test class instance.
+        (-[WebProcessPlugIn respondsToSelector:]): Returned YES if the test class instance response.
+        (-[WebProcessPlugIn forwardingTargetForSelector:]): Forwarded unimplemented methods to the test class instance.
+
</ins><span class="cx"> 2015-08-23  Csaba Osztrogonác  &lt;ossy@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         URTBF after r188828.
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPIConfigurationsWebProcessPlugInxcconfig"></a>
<div class="addfile"><h4>Added: trunk/Tools/TestWebKitAPI/Configurations/WebProcessPlugIn.xcconfig (0 => 188844)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Configurations/WebProcessPlugIn.xcconfig                                (rev 0)
+++ trunk/Tools/TestWebKitAPI/Configurations/WebProcessPlugIn.xcconfig        2015-08-23 22:31:32 UTC (rev 188844)
</span><span class="lines">@@ -0,0 +1,30 @@
</span><ins>+//
+// Copyright (C) 2015 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.
+//
+
+INFOPLIST_FILE = cocoa/WebProcessPlugIn/Info.plist;
+PRODUCT_NAME = TestWebKitAPI;
+EXECUTABLE_SUFFIX = .bundle;
+WRAPPER_EXTENSION = wkbundle;
+OTHER_LDFLAGS = $(inherited) -framework JavaScriptCore -framework WebKit;
</ins></span></pre></div>
<a id="trunkToolsTestWebKitAPIPlatformUtilitiesh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/PlatformUtilities.h (188843 => 188844)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/PlatformUtilities.h        2015-08-23 21:42:50 UTC (rev 188843)
+++ trunk/Tools/TestWebKitAPI/PlatformUtilities.h        2015-08-23 22:31:32 UTC (rev 188844)
</span><span class="lines">@@ -75,6 +75,10 @@
</span><span class="cx"> #define EXPECT_WK_STREQ(expected, actual) \
</span><span class="cx">     EXPECT_PRED_FORMAT2(TestWebKitAPI::Util::assertWKStringEqual, expected, actual)
</span><span class="cx"> 
</span><ins>+#if WK_API_ENABLED
+extern NSString * const TestPlugInClassNameParameter;
+#endif
+
</ins><span class="cx"> } // namespace Util
</span><span class="cx"> } // namespace TestWebKitAPI
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestWebKitAPIxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (188843 => 188844)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj        2015-08-23 21:42:50 UTC (rev 188843)
+++ trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj        2015-08-23 22:31:32 UTC (rev 188844)
</span><span class="lines">@@ -264,6 +264,11 @@
</span><span class="cx">                 93F7E86F14DC8E5C00C84A99 /* NewFirstVisuallyNonEmptyLayoutFrames_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93F7E86E14DC8E5B00C84A99 /* NewFirstVisuallyNonEmptyLayoutFrames_Bundle.cpp */; };
</span><span class="cx">                 9B26FCCA159D16DE00CC3765 /* HTMLFormCollectionNamedItem.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 9B26FCB4159D15E700CC3765 /* HTMLFormCollectionNamedItem.html */; };
</span><span class="cx">                 9B4F8FA7159D52DD002D9F94 /* HTMLCollectionNamedItem.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 9B4F8FA6159D52CA002D9F94 /* HTMLCollectionNamedItem.html */; };
</span><ins>+                A13EBBAA1B87428D00097110 /* WebProcessPlugIn.mm in Sources */ = {isa = PBXBuildFile; fileRef = A13EBBA91B87428D00097110 /* WebProcessPlugIn.mm */; };
+                A13EBBAB1B87434600097110 /* PlatformUtilitiesCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0F139E721A423A2B00F590F5 /* PlatformUtilitiesCocoa.mm */; };
+                A13EBBB01B87436F00097110 /* BundleParametersPlugIn.mm in Sources */ = {isa = PBXBuildFile; fileRef = A13EBBAE1B87436F00097110 /* BundleParametersPlugIn.mm */; };
+                A13EBBB11B87438000097110 /* BundleParameters.mm in Sources */ = {isa = PBXBuildFile; fileRef = A13EBBAC1B87436F00097110 /* BundleParameters.mm */; };
+                A14FC5851B89739100D107EB /* WKWebViewConfigurationExtras.mm in Sources */ = {isa = PBXBuildFile; fileRef = A14FC5831B89739100D107EB /* WKWebViewConfigurationExtras.mm */; };
</ins><span class="cx">                 A57A34F216AF6B2B00C2501F /* PageVisibilityStateWithWindowChanges.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = A57A34F116AF69E200C2501F /* PageVisibilityStateWithWindowChanges.html */; };
</span><span class="cx">                 A5E2027515B21F6E00C13E14 /* WindowlessWebViewWithMedia.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = A5E2027015B2180600C13E14 /* WindowlessWebViewWithMedia.html */; };
</span><span class="cx">                 B55AD1D5179F3B3000AC1494 /* PreventImageLoadWithAutoResizing_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B55AD1D3179F3ABF00AC1494 /* PreventImageLoadWithAutoResizing_Bundle.cpp */; };
</span><span class="lines">@@ -324,6 +329,13 @@
</span><span class="cx">                         remoteGlobalIDString = 7CCE7E8B1A41144E00447C4C;
</span><span class="cx">                         remoteInfo = TestWebKitAPILibrary;
</span><span class="cx">                 };
</span><ins>+                A13EBBB21B87441900097110 /* PBXContainerItemProxy */ = {
+                        isa = PBXContainerItemProxy;
+                        containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+                        proxyType = 1;
+                        remoteGlobalIDString = A13EBB481B87339E00097110;
+                        remoteInfo = WebProcessPlugIn;
+                };
</ins><span class="cx">                 BC575A95126E74E7006F0F12 /* PBXContainerItemProxy */ = {
</span><span class="cx">                         isa = PBXContainerItemProxy;
</span><span class="cx">                         containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
</span><span class="lines">@@ -619,6 +631,14 @@
</span><span class="cx">                 9B26FCB4159D15E700CC3765 /* HTMLFormCollectionNamedItem.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = HTMLFormCollectionNamedItem.html; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 9B4F8FA3159D52B1002D9F94 /* HTMLCollectionNamedItem.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HTMLCollectionNamedItem.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 9B4F8FA6159D52CA002D9F94 /* HTMLCollectionNamedItem.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = HTMLCollectionNamedItem.html; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                A13EBB491B87339E00097110 /* TestWebKitAPI.wkbundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TestWebKitAPI.wkbundle; sourceTree = BUILT_PRODUCTS_DIR; };
+                A13EBB521B87346600097110 /* WebProcessPlugIn.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = WebProcessPlugIn.xcconfig; sourceTree = &quot;&lt;group&gt;&quot;; };
+                A13EBB541B8734E000097110 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = &quot;&lt;group&gt;&quot;; };
+                A13EBBA91B87428D00097110 /* WebProcessPlugIn.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebProcessPlugIn.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
+                A13EBBAC1B87436F00097110 /* BundleParameters.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = BundleParameters.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
+                A13EBBAE1B87436F00097110 /* BundleParametersPlugIn.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = BundleParametersPlugIn.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
+                A14FC5831B89739100D107EB /* WKWebViewConfigurationExtras.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKWebViewConfigurationExtras.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
+                A14FC5841B89739100D107EB /* WKWebViewConfigurationExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKWebViewConfigurationExtras.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 A1A4FE5D18DD3DB700B5EA8A /* Download.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Download.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A1FDFD2E19C288BB005148A4 /* WKImageCreateCGImageCrash.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKImageCreateCGImageCrash.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A57A34EF16AF677200C2501F /* PageVisibilityStateWithWindowChanges.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PageVisibilityStateWithWindowChanges.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -836,7 +856,10 @@
</span><span class="cx">                 0F139E711A423A1D00F590F5 /* cocoa */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                A13EBB441B87332B00097110 /* WebProcessPlugIn */,
</ins><span class="cx">                                 0F139E721A423A2B00F590F5 /* PlatformUtilitiesCocoa.mm */,
</span><ins>+                                A14FC5841B89739100D107EB /* WKWebViewConfigurationExtras.h */,
+                                A14FC5831B89739100D107EB /* WKWebViewConfigurationExtras.mm */,
</ins><span class="cx">                         );
</span><span class="cx">                         name = cocoa;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="lines">@@ -855,6 +878,7 @@
</span><span class="cx">                                 8DD76FA10486AA7600D96B5E /* TestWebKitAPI */,
</span><span class="cx">                                 BC575980126E74AF006F0F12 /* InjectedBundleTestWebKitAPI.bundle */,
</span><span class="cx">                                 7CCE7E8C1A41144E00447C4C /* libTestWebKitAPI.a */,
</span><ins>+                                A13EBB491B87339E00097110 /* TestWebKitAPI.wkbundle */,
</ins><span class="cx">                         );
</span><span class="cx">                         name = Products;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="lines">@@ -863,6 +887,8 @@
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><span class="cx">                                 7CEFA9641AC0B9E200B910FD /* _WKUserContentExtensionStore.mm */,
</span><ins>+                                A13EBBAC1B87436F00097110 /* BundleParameters.mm */,
+                                A13EBBAE1B87436F00097110 /* BundleParametersPlugIn.mm */,
</ins><span class="cx">                                 A1A4FE5D18DD3DB700B5EA8A /* Download.mm */,
</span><span class="cx">                                 2D1FE0AF1AD465C1006CD9E6 /* FixedLayoutSize.mm */,
</span><span class="cx">                                 37D36ED61AF42ECD00BAF5D9 /* LoadAlternateHTMLString.mm */,
</span><span class="lines">@@ -931,6 +957,16 @@
</span><span class="cx">                         path = darwin;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="cx">                 };
</span><ins>+                A13EBB441B87332B00097110 /* WebProcessPlugIn */ = {
+                        isa = PBXGroup;
+                        children = (
+                                A13EBB541B8734E000097110 /* Info.plist */,
+                                A13EBBA91B87428D00097110 /* WebProcessPlugIn.mm */,
+                        );
+                        name = WebProcessPlugIn;
+                        path = cocoa/WebProcessPlugIn;
+                        sourceTree = &quot;&lt;group&gt;&quot;;
+                };
</ins><span class="cx">                 BC029B1A1486B23800817DA9 /* ns */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><span class="lines">@@ -975,6 +1011,7 @@
</span><span class="cx">                                 BC575AE2126E88B1006F0F12 /* InjectedBundle.xcconfig */,
</span><span class="cx">                                 BC90958012554CF900083756 /* TestWebKitAPI.xcconfig */,
</span><span class="cx">                                 7CCE7EA31A4115CB00447C4C /* TestWebKitAPILibrary.xcconfig */,
</span><ins>+                                A13EBB521B87346600097110 /* WebProcessPlugIn.xcconfig */,
</ins><span class="cx">                         );
</span><span class="cx">                         path = Configurations;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="lines">@@ -1378,6 +1415,7 @@
</span><span class="cx">                         buildRules = (
</span><span class="cx">                         );
</span><span class="cx">                         dependencies = (
</span><ins>+                                A13EBBB31B87441900097110 /* PBXTargetDependency */,
</ins><span class="cx">                                 BC575A96126E74E7006F0F12 /* PBXTargetDependency */,
</span><span class="cx">                                 7CCE7F511A4124DB00447C4C /* PBXTargetDependency */,
</span><span class="cx">                         );
</span><span class="lines">@@ -1387,6 +1425,21 @@
</span><span class="cx">                         productReference = 8DD76FA10486AA7600D96B5E /* TestWebKitAPI */;
</span><span class="cx">                         productType = &quot;com.apple.product-type.tool&quot;;
</span><span class="cx">                 };
</span><ins>+                A13EBB481B87339E00097110 /* WebProcessPlugIn */ = {
+                        isa = PBXNativeTarget;
+                        buildConfigurationList = A13EBB4C1B87339E00097110 /* Build configuration list for PBXNativeTarget &quot;WebProcessPlugIn&quot; */;
+                        buildPhases = (
+                                A13EBB451B87339E00097110 /* Sources */,
+                        );
+                        buildRules = (
+                        );
+                        dependencies = (
+                        );
+                        name = WebProcessPlugIn;
+                        productName = WebProcessPlugIn;
+                        productReference = A13EBB491B87339E00097110 /* TestWebKitAPI.wkbundle */;
+                        productType = &quot;com.apple.product-type.bundle&quot;;
+                };
</ins><span class="cx">                 BC57597F126E74AF006F0F12 /* InjectedBundleTestWebKitAPI */ = {
</span><span class="cx">                         isa = PBXNativeTarget;
</span><span class="cx">                         buildConfigurationList = BC575986126E74AF006F0F12 /* Build configuration list for PBXNativeTarget &quot;InjectedBundleTestWebKitAPI&quot; */;
</span><span class="lines">@@ -1416,6 +1469,9 @@
</span><span class="cx">                                         7CCE7E8B1A41144E00447C4C = {
</span><span class="cx">                                                 CreatedOnToolsVersion = 6.3;
</span><span class="cx">                                         };
</span><ins>+                                        A13EBB481B87339E00097110 = {
+                                                CreatedOnToolsVersion = 7.0;
+                                        };
</ins><span class="cx">                                 };
</span><span class="cx">                         };
</span><span class="cx">                         buildConfigurationList = 1DEB927808733DD40010E9CD /* Build configuration list for PBXProject &quot;TestWebKitAPI&quot; */;
</span><span class="lines">@@ -1435,6 +1491,7 @@
</span><span class="cx">                                 8DD76F960486AA7600D96B5E /* TestWebKitAPI */,
</span><span class="cx">                                 BC57597F126E74AF006F0F12 /* InjectedBundleTestWebKitAPI */,
</span><span class="cx">                                 7CCE7E8B1A41144E00447C4C /* TestWebKitAPILibrary */,
</span><ins>+                                A13EBB481B87339E00097110 /* WebProcessPlugIn */,
</ins><span class="cx">                         );
</span><span class="cx">                 };
</span><span class="cx"> /* End PBXProject section */
</span><span class="lines">@@ -1530,6 +1587,7 @@
</span><span class="cx">                                 7CCE7EC41A411A7E00447C4C /* JSWrapperForNodeInWebFrame.mm in Sources */,
</span><span class="cx">                                 7CCE7F061A411AE600447C4C /* LayoutMilestonesWithAllContentInFrame.cpp in Sources */,
</span><span class="cx">                                 7CCE7EDF1A411A9200447C4C /* LayoutUnit.cpp in Sources */,
</span><ins>+                                A13EBBB11B87438000097110 /* BundleParameters.mm in Sources */,
</ins><span class="cx">                                 7CCE7F381A411B8E00447C4C /* ListHashSet.cpp in Sources */,
</span><span class="cx">                                 37D36ED71AF42ECD00BAF5D9 /* LoadAlternateHTMLString.mm in Sources */,
</span><span class="cx">                                 7CCE7EFE1A411AE600447C4C /* LoadAlternateHTMLStringWithNonDirectoryURL.cpp in Sources */,
</span><span class="lines">@@ -1598,6 +1656,7 @@
</span><span class="cx">                                 7CCE7ECE1A411A7E00447C4C /* StopLoadingFromDidFinishLoading.mm in Sources */,
</span><span class="cx">                                 7CCE7ECF1A411A7E00447C4C /* StopLoadingFromDidReceiveResponse.mm in Sources */,
</span><span class="cx">                                 7CCE7F441A411B8E00447C4C /* StringBuilder.cpp in Sources */,
</span><ins>+                                A14FC5851B89739100D107EB /* WKWebViewConfigurationExtras.mm in Sources */,
</ins><span class="cx">                                 7CB184C61AA3F2100066EDFD /* ContentExtensions.cpp in Sources */,
</span><span class="cx">                                 7CCE7ED01A411A7E00447C4C /* StringByEvaluatingJavaScriptFromString.mm in Sources */,
</span><span class="cx">                                 7CCE7F451A411B8E00447C4C /* StringHasher.cpp in Sources */,
</span><span class="lines">@@ -1670,6 +1729,16 @@
</span><span class="cx">                         );
</span><span class="cx">                         runOnlyForDeploymentPostprocessing = 0;
</span><span class="cx">                 };
</span><ins>+                A13EBB451B87339E00097110 /* Sources */ = {
+                        isa = PBXSourcesBuildPhase;
+                        buildActionMask = 2147483647;
+                        files = (
+                                A13EBBAA1B87428D00097110 /* WebProcessPlugIn.mm in Sources */,
+                                A13EBBB01B87436F00097110 /* BundleParametersPlugIn.mm in Sources */,
+                                A13EBBAB1B87434600097110 /* PlatformUtilitiesCocoa.mm in Sources */,
+                        );
+                        runOnlyForDeploymentPostprocessing = 0;
+                };
</ins><span class="cx">                 BC57597D126E74AF006F0F12 /* Sources */ = {
</span><span class="cx">                         isa = PBXSourcesBuildPhase;
</span><span class="cx">                         buildActionMask = 2147483647;
</span><span class="lines">@@ -1721,6 +1790,11 @@
</span><span class="cx">                         target = 7CCE7E8B1A41144E00447C4C /* TestWebKitAPILibrary */;
</span><span class="cx">                         targetProxy = 7CCE7F501A4124DB00447C4C /* PBXContainerItemProxy */;
</span><span class="cx">                 };
</span><ins>+                A13EBBB31B87441900097110 /* PBXTargetDependency */ = {
+                        isa = PBXTargetDependency;
+                        target = A13EBB481B87339E00097110 /* WebProcessPlugIn */;
+                        targetProxy = A13EBBB21B87441900097110 /* PBXContainerItemProxy */;
+                };
</ins><span class="cx">                 BC575A96126E74E7006F0F12 /* PBXTargetDependency */ = {
</span><span class="cx">                         isa = PBXTargetDependency;
</span><span class="cx">                         target = BC57597F126E74AF006F0F12 /* InjectedBundleTestWebKitAPI */;
</span><span class="lines">@@ -1773,6 +1847,20 @@
</span><span class="cx">                         };
</span><span class="cx">                         name = Release;
</span><span class="cx">                 };
</span><ins>+                A13EBB4D1B87339E00097110 /* Debug */ = {
+                        isa = XCBuildConfiguration;
+                        baseConfigurationReference = A13EBB521B87346600097110 /* WebProcessPlugIn.xcconfig */;
+                        buildSettings = {
+                        };
+                        name = Debug;
+                };
+                A13EBB4E1B87339E00097110 /* Release */ = {
+                        isa = XCBuildConfiguration;
+                        baseConfigurationReference = A13EBB521B87346600097110 /* WebProcessPlugIn.xcconfig */;
+                        buildSettings = {
+                        };
+                        name = Release;
+                };
</ins><span class="cx">                 BC575984126E74AF006F0F12 /* Debug */ = {
</span><span class="cx">                         isa = XCBuildConfiguration;
</span><span class="cx">                         baseConfigurationReference = BC575AE2126E88B1006F0F12 /* InjectedBundle.xcconfig */;
</span><span class="lines">@@ -1817,6 +1905,15 @@
</span><span class="cx">                         defaultConfigurationIsVisible = 0;
</span><span class="cx">                         defaultConfigurationName = Release;
</span><span class="cx">                 };
</span><ins>+                A13EBB4C1B87339E00097110 /* Build configuration list for PBXNativeTarget &quot;WebProcessPlugIn&quot; */ = {
+                        isa = XCConfigurationList;
+                        buildConfigurations = (
+                                A13EBB4D1B87339E00097110 /* Debug */,
+                                A13EBB4E1B87339E00097110 /* Release */,
+                        );
+                        defaultConfigurationIsVisible = 0;
+                        defaultConfigurationName = Release;
+                };
</ins><span class="cx">                 BC575986126E74AF006F0F12 /* Build configuration list for PBXNativeTarget &quot;InjectedBundleTestWebKitAPI&quot; */ = {
</span><span class="cx">                         isa = XCConfigurationList;
</span><span class="cx">                         buildConfigurations = (
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2CocoaBundleParametersmm"></a>
<div class="addfile"><h4>Added: trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/BundleParameters.mm (0 => 188844)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/BundleParameters.mm                                (rev 0)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/BundleParameters.mm        2015-08-23 22:31:32 UTC (rev 188844)
</span><span class="lines">@@ -0,0 +1,95 @@
</span><ins>+/*
+ * Copyright (C) 2015 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 &quot;config.h&quot;
+
+#if WK_API_ENABLED
+
+#import &quot;PlatformUtilities.h&quot;
+#import &quot;Test.h&quot;
+#import &quot;WKWebViewConfigurationExtras.h&quot;
+#import &lt;WebKit/WKProcessPoolPrivate.h&gt;
+#import &lt;wtf/RetainPtr.h&gt;
+
+static bool isDone;
+
+TEST(WebKit2, BundleParameters)
+{
+    @autoreleasepool {
+        NSString * const testPlugInClassName = @&quot;BundleParametersPlugIn&quot;;
+        auto configuration = retainPtr([WKWebViewConfiguration testwebkitapi_configurationWithTestPlugInClassName:testPlugInClassName]);
+        auto webView = adoptNS([[WKWebView alloc] initWithFrame:CGRectZero configuration:configuration.get()]);
+
+        [webView evaluateJavaScript:TestWebKitAPI::Util::TestPlugInClassNameParameter completionHandler:^(id result, NSError *error) {
+            EXPECT_TRUE([result isKindOfClass:[NSString class]]);
+            EXPECT_WK_STREQ(result, testPlugInClassName);
+            isDone = true;
+        }];
+
+        TestWebKitAPI::Util::run(&amp;isDone);
+        isDone = false;
+
+        NSString * const testParameter = @&quot;TestParameter&quot;;
+        [webView evaluateJavaScript:testParameter completionHandler:^(id result, NSError *error) {
+            EXPECT_NULL(result);
+            isDone = true;
+        }];
+
+        TestWebKitAPI::Util::run(&amp;isDone);
+        isDone = false;
+
+        NSString * const testString = @&quot;PASS&quot;;
+        [[configuration processPool] _setObject:testString forBundleParameter:testParameter];
+        [webView evaluateJavaScript:testParameter completionHandler:^(id result, NSError *error) {
+            EXPECT_TRUE([result isKindOfClass:[NSString class]]);
+            EXPECT_WK_STREQ(result, testString);
+            isDone = true;
+        }];
+
+        TestWebKitAPI::Util::run(&amp;isDone);
+        isDone = false;
+
+        NSDictionary * const testDictionary = @{ @&quot;result&quot; : @&quot;PASS&quot; };
+        [[configuration processPool] _setObject:testDictionary forBundleParameter:testParameter];
+        [webView evaluateJavaScript:testParameter completionHandler:^(id result, NSError *error) {
+            EXPECT_TRUE([result isKindOfClass:[NSDictionary class]]);
+            EXPECT_TRUE([result isEqualToDictionary:testDictionary]);
+            isDone = true;
+        }];
+
+        TestWebKitAPI::Util::run(&amp;isDone);
+        isDone = false;
+
+        [[configuration processPool] _setObject:nil forBundleParameter:testParameter];
+        [webView evaluateJavaScript:testParameter completionHandler:^(id result, NSError *error) {
+            EXPECT_NULL(result);
+            isDone = true;
+        }];
+
+        TestWebKitAPI::Util::run(&amp;isDone);
+    }
+}
+
+#endif // WK_API_ENABLED
</ins></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2CocoaBundleParametersPlugInmm"></a>
<div class="addfile"><h4>Added: trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/BundleParametersPlugIn.mm (0 => 188844)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/BundleParametersPlugIn.mm                                (rev 0)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/BundleParametersPlugIn.mm        2015-08-23 22:31:32 UTC (rev 188844)
</span><span class="lines">@@ -0,0 +1,72 @@
</span><ins>+/*
+ * Copyright (C) 2015 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 &quot;config.h&quot;
+
+#if WK_API_ENABLED
+
+#import &quot;PlatformUtilities.h&quot;
+#import &lt;WebKit/WKWebProcessPlugIn.h&gt;
+#import &lt;WebKit/WKWebProcessPlugInBrowserContextController.h&gt;
+#import &lt;WebKit/WKWebProcessPlugInFrame.h&gt;
+#import &lt;WebKit/WKWebProcessPlugInScriptWorld.h&gt;
+#import &lt;wtf/RetainPtr.h&gt;
+
+static NSString * const testParameter = @&quot;TestParameter&quot;;
+
+@interface BundleParametersPlugIn : NSObject &lt;WKWebProcessPlugIn&gt;
+@end
+
+@implementation BundleParametersPlugIn {
+    RetainPtr&lt;WKWebProcessPlugInBrowserContextController&gt; _browserContextController;
+    RetainPtr&lt;WKWebProcessPlugInController&gt; _plugInController;
+}
+
+- (void)webProcessPlugIn:(WKWebProcessPlugInController *)plugInController didCreateBrowserContextController:(WKWebProcessPlugInBrowserContextController *)browserContextController
+{
+    ASSERT(!_browserContextController);
+    ASSERT(!_plugInController);
+    _browserContextController = browserContextController;
+    _plugInController = plugInController;
+    [plugInController.parameters addObserver:self forKeyPath:testParameter options:NSKeyValueObservingOptionInitial context:NULL];
+    [plugInController.parameters addObserver:self forKeyPath:TestWebKitAPI::Util::TestPlugInClassNameParameter options:NSKeyValueObservingOptionInitial context:NULL];
+}
+
+- (void)dealloc
+{
+    [[_plugInController parameters] removeObserver:self forKeyPath:testParameter];
+    [[_plugInController parameters] removeObserver:self forKeyPath:TestWebKitAPI::Util::TestPlugInClassNameParameter];
+    [super dealloc];
+}
+
+- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
+{
+    JSContext *jsContext = [[_browserContextController mainFrame] jsContextForWorld:[WKWebProcessPlugInScriptWorld normalWorld]];
+    [jsContext setObject:[object valueForKey:keyPath] forKeyedSubscript:keyPath];
+}
+
+@end
+
+#endif // WK_API_ENABLED
</ins></span></pre></div>
<a id="trunkToolsTestWebKitAPIWKWebViewConfigurationExtrashfromrev188843trunkToolsTestWebKitAPIcocoaPlatformUtilitiesCocoamm"></a>
<div class="copfile"><h4>Copied: trunk/Tools/TestWebKitAPI/WKWebViewConfigurationExtras.h (from rev 188843, trunk/Tools/TestWebKitAPI/cocoa/PlatformUtilitiesCocoa.mm) (0 => 188844)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/WKWebViewConfigurationExtras.h                                (rev 0)
+++ trunk/Tools/TestWebKitAPI/WKWebViewConfigurationExtras.h        2015-08-23 22:31:32 UTC (rev 188844)
</span><span class="lines">@@ -0,0 +1,28 @@
</span><ins>+/*
+ * Copyright (C) 2015 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.
+ */
+
+@interface WKWebViewConfiguration (TestWebKitAPIExtras)
++ (instancetype)testwebkitapi_configurationWithTestPlugInClassName:(NSString *)className;
+@end
</ins></span></pre></div>
<a id="trunkToolsTestWebKitAPIWKWebViewConfigurationExtrasmmfromrev188843trunkToolsTestWebKitAPIcocoaPlatformUtilitiesCocoamm"></a>
<div class="copfile"><h4>Copied: trunk/Tools/TestWebKitAPI/WKWebViewConfigurationExtras.mm (from rev 188843, trunk/Tools/TestWebKitAPI/cocoa/PlatformUtilitiesCocoa.mm) (0 => 188844)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/WKWebViewConfigurationExtras.mm                                (rev 0)
+++ trunk/Tools/TestWebKitAPI/WKWebViewConfigurationExtras.mm        2015-08-23 22:31:32 UTC (rev 188844)
</span><span class="lines">@@ -0,0 +1,55 @@
</span><ins>+/*
+ * Copyright (C) 2015 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 &quot;config.h&quot;
+#import &quot;WKWebViewConfigurationExtras.h&quot;
+
+#if WK_API_ENABLED
+
+#import &quot;PlatformUtilities.h&quot;
+#import &lt;WebKit/WKProcessPoolPrivate.h&gt;
+#import &lt;WebKit/WKWebViewConfiguration.h&gt;
+#import &lt;WebKit/_WKProcessPoolConfiguration.h&gt;
+#import &lt;wtf/RetainPtr.h&gt;
+
+@implementation WKWebViewConfiguration (TestWebKitAPIExtras)
+
++ (instancetype)testwebkitapi_configurationWithTestPlugInClassName:(NSString *)className
+{
+    auto processPoolConfiguration = adoptNS([[_WKProcessPoolConfiguration alloc] init]);
+    [processPoolConfiguration setInjectedBundleURL:[[NSBundle mainBundle] URLForResource:@&quot;TestWebKitAPI&quot; withExtension:@&quot;wkbundle&quot;]];
+
+    auto processPool = adoptNS([[WKProcessPool alloc] _initWithConfiguration:processPoolConfiguration.get()]);
+    [processPool _setObject:className forBundleParameter:TestWebKitAPI::Util::TestPlugInClassNameParameter];
+
+    auto webViewConfiguration = adoptNS([[WKWebViewConfiguration alloc] init]);
+    [webViewConfiguration setProcessPool:processPool.get()];
+
+    return webViewConfiguration.autorelease();
+}
+
+@end
+
+#endif // WK_API_ENABLED
</ins></span></pre></div>
<a id="trunkToolsTestWebKitAPIcocoaPlatformUtilitiesCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/cocoa/PlatformUtilitiesCocoa.mm (188843 => 188844)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/cocoa/PlatformUtilitiesCocoa.mm        2015-08-23 21:42:50 UTC (rev 188843)
+++ trunk/Tools/TestWebKitAPI/cocoa/PlatformUtilitiesCocoa.mm        2015-08-23 22:31:32 UTC (rev 188844)
</span><span class="lines">@@ -55,5 +55,8 @@
</span><span class="cx">     return std::string(buffer.get(), stringLength);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if WK_API_ENABLED
+NSString * const TestPlugInClassNameParameter = @&quot;TestPlugInPrincipalClassName&quot;;
+#endif
</ins><span class="cx"> } // namespace Util
</span><span class="cx"> } // namespace TestWebKitAPI
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPIcocoaWebProcessPlugInInfoplist"></a>
<div class="addfile"><h4>Added: trunk/Tools/TestWebKitAPI/cocoa/WebProcessPlugIn/Info.plist (0 => 188844)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/cocoa/WebProcessPlugIn/Info.plist                                (rev 0)
+++ trunk/Tools/TestWebKitAPI/cocoa/WebProcessPlugIn/Info.plist        2015-08-23 22:31:32 UTC (rev 188844)
</span><span class="lines">@@ -0,0 +1,24 @@
</span><ins>+&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
+&lt;!DOCTYPE plist PUBLIC &quot;-//Apple//DTD PLIST 1.0//EN&quot; &quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&quot;&gt;
+&lt;plist version=&quot;1.0&quot;&gt;
+&lt;dict&gt;
+        &lt;key&gt;CFBundleDevelopmentRegion&lt;/key&gt;
+        &lt;string&gt;en&lt;/string&gt;
+        &lt;key&gt;CFBundleExecutable&lt;/key&gt;
+        &lt;string&gt;$(EXECUTABLE_NAME)&lt;/string&gt;
+        &lt;key&gt;CFBundleInfoDictionaryVersion&lt;/key&gt;
+        &lt;string&gt;6.0&lt;/string&gt;
+        &lt;key&gt;CFBundleName&lt;/key&gt;
+        &lt;string&gt;$(PRODUCT_NAME)&lt;/string&gt;
+        &lt;key&gt;CFBundlePackageType&lt;/key&gt;
+        &lt;string&gt;BNDL&lt;/string&gt;
+        &lt;key&gt;CFBundleShortVersionString&lt;/key&gt;
+        &lt;string&gt;1.0&lt;/string&gt;
+        &lt;key&gt;CFBundleSignature&lt;/key&gt;
+        &lt;string&gt;????&lt;/string&gt;
+        &lt;key&gt;CFBundleVersion&lt;/key&gt;
+        &lt;string&gt;1&lt;/string&gt;
+        &lt;key&gt;NSPrincipalClass&lt;/key&gt;
+        &lt;string&gt;WebProcessPlugIn&lt;/string&gt;
+&lt;/dict&gt;
+&lt;/plist&gt;
</ins></span></pre></div>
<a id="trunkToolsTestWebKitAPIcocoaWebProcessPlugInWebProcessPlugInmm"></a>
<div class="addfile"><h4>Added: trunk/Tools/TestWebKitAPI/cocoa/WebProcessPlugIn/WebProcessPlugIn.mm (0 => 188844)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/cocoa/WebProcessPlugIn/WebProcessPlugIn.mm                                (rev 0)
+++ trunk/Tools/TestWebKitAPI/cocoa/WebProcessPlugIn/WebProcessPlugIn.mm        2015-08-23 22:31:32 UTC (rev 188844)
</span><span class="lines">@@ -0,0 +1,72 @@
</span><ins>+/*
+ * Copyright (C) 2015 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 &quot;config.h&quot;
+
+#if WK_API_ENABLED
+
+#import &quot;PlatformUtilities.h&quot;
+#import &lt;WebKit/WKWebProcessPlugIn.h&gt;
+#import &lt;wtf/RetainPtr.h&gt;
+
+@interface WebProcessPlugIn : NSObject &lt;WKWebProcessPlugIn&gt;
+@end
+
+@implementation WebProcessPlugIn {
+    RetainPtr&lt;id &lt;WKWebProcessPlugIn&gt;&gt; _testPlugIn;
+}
+
+- (void)webProcessPlugIn:(WKWebProcessPlugInController *)plugInController initializeWithObject:(id)initializationObject
+{
+    NSString *testPlugInClassName = [plugInController.parameters valueForKey:TestWebKitAPI::Util::TestPlugInClassNameParameter];
+    ASSERT(testPlugInClassName);
+    ASSERT([testPlugInClassName isKindOfClass:[NSString class]]);
+
+    Class testPlugInClass = NSClassFromString(testPlugInClassName);
+    ASSERT(testPlugInClass);
+    ASSERT([testPlugInClass conformsToProtocol:@protocol(WKWebProcessPlugIn)]);
+
+    ASSERT(!_testPlugIn);
+    _testPlugIn = adoptNS([[testPlugInClass alloc] init]);
+
+    if ([_testPlugIn respondsToSelector:@selector(webProcessPlugIn:initializeWithObject:)])
+        [_testPlugIn webProcessPlugIn:plugInController initializeWithObject:initializationObject];
+}
+
+- (BOOL)respondsToSelector:(SEL)aSelector
+{
+    if ([_testPlugIn respondsToSelector:aSelector])
+        return YES;
+    return [super respondsToSelector:aSelector];
+}
+
+- (id)forwardingTargetForSelector:(SEL)aSelector
+{
+    return _testPlugIn.get();
+}
+
+@end
+
+#endif // WK_API_ENABLED
</ins></span></pre>
</div>
</div>

</body>
</html>