<!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>[206645] 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/206645">206645</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2016-09-30 11:39:30 -0700 (Fri, 30 Sep 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Make it possible to test web-related user-interface features
https://bugs.webkit.org/show_bug.cgi?id=162657

Patch by Megan Gardner &lt;megan_gardner@apple.com&gt; on 2016-09-30
Reviewed by Simon Fraser.

Source/WebKit2:

Added the ability to pull the strings from an Action Sheet and pass them to
test scripts to make sure we are giving the correct available actions for
the item we are interacting with.
Added a test for long press on an image, and used the sheet scraping functionality
to make sure that the correct actions were being displayed.
Test for previous patch, Changeset 205915; Bug 161761

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _contentsOfUserInterfaceItem:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/ios/WKActionSheetAssistant.h:
* UIProcess/ios/WKActionSheetAssistant.mm:
(-[WKActionSheetAssistant currentAvailableActionStrings]):
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _contentsOfUserInterfaceItem:]):

Tools:

* DumpRenderTree/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::contentsOfUserInterfaceItem):
(WTR::UIScriptController::selectFormAccessoryPickerRow): Deleted.
* TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
* TestRunnerShared/UIScriptContext/UIScriptController.cpp:
(WTR::UIScriptController::contentsOfUserInterfaceItem):
(WTR::UIScriptController::selectFormAccessoryPickerRow): Deleted.
* TestRunnerShared/UIScriptContext/UIScriptController.h:
* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::contentsOfUserInterfaceItem):
(WTR::UIScriptController::selectFormAccessoryPickerRow): Deleted.

LayoutTests:

* fast/events/touch/ios/long-press-on-image-expected.txt: Added.
* fast/events/touch/ios/long-press-on-image.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKWebViewmm">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKWebViewPrivateh">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosWKActionSheetAssistanth">trunk/Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosWKActionSheetAssistantmm">trunk/Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosWKContentViewInteractionh">trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosWKContentViewInteractionmm">trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsDumpRenderTreeiosUIScriptControllerIOSmm">trunk/Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm</a></li>
<li><a href="#trunkToolsTestRunnerSharedUIScriptContextBindingsUIScriptControlleridl">trunk/Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl</a></li>
<li><a href="#trunkToolsTestRunnerSharedUIScriptContextUIScriptControllercpp">trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp</a></li>
<li><a href="#trunkToolsTestRunnerSharedUIScriptContextUIScriptControllerh">trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.h</a></li>
<li><a href="#trunkToolsWebKitTestRunneriosUIScriptControllerIOSmm">trunk/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfasteventstouchioslongpressonimageexpectedtxt">trunk/LayoutTests/fast/events/touch/ios/long-press-on-image-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfasteventstouchioslongpressonimagehtml">trunk/LayoutTests/fast/events/touch/ios/long-press-on-image.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (206644 => 206645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-09-30 18:29:31 UTC (rev 206644)
+++ trunk/LayoutTests/ChangeLog        2016-09-30 18:39:30 UTC (rev 206645)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2016-09-30  Megan Gardner  &lt;megan_gardner@apple.com&gt;
+
+        Make it possible to test web-related user-interface features
+        https://bugs.webkit.org/show_bug.cgi?id=162657
+
+        Reviewed by Simon Fraser.
+
+        * fast/events/touch/ios/long-press-on-image-expected.txt: Added.
+        * fast/events/touch/ios/long-press-on-image.html: Added.
+
</ins><span class="cx"> 2016-09-30  Said Abou-Hallawa  &lt;sabouhallawa@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Change the MemoryCache and CachedResource adjustSize functions to take a long argument
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventstouchioslongpressonimageexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/events/touch/ios/long-press-on-image-expected.txt (0 => 206645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/touch/ios/long-press-on-image-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/events/touch/ios/long-press-on-image-expected.txt        2016-09-30 18:39:30 UTC (rev 206645)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+Available Actions: 
+Save Image
+Copy
+Cancel
+PASS
</ins></span></pre></div>
<a id="trunkLayoutTestsfasteventstouchioslongpressonimagehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/events/touch/ios/long-press-on-image.html (0 => 206645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/touch/ios/long-press-on-image.html                                (rev 0)
+++ trunk/LayoutTests/fast/events/touch/ios/long-press-on-image.html        2016-09-30 18:39:30 UTC (rev 206645)
</span><span class="lines">@@ -0,0 +1,64 @@
</span><ins>+&lt;!DOCTYPE html&gt; &lt;!-- webkit-test-runner [ useFlexibleViewport=true ] --&gt;
+
+&lt;html&gt;
+&lt;head&gt;
+    &lt;script&gt;
+        if (window.testRunner) {
+            testRunner.dumpAsText();
+            testRunner.waitUntilDone();
+        }
+
+        function getUIScript()
+        {
+            return `
+            (function() {
+                uiController.longPressAtPoint(30, 20, function() {
+                    uiController.uiScriptComplete(JSON.stringify(uiController.contentsOfUserInterfaceItem('actionSheet')));
+                });
+             })();`
+        }
+
+        function runTest()
+        {
+            if (!testRunner.runUIScript)
+                return;
+
+            var target = document.getElementById('target');
+            if (testRunner.runUIScript) {
+                testRunner.runUIScript(getUIScript(), function(result) {
+                    var actionDictionary = JSON.parse(result);
+                    var actionStrings = actionDictionary.actionSheet;
+                    var output = '';
+                    if (actionStrings[0] == 'Save Image' &amp;&amp; actionStrings[1] == 'Copy' &amp;&amp; actionStrings[2] == 'Cancel') {
+                        output += 'Available Actions: &lt;br&gt;';
+                        output +=  actionStrings.join('&lt;br&gt;');
+                        output += '&lt;br&gt;';
+                        output += 'PASS';
+                    }
+                    else
+                        output = 'FAIL'
+
+                    document.getElementById('target').innerHTML = output;
+                    testRunner.notifyDone();
+                });
+            }
+        }
+
+        window.addEventListener('load', runTest, false);
+    &lt;/script&gt;
+    &lt;style&gt;
+        #target {
+            height: 100px;
+            width: 200px;
+            background-color: silver;
+        }
+    &lt;/style&gt;
+    &lt;meta name=&quot;viewport&quot; content=&quot;initial-scale=1&quot;&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;div id=&quot;target&quot;&gt;
+    &lt;img src=&quot;../../../images/resources/dice.png&quot; width=&quot;320&quot; height=&quot;240&quot; alt=&quot;Dice&quot;&gt;
+    This test requires UIScriptController to run.
+&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (206644 => 206645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-09-30 18:29:31 UTC (rev 206644)
+++ trunk/Source/WebKit2/ChangeLog        2016-09-30 18:39:30 UTC (rev 206645)
</span><span class="lines">@@ -1,3 +1,27 @@
</span><ins>+2016-09-30  Megan Gardner  &lt;megan_gardner@apple.com&gt;
+
+        Make it possible to test web-related user-interface features
+        https://bugs.webkit.org/show_bug.cgi?id=162657
+
+        Reviewed by Simon Fraser.
+
+        Added the ability to pull the strings from an Action Sheet and pass them to
+        test scripts to make sure we are giving the correct available actions for
+        the item we are interacting with.
+        Added a test for long press on an image, and used the sheet scraping functionality
+        to make sure that the correct actions were being displayed.
+        Test for previous patch, Changeset 205915; Bug 161761
+
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView _contentsOfUserInterfaceItem:]):
+        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
+        * UIProcess/ios/WKActionSheetAssistant.h:
+        * UIProcess/ios/WKActionSheetAssistant.mm:
+        (-[WKActionSheetAssistant currentAvailableActionStrings]):
+        * UIProcess/ios/WKContentViewInteraction.h:
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView _contentsOfUserInterfaceItem:]):
+
</ins><span class="cx"> 2016-09-27  Anders Carlsson  &lt;andersca@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Remove a couple of unused members from PlatformKeyboardEvent
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm (206644 => 206645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm        2016-09-30 18:29:31 UTC (rev 206644)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm        2016-09-30 18:39:30 UTC (rev 206645)
</span><span class="lines">@@ -4519,6 +4519,11 @@
</span><span class="cx">     [_contentView selectFormAccessoryPickerRow:rowIndex];
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (NSDictionary *)_contentsOfUserInterfaceItem:(NSString *)userInterfaceItem
+{
+    return [_contentView _contentsOfUserInterfaceItem:(NSString *)userInterfaceItem];
+}
+
</ins><span class="cx"> - (void)didStartFormControlInteraction
</span><span class="cx"> {
</span><span class="cx">     // For subclasses to override.
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKWebViewPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h (206644 => 206645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h        2016-09-30 18:29:31 UTC (rev 206644)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h        2016-09-30 18:39:30 UTC (rev 206645)
</span><span class="lines">@@ -263,6 +263,7 @@
</span><span class="cx"> - (void)keyboardAccessoryBarPrevious WK_API_AVAILABLE(ios(10.0));
</span><span class="cx"> - (void)dismissFormAccessoryView WK_API_AVAILABLE(ios(WK_IOS_TBA));
</span><span class="cx"> - (void)selectFormAccessoryPickerRow:(int)rowIndex WK_API_AVAILABLE(ios(WK_IOS_TBA));
</span><ins>+- (NSDictionary *)_contentsOfUserInterfaceItem:(NSString *)userInterfaceItem WK_API_AVAILABLE(ios(WK_IOS_TBA));
</ins><span class="cx"> 
</span><span class="cx"> - (void)didStartFormControlInteraction WK_API_AVAILABLE(ios(WK_IOS_TBA));
</span><span class="cx"> - (void)didEndFormControlInteraction WK_API_AVAILABLE(ios(WK_IOS_TBA));
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWKActionSheetAssistanth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.h (206644 => 206645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.h        2016-09-30 18:29:31 UTC (rev 206644)
+++ trunk/Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.h        2016-09-30 18:39:30 UTC (rev 206645)
</span><span class="lines">@@ -72,6 +72,7 @@
</span><span class="cx"> - (RetainPtr&lt;NSArray&gt;)defaultActionsForLinkSheet:(_WKActivatedElementInfo *)elementInfo;
</span><span class="cx"> - (RetainPtr&lt;NSArray&gt;)defaultActionsForImageSheet:(_WKActivatedElementInfo *)elementInfo;
</span><span class="cx"> - (BOOL)isShowingSheet;
</span><ins>+- (NSArray *)currentAvailableActionTitles;
</ins><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> #endif // PLATFORM(IOS)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWKActionSheetAssistantmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm (206644 => 206645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm        2016-09-30 18:29:31 UTC (rev 206644)
+++ trunk/Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm        2016-09-30 18:39:30 UTC (rev 206645)
</span><span class="lines">@@ -213,6 +213,19 @@
</span><span class="cx">     return _interactionSheet != nil;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (NSArray *)currentAvailableActionTitles
+{
+    if (!_interactionSheet)
+        return @[];
+    
+    NSMutableArray *array = [NSMutableArray array];
+    
+    for (UIAlertAction *action in _interactionSheet.get().actions)
+        [array addObject:action.title];
+    
+    return array;
+}
+
</ins><span class="cx"> - (void)_createSheetWithElementActions:(NSArray *)actions showLinkTitle:(BOOL)showLinkTitle
</span><span class="cx"> {
</span><span class="cx">     auto delegate = _delegate.get();
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWKContentViewInteractionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h (206644 => 206645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h        2016-09-30 18:29:31 UTC (rev 206644)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h        2016-09-30 18:39:30 UTC (rev 206645)
</span><span class="lines">@@ -231,6 +231,7 @@
</span><span class="cx"> @interface WKContentView (WKTesting)
</span><span class="cx"> 
</span><span class="cx"> - (void)selectFormAccessoryPickerRow:(NSInteger)rowIndex;
</span><ins>+- (NSDictionary *)_contentsOfUserInterfaceItem:(NSString *)userInterfaceItem;
</ins><span class="cx"> 
</span><span class="cx"> @end
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWKContentViewInteractionmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm (206644 => 206645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm        2016-09-30 18:29:31 UTC (rev 206644)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm        2016-09-30 18:39:30 UTC (rev 206645)
</span><span class="lines">@@ -3849,6 +3849,14 @@
</span><span class="cx">         [(WKFormSelectControl *)_inputPeripheral selectRow:rowIndex inComponent:0 extendingSelection:NO];
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (NSDictionary *)_contentsOfUserInterfaceItem:(NSString *)userInterfaceItem
+{
+    if ([userInterfaceItem isEqualToString:@&quot;actionSheet&quot;])
+        return @{ userInterfaceItem: [_actionSheetAssistant currentAvailableActionTitles] };
+    
+    return nil;
+}
+
</ins><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> #if HAVE(LINK_PREVIEW)
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (206644 => 206645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2016-09-30 18:29:31 UTC (rev 206644)
+++ trunk/Tools/ChangeLog        2016-09-30 18:39:30 UTC (rev 206645)
</span><span class="lines">@@ -1,3 +1,22 @@
</span><ins>+2016-09-30  Megan Gardner  &lt;megan_gardner@apple.com&gt;
+
+        Make it possible to test web-related user-interface features
+        https://bugs.webkit.org/show_bug.cgi?id=162657
+
+        Reviewed by Simon Fraser.
+
+        * DumpRenderTree/ios/UIScriptControllerIOS.mm:
+        (WTR::UIScriptController::contentsOfUserInterfaceItem):
+        (WTR::UIScriptController::selectFormAccessoryPickerRow): Deleted.
+        * TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
+        * TestRunnerShared/UIScriptContext/UIScriptController.cpp:
+        (WTR::UIScriptController::contentsOfUserInterfaceItem):
+        (WTR::UIScriptController::selectFormAccessoryPickerRow): Deleted.
+        * TestRunnerShared/UIScriptContext/UIScriptController.h:
+        * WebKitTestRunner/ios/UIScriptControllerIOS.mm:
+        (WTR::UIScriptController::contentsOfUserInterfaceItem):
+        (WTR::UIScriptController::selectFormAccessoryPickerRow): Deleted.
+
</ins><span class="cx"> 2016-09-29  Jiewen Tan  &lt;jiewen_tan@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Expose CryptoKey to web workers
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreeiosUIScriptControllerIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm (206644 => 206645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm        2016-09-30 18:29:31 UTC (rev 206644)
+++ trunk/Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm        2016-09-30 18:39:30 UTC (rev 206645)
</span><span class="lines">@@ -127,6 +127,11 @@
</span><span class="cx"> void UIScriptController::selectFormAccessoryPickerRow(long rowIndex)
</span><span class="cx"> {
</span><span class="cx"> }
</span><ins>+    
+JSObjectRef UIScriptController::contentsOfUserInterfaceItem(JSStringRef interfaceItem) const
+{
+    return nullptr;
+}
</ins><span class="cx"> 
</span><span class="cx"> void UIScriptController::scrollToOffset(long, long)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkToolsTestRunnerSharedUIScriptContextBindingsUIScriptControlleridl"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl (206644 => 206645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl        2016-09-30 18:29:31 UTC (rev 206644)
+++ trunk/Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl        2016-09-30 18:39:30 UTC (rev 206645)
</span><span class="lines">@@ -62,6 +62,9 @@
</span><span class="cx">     void keyboardAccessoryBarNext();
</span><span class="cx">     void keyboardAccessoryBarPrevious();
</span><span class="cx"> 
</span><ins>+    // Returned object is a dictionary with the passed in string as a key for returned object
+    object contentsOfUserInterfaceItem(DOMString interfaceItem);
+
</ins><span class="cx">     // These callbacks also work for the form accessory views.
</span><span class="cx">     attribute object didShowKeyboardCallback;
</span><span class="cx">     attribute object didHideKeyboardCallback;
</span></span></pre></div>
<a id="trunkToolsTestRunnerSharedUIScriptContextUIScriptControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp (206644 => 206645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp        2016-09-30 18:29:31 UTC (rev 206644)
+++ trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp        2016-09-30 18:39:30 UTC (rev 206645)
</span><span class="lines">@@ -199,6 +199,11 @@
</span><span class="cx"> void UIScriptController::selectFormAccessoryPickerRow(long)
</span><span class="cx"> {
</span><span class="cx"> }
</span><ins>+    
+JSObjectRef UIScriptController::contentsOfUserInterfaceItem(JSStringRef interfaceItem) const
+{
+    return nullptr;
+}
</ins><span class="cx"> 
</span><span class="cx"> void UIScriptController::scrollToOffset(long x, long y)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkToolsTestRunnerSharedUIScriptContextUIScriptControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.h (206644 => 206645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.h        2016-09-30 18:29:31 UTC (rev 206644)
+++ trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.h        2016-09-30 18:39:30 UTC (rev 206645)
</span><span class="lines">@@ -74,6 +74,8 @@
</span><span class="cx">     void dismissFormAccessoryView();
</span><span class="cx">     void selectFormAccessoryPickerRow(long);
</span><span class="cx">     
</span><ins>+    JSObjectRef contentsOfUserInterfaceItem(JSStringRef) const;
+    
</ins><span class="cx">     void scrollToOffset(long x, long y);
</span><span class="cx"> 
</span><span class="cx">     void setDidStartFormControlInteractionCallback(JSValueRef);
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunneriosUIScriptControllerIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm (206644 => 206645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm        2016-09-30 18:29:31 UTC (rev 206644)
+++ trunk/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm        2016-09-30 18:39:30 UTC (rev 206645)
</span><span class="lines">@@ -247,6 +247,13 @@
</span><span class="cx">     TestRunnerWKWebView *webView = TestController::singleton().mainWebView()-&gt;platformView();
</span><span class="cx">     [webView selectFormAccessoryPickerRow:rowIndex];
</span><span class="cx"> }
</span><ins>+    
+JSObjectRef UIScriptController::contentsOfUserInterfaceItem(JSStringRef interfaceItem) const
+{
+    TestRunnerWKWebView *webView = TestController::singleton().mainWebView()-&gt;platformView();
+    NSDictionary *contentDictionary = [webView _contentsOfUserInterfaceItem:toWTFString(toWK(interfaceItem))];
+    return JSValueToObject(m_context-&gt;jsContext(), [JSValue valueWithObject:contentDictionary inContext:[JSContext contextWithJSGlobalContextRef:m_context-&gt;jsContext()]].JSValueRef, nullptr);
+}
</ins><span class="cx"> 
</span><span class="cx"> static CGPoint contentOffsetBoundedInValidRange(UIScrollView *scrollView, CGPoint contentOffset)
</span><span class="cx"> {
</span></span></pre>
</div>
</div>

</body>
</html>