<!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>[246004] 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/246004">246004</a></dd>
<dt>Author</dt> <dd>wenson_hsieh@apple.com</dd>
<dt>Date</dt> <dd>2019-05-31 17:43:56 -0700 (Fri, 31 May 2019)</dd>
</dl>

<h3>Log Message</h3>
<pre>Make tests that use UIHelper more robust under certain configurations
https://bugs.webkit.org/show_bug.cgi?id=198442
<rdar://problem/51301737>

Reviewed by Megan Gardner.

Tools:

For a certain device class, many tests that attempt to use UIHelper.isIOS are currently failing. We can fix this
by making the `isIOS` check more robust; this patch also renames `isIOS` to `isIOSFamily`, which is more
accurate (and consistent with the corresponding PLATFORM macro name).

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/TestRunner.h:
(WTR::TestRunner::isIOSFamily const):

LayoutTests:

Replace usages of `UIHelper.isIOS` with `UIHelper.isIOSFamily`.

* fast/dom/iframe-inner-size-scaling.html:
* fast/forms/datalist/datalist-show-hide.html:
* fast/forms/datalist/datalist-textinput-suggestions-order.html:
* fast/scrolling/ios/reveal-focused-element-right-above-keyboard-on-ipad.html:

Also remove a workaround here that forces `isIOS` to return `true`.

* resources/ui-helper.js:
(window.UIHelper.isIOSFamily):
(window.UIHelper.isWebKit2):
(window.UIHelper.humanSpeedDoubleTapAt):
(window.UIHelper.humanSpeedZoomByDoubleTappingAt):
(window.UIHelper.zoomByDoubleTappingAt):
(window.UIHelper.async.doubleActivateAt):
(window.UIHelper.async.doubleActivateAtSelectionStart):
(window.UIHelper.async.selectWordByDoubleTapOrClick):
(window.UIHelper.keyDown):
(window.UIHelper.deactivateFormControl):
(window.UIHelper.typeCharacter):
(window.UIHelper.inputViewBounds):
(window.UIHelper.contentOffset):
(window.UIHelper.isIOS): Deleted.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastdomiframeinnersizescalinghtml">trunk/LayoutTests/fast/dom/iframe-inner-size-scaling.html</a></li>
<li><a href="#trunkLayoutTestsfastformsdatalistdatalistshowhidehtml">trunk/LayoutTests/fast/forms/datalist/datalist-show-hide.html</a></li>
<li><a href="#trunkLayoutTestsfastformsdatalistdatalisttextinputsuggestionsorderhtml">trunk/LayoutTests/fast/forms/datalist/datalist-textinput-suggestions-order.html</a></li>
<li><a href="#trunkLayoutTestsfastscrollingiosrevealfocusedelementrightabovekeyboardonipadhtml">trunk/LayoutTests/fast/scrolling/ios/reveal-focused-element-right-above-keyboard-on-ipad.html</a></li>
<li><a href="#trunkLayoutTestsresourcesuihelperjs">trunk/LayoutTests/resources/ui-helper.js</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleBindingsTestRunneridl">trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleTestRunnerh">trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (246003 => 246004)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog      2019-06-01 00:00:55 UTC (rev 246003)
+++ trunk/LayoutTests/ChangeLog 2019-06-01 00:43:56 UTC (rev 246004)
</span><span class="lines">@@ -1,3 +1,36 @@
</span><ins>+2019-05-31  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        Make tests that use UIHelper more robust under certain configurations
+        https://bugs.webkit.org/show_bug.cgi?id=198442
+        <rdar://problem/51301737>
+
+        Reviewed by Megan Gardner.
+
+        Replace usages of `UIHelper.isIOS` with `UIHelper.isIOSFamily`.
+
+        * fast/dom/iframe-inner-size-scaling.html:
+        * fast/forms/datalist/datalist-show-hide.html:
+        * fast/forms/datalist/datalist-textinput-suggestions-order.html:
+        * fast/scrolling/ios/reveal-focused-element-right-above-keyboard-on-ipad.html:
+
+        Also remove a workaround here that forces `isIOS` to return `true`.
+
+        * resources/ui-helper.js:
+        (window.UIHelper.isIOSFamily):
+        (window.UIHelper.isWebKit2):
+        (window.UIHelper.humanSpeedDoubleTapAt):
+        (window.UIHelper.humanSpeedZoomByDoubleTappingAt):
+        (window.UIHelper.zoomByDoubleTappingAt):
+        (window.UIHelper.async.doubleActivateAt):
+        (window.UIHelper.async.doubleActivateAtSelectionStart):
+        (window.UIHelper.async.selectWordByDoubleTapOrClick):
+        (window.UIHelper.keyDown):
+        (window.UIHelper.deactivateFormControl):
+        (window.UIHelper.typeCharacter):
+        (window.UIHelper.inputViewBounds):
+        (window.UIHelper.contentOffset):
+        (window.UIHelper.isIOS): Deleted.
+
</ins><span class="cx"> 2019-05-31  Youenn Fablet  <youenn@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Add an option to mute audio capture automatically when page is not visible
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomiframeinnersizescalinghtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/iframe-inner-size-scaling.html (246003 => 246004)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/iframe-inner-size-scaling.html        2019-06-01 00:00:55 UTC (rev 246003)
+++ trunk/LayoutTests/fast/dom/iframe-inner-size-scaling.html   2019-06-01 00:43:56 UTC (rev 246004)
</span><span class="lines">@@ -17,7 +17,7 @@
</span><span class="cx">             shouldBeNonZero("frame.contentWindow.innerHeight");
</span><span class="cx">             shouldBe("frame.contentWindow.innerWidth", "originalWidth");
</span><span class="cx">             
</span><del>-            scrollbarWidth = UIHelper.isIOS() ? 0 : 15;
</del><ins>+            scrollbarWidth = UIHelper.isIOSFamily() ? 0 : 15;
</ins><span class="cx">             shouldBe("frame.contentWindow.innerHeight", "originalHeight - scrollbarWidth");
</span><span class="cx">             finishJSTest();
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkLayoutTestsfastformsdatalistdatalistshowhidehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/forms/datalist/datalist-show-hide.html (246003 => 246004)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/forms/datalist/datalist-show-hide.html    2019-06-01 00:00:55 UTC (rev 246003)
+++ trunk/LayoutTests/fast/forms/datalist/datalist-show-hide.html       2019-06-01 00:43:56 UTC (rev 246004)
</span><span class="lines">@@ -50,7 +50,7 @@
</span><span class="cx"> async function runTest() {
</span><span class="cx">     await UIHelper.activateAndWaitForInputSessionAt(150, 25);
</span><span class="cx"> 
</span><del>-    if (UIHelper.isIOS()) {
</del><ins>+    if (UIHelper.isIOSFamily()) {
</ins><span class="cx">         await UIHelper.tapAt(290, 30);
</span><span class="cx">         await waitForDataListSuggestionsToChangeVisibility(true);
</span><span class="cx">     }
</span><span class="lines">@@ -57,7 +57,7 @@
</span><span class="cx"> 
</span><span class="cx">     before.textContent = await UIHelper.isShowingDataListSuggestions();
</span><span class="cx"> 
</span><del>-    if (UIHelper.isIOS()) {
</del><ins>+    if (UIHelper.isIOSFamily()) {
</ins><span class="cx">         await UIHelper.tapAt(150, 25);
</span><span class="cx">         await waitForDataListSuggestionsToChangeVisibility(false);
</span><span class="cx">     } else
</span></span></pre></div>
<a id="trunkLayoutTestsfastformsdatalistdatalisttextinputsuggestionsorderhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/forms/datalist/datalist-textinput-suggestions-order.html (246003 => 246004)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/forms/datalist/datalist-textinput-suggestions-order.html  2019-06-01 00:00:55 UTC (rev 246003)
+++ trunk/LayoutTests/fast/forms/datalist/datalist-textinput-suggestions-order.html     2019-06-01 00:43:56 UTC (rev 246004)
</span><span class="lines">@@ -45,7 +45,7 @@
</span><span class="cx"> {
</span><span class="cx">     return new Promise(async resolve => {
</span><span class="cx">         await UIHelper.activateAndWaitForInputSessionAt(100, 25);
</span><del>-        if (UIHelper.isIOS()) {
</del><ins>+        if (UIHelper.isIOSFamily()) {
</ins><span class="cx">             await UIHelper.tapAt(290, 30);
</span><span class="cx">             await UIHelper.resignFirstResponder();
</span><span class="cx">             await UIHelper.waitForKeyboardToHide();
</span></span></pre></div>
<a id="trunkLayoutTestsfastscrollingiosrevealfocusedelementrightabovekeyboardonipadhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/scrolling/ios/reveal-focused-element-right-above-keyboard-on-ipad.html (246003 => 246004)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/scrolling/ios/reveal-focused-element-right-above-keyboard-on-ipad.html    2019-06-01 00:00:55 UTC (rev 246003)
+++ trunk/LayoutTests/fast/scrolling/ios/reveal-focused-element-right-above-keyboard-on-ipad.html       2019-06-01 00:43:56 UTC (rev 246004)
</span><span class="lines">@@ -30,7 +30,6 @@
</span><span class="cx">     const resizeEvent = listenForEventOnce(target, 'focus').then(() => listenForEventOnce(visualViewport, 'resize'));
</span><span class="cx"> 
</span><span class="cx">     if (window.testRunner) {
</span><del>-        UIHelper.isIOS = () => true;
</del><span class="cx">         await UIHelper.setHardwareKeyboardAttached(false);
</span><span class="cx">         await UIHelper.activateElementAndWaitForInputSession(target);
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkLayoutTestsresourcesuihelperjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/resources/ui-helper.js (246003 => 246004)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/resources/ui-helper.js 2019-06-01 00:00:55 UTC (rev 246003)
+++ trunk/LayoutTests/resources/ui-helper.js    2019-06-01 00:43:56 UTC (rev 246004)
</span><span class="lines">@@ -1,13 +1,13 @@
</span><span class="cx"> 
</span><span class="cx"> window.UIHelper = class UIHelper {
</span><del>-    static isIOS()
</del><ins>+    static isIOSFamily()
</ins><span class="cx">     {
</span><del>-        return navigator.userAgent.includes('iPhone') || navigator.userAgent.includes('iPad');
</del><ins>+        return testRunner.isIOSFamily;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     static isWebKit2()
</span><span class="cx">     {
</span><del>-        return window.testRunner.isWebKit2;
</del><ins>+        return testRunner.isWebKit2;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     static doubleClickAt(x, y)
</span><span class="lines">@@ -31,7 +31,7 @@
</span><span class="cx"> 
</span><span class="cx">     static tapAt(x, y, modifiers=[])
</span><span class="cx">     {
</span><del>-        console.assert(this.isIOS());
</del><ins>+        console.assert(this.isIOSFamily());
</ins><span class="cx"> 
</span><span class="cx">         if (!this.isWebKit2()) {
</span><span class="cx">             console.assert(!modifiers || !modifiers.length);
</span><span class="lines">@@ -52,7 +52,7 @@
</span><span class="cx"> 
</span><span class="cx">     static doubleTapAt(x, y)
</span><span class="cx">     {
</span><del>-        console.assert(this.isIOS());
</del><ins>+        console.assert(this.isIOSFamily());
</ins><span class="cx"> 
</span><span class="cx">         if (!this.isWebKit2()) {
</span><span class="cx">             eventSender.addTouchPoint(x, y);
</span><span class="lines">@@ -76,7 +76,7 @@
</span><span class="cx"> 
</span><span class="cx">     static humanSpeedDoubleTapAt(x, y)
</span><span class="cx">     {
</span><del>-        console.assert(this.isIOS());
</del><ins>+        console.assert(this.isIOSFamily());
</ins><span class="cx"> 
</span><span class="cx">         if (!this.isWebKit2()) {
</span><span class="cx">             // FIXME: Add a sleep in here.
</span><span class="lines">@@ -101,7 +101,7 @@
</span><span class="cx"> 
</span><span class="cx">     static humanSpeedZoomByDoubleTappingAt(x, y)
</span><span class="cx">     {
</span><del>-        console.assert(this.isIOS());
</del><ins>+        console.assert(this.isIOSFamily());
</ins><span class="cx"> 
</span><span class="cx">         if (!this.isWebKit2()) {
</span><span class="cx">             // FIXME: Add a sleep in here.
</span><span class="lines">@@ -133,7 +133,7 @@
</span><span class="cx"> 
</span><span class="cx">     static zoomByDoubleTappingAt(x, y)
</span><span class="cx">     {
</span><del>-        console.assert(this.isIOS());
</del><ins>+        console.assert(this.isIOSFamily());
</ins><span class="cx"> 
</span><span class="cx">         if (!this.isWebKit2()) {
</span><span class="cx">             eventSender.addTouchPoint(x, y);
</span><span class="lines">@@ -159,7 +159,7 @@
</span><span class="cx"> 
</span><span class="cx">     static activateAt(x, y)
</span><span class="cx">     {
</span><del>-        if (!this.isWebKit2() || !this.isIOS()) {
</del><ins>+        if (!this.isWebKit2() || !this.isIOSFamily()) {
</ins><span class="cx">             eventSender.mouseMoveTo(x, y);
</span><span class="cx">             eventSender.mouseDown();
</span><span class="cx">             eventSender.mouseUp();
</span><span class="lines">@@ -183,7 +183,7 @@
</span><span class="cx"> 
</span><span class="cx">     static async doubleActivateAt(x, y)
</span><span class="cx">     {
</span><del>-        if (this.isIOS())
</del><ins>+        if (this.isIOSFamily())
</ins><span class="cx">             await UIHelper.doubleTapAt(x, y);
</span><span class="cx">         else
</span><span class="cx">             await UIHelper.doubleClickAt(x, y);
</span><span class="lines">@@ -194,7 +194,7 @@
</span><span class="cx">         const rects = window.getSelection().getRangeAt(0).getClientRects();
</span><span class="cx">         const x = rects[0].left;
</span><span class="cx">         const y = rects[0].top;
</span><del>-        if (this.isIOS()) {
</del><ins>+        if (this.isIOSFamily()) {
</ins><span class="cx">             await UIHelper.activateAndWaitForInputSessionAt(x, y);
</span><span class="cx">             await UIHelper.doubleTapAt(x, y);
</span><span class="cx">             // This is only here to deal with async/sync copy/paste calls, so
</span><span class="lines">@@ -209,7 +209,7 @@
</span><span class="cx">         const boundingRect = element.getBoundingClientRect();
</span><span class="cx">         const x = boundingRect.x + relativeX;
</span><span class="cx">         const y = boundingRect.y + relativeY;
</span><del>-        if (this.isIOS()) {
</del><ins>+        if (this.isIOSFamily()) {
</ins><span class="cx">             await UIHelper.activateAndWaitForInputSessionAt(x, y);
</span><span class="cx">             await UIHelper.doubleTapAt(x, y);
</span><span class="cx">             // This is only here to deal with async/sync copy/paste calls, so
</span><span class="lines">@@ -222,7 +222,7 @@
</span><span class="cx"> 
</span><span class="cx">     static keyDown(key, modifiers=[])
</span><span class="cx">     {
</span><del>-        if (!this.isWebKit2() || !this.isIOS()) {
</del><ins>+        if (!this.isWebKit2() || !this.isIOSFamily()) {
</ins><span class="cx">             eventSender.keyDown(key, modifiers);
</span><span class="cx">             return Promise.resolve();
</span><span class="cx">         }
</span><span class="lines">@@ -311,7 +311,7 @@
</span><span class="cx"> 
</span><span class="cx">     static activateAndWaitForInputSessionAt(x, y)
</span><span class="cx">     {
</span><del>-        if (!this.isWebKit2() || !this.isIOS())
</del><ins>+        if (!this.isWebKit2() || !this.isIOSFamily())
</ins><span class="cx">             return this.activateAt(x, y);
</span><span class="cx"> 
</span><span class="cx">         return new Promise(resolve => {
</span><span class="lines">@@ -334,7 +334,7 @@
</span><span class="cx"> 
</span><span class="cx">     static activateFormControl(element)
</span><span class="cx">     {
</span><del>-        if (!this.isWebKit2() || !this.isIOS())
</del><ins>+        if (!this.isWebKit2() || !this.isIOSFamily())
</ins><span class="cx">             return this.activateElement(element);
</span><span class="cx"> 
</span><span class="cx">         const x = element.offsetLeft + element.offsetWidth / 2;
</span><span class="lines">@@ -367,7 +367,7 @@
</span><span class="cx"> 
</span><span class="cx">     static deactivateFormControl(element)
</span><span class="cx">     {
</span><del>-        if (!this.isWebKit2() || !this.isIOS()) {
</del><ins>+        if (!this.isWebKit2() || !this.isIOSFamily()) {
</ins><span class="cx">             element.blur();
</span><span class="cx">             return Promise.resolve();
</span><span class="cx">         }
</span><span class="lines">@@ -384,7 +384,7 @@
</span><span class="cx"> 
</span><span class="cx">     static waitForPopoverToPresent()
</span><span class="cx">     {
</span><del>-        if (!this.isWebKit2() || !this.isIOS())
</del><ins>+        if (!this.isWebKit2() || !this.isIOSFamily())
</ins><span class="cx">             return Promise.resolve();
</span><span class="cx"> 
</span><span class="cx">         return new Promise(resolve => {
</span><span class="lines">@@ -400,7 +400,7 @@
</span><span class="cx"> 
</span><span class="cx">     static waitForPopoverToDismiss()
</span><span class="cx">     {
</span><del>-        if (!this.isWebKit2() || !this.isIOS())
</del><ins>+        if (!this.isWebKit2() || !this.isIOSFamily())
</ins><span class="cx">             return Promise.resolve();
</span><span class="cx"> 
</span><span class="cx">         return new Promise(resolve => {
</span><span class="lines">@@ -416,7 +416,7 @@
</span><span class="cx"> 
</span><span class="cx">     static waitForKeyboardToHide()
</span><span class="cx">     {
</span><del>-        if (!this.isWebKit2() || !this.isIOS())
</del><ins>+        if (!this.isWebKit2() || !this.isIOSFamily())
</ins><span class="cx">             return Promise.resolve();
</span><span class="cx"> 
</span><span class="cx">         return new Promise(resolve => {
</span><span class="lines">@@ -432,7 +432,7 @@
</span><span class="cx"> 
</span><span class="cx">     static getUICaretRect()
</span><span class="cx">     {
</span><del>-        if (!this.isWebKit2() || !this.isIOS())
</del><ins>+        if (!this.isWebKit2() || !this.isIOSFamily())
</ins><span class="cx">             return Promise.resolve();
</span><span class="cx"> 
</span><span class="cx">         return new Promise(resolve => {
</span><span class="lines">@@ -448,7 +448,7 @@
</span><span class="cx"> 
</span><span class="cx">     static getUISelectionRects()
</span><span class="cx">     {
</span><del>-        if (!this.isWebKit2() || !this.isIOS())
</del><ins>+        if (!this.isWebKit2() || !this.isIOSFamily())
</ins><span class="cx">             return Promise.resolve();
</span><span class="cx"> 
</span><span class="cx">         return new Promise(resolve => {
</span><span class="lines">@@ -464,7 +464,7 @@
</span><span class="cx"> 
</span><span class="cx">     static getUICaretViewRect()
</span><span class="cx">     {
</span><del>-        if (!this.isWebKit2() || !this.isIOS())
</del><ins>+        if (!this.isWebKit2() || !this.isIOSFamily())
</ins><span class="cx">             return Promise.resolve();
</span><span class="cx"> 
</span><span class="cx">         return new Promise(resolve => {
</span><span class="lines">@@ -480,7 +480,7 @@
</span><span class="cx"> 
</span><span class="cx">     static getUISelectionViewRects()
</span><span class="cx">     {
</span><del>-        if (!this.isWebKit2() || !this.isIOS())
</del><ins>+        if (!this.isWebKit2() || !this.isIOSFamily())
</ins><span class="cx">             return Promise.resolve();
</span><span class="cx"> 
</span><span class="cx">         return new Promise(resolve => {
</span><span class="lines">@@ -496,7 +496,7 @@
</span><span class="cx"> 
</span><span class="cx">     static getSelectionStartGrabberViewRect()
</span><span class="cx">     {
</span><del>-        if (!this.isWebKit2() || !this.isIOS())
</del><ins>+        if (!this.isWebKit2() || !this.isIOSFamily())
</ins><span class="cx">             return Promise.resolve();
</span><span class="cx"> 
</span><span class="cx">         return new Promise(resolve => {
</span><span class="lines">@@ -512,7 +512,7 @@
</span><span class="cx"> 
</span><span class="cx">     static getSelectionEndGrabberViewRect()
</span><span class="cx">     {
</span><del>-        if (!this.isWebKit2() || !this.isIOS())
</del><ins>+        if (!this.isWebKit2() || !this.isIOSFamily())
</ins><span class="cx">             return Promise.resolve();
</span><span class="cx"> 
</span><span class="cx">         return new Promise(resolve => {
</span><span class="lines">@@ -634,7 +634,7 @@
</span><span class="cx"> 
</span><span class="cx">     static typeCharacter(characterString)
</span><span class="cx">     {
</span><del>-        if (!this.isWebKit2() || !this.isIOS()) {
</del><ins>+        if (!this.isWebKit2() || !this.isIOSFamily()) {
</ins><span class="cx">             eventSender.keyDown(characterString);
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="lines">@@ -656,7 +656,7 @@
</span><span class="cx"> 
</span><span class="cx">     static inputViewBounds()
</span><span class="cx">     {
</span><del>-        if (!this.isWebKit2() || !this.isIOS())
</del><ins>+        if (!this.isWebKit2() || !this.isIOSFamily())
</ins><span class="cx">             return Promise.resolve();
</span><span class="cx"> 
</span><span class="cx">         return new Promise(resolve => {
</span><span class="lines">@@ -795,7 +795,7 @@
</span><span class="cx"> 
</span><span class="cx">     static contentOffset()
</span><span class="cx">     {
</span><del>-        if (!this.isIOS())
</del><ins>+        if (!this.isIOSFamily())
</ins><span class="cx">             return Promise.resolve();
</span><span class="cx"> 
</span><span class="cx">         const uiScript = "JSON.stringify([uiController.contentOffsetX, uiController.contentOffsetY])";
</span><span class="lines">@@ -909,7 +909,7 @@
</span><span class="cx"> 
</span><span class="cx">     static rotateDevice(orientationName, animatedResize = false)
</span><span class="cx">     {
</span><del>-        if (!this.isWebKit2() || !this.isIOS())
</del><ins>+        if (!this.isWebKit2() || !this.isIOSFamily())
</ins><span class="cx">             return Promise.resolve();
</span><span class="cx"> 
</span><span class="cx">         return new Promise(resolve => {
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (246003 => 246004)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog    2019-06-01 00:00:55 UTC (rev 246003)
+++ trunk/Tools/ChangeLog       2019-06-01 00:43:56 UTC (rev 246004)
</span><span class="lines">@@ -1,5 +1,21 @@
</span><span class="cx"> 2019-05-31  Wenson Hsieh  <wenson_hsieh@apple.com>
</span><span class="cx"> 
</span><ins>+        Make tests that use UIHelper more robust under certain configurations
+        https://bugs.webkit.org/show_bug.cgi?id=198442
+        <rdar://problem/51301737>
+
+        Reviewed by Megan Gardner.
+
+        For a certain device class, many tests that attempt to use UIHelper.isIOS are currently failing. We can fix this
+        by making the `isIOS` check more robust; this patch also renames `isIOS` to `isIOSFamily`, which is more
+        accurate (and consistent with the corresponding PLATFORM macro name).
+
+        * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
+        * WebKitTestRunner/InjectedBundle/TestRunner.h:
+        (WTR::TestRunner::isIOSFamily const):
+
+2019-05-31  Wenson Hsieh  <wenson_hsieh@apple.com>
+
</ins><span class="cx">         [iOS] Autocorrection menu font is Times New Roman when using font-family: UICTFontTextStyle*
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=198427
</span><span class="cx">         <rdar://problem/50031825>
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleBindingsTestRunneridl"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl (246003 => 246004)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl      2019-06-01 00:00:55 UTC (rev 246003)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl 2019-06-01 00:43:56 UTC (rev 246004)
</span><span class="lines">@@ -25,6 +25,7 @@
</span><span class="cx"> 
</span><span class="cx"> interface TestRunner {
</span><span class="cx">     readonly attribute boolean isWebKit2;
</span><ins>+    readonly attribute boolean isIOSFamily;
</ins><span class="cx"> 
</span><span class="cx">     // The basics.
</span><span class="cx">     void dumpAsText(boolean dumpPixels);
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleTestRunnerh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h (246003 => 246004)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h 2019-06-01 00:00:55 UTC (rev 246003)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h    2019-06-01 00:43:56 UTC (rev 246004)
</span><span class="lines">@@ -48,6 +48,15 @@
</span><span class="cx"> 
</span><span class="cx">     void makeWindowObject(JSContextRef, JSObjectRef windowObject, JSValueRef* exception);
</span><span class="cx"> 
</span><ins>+    bool isIOSFamily() const
+    {
+#if PLATFORM(IOS_FAMILY)
+        return true;
+#else
+        return false;
+#endif
+    }
+
</ins><span class="cx">     bool isWebKit2() const { return true; }
</span><span class="cx"> 
</span><span class="cx">     // The basics.
</span></span></pre>
</div>
</div>

</body>
</html>