Skip to content

Commit 731237b

Browse files
committed
[iOS] <a ping> and <area ping> tests time out
https://bugs.webkit.org/show_bug.cgi?id=156857 Reviewed by Simon Fraser. Source/WebCore: Export HTMLAreaElement::imageElement() so that we can make use of it in WebKit2. * html/HTMLAreaElement.h: Source/WebKit2: Support single tapping on an HTML area element in WebKit2 just as we do in Legacy WebKit. WebKit2 commits to clicking a "clickable" DOM node on a single tap only if it has a renderer. An HTML area element represents a hyperlink in an image map and does not have a renderer. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::sendTapHighlightForNodeIfNecessary): Compute the tap highlight with respect to the renderer for the image map associated with the tapped HTML area element (if it has one). (WebKit::WebPage::commitPotentialTap): Allow committing a potential tap on an HTML area element. LayoutTests: Update test to use work in WebKitTestRunner and unskip the tests. Also remove some unused files. * http/tests/navigation/ping-attribute/anchor-cross-origin-from-https.html: Include external JavaScript script resources/utilities.js and write code in terms of clickElement(). Additionally, add HTML5 doctype tag and put <head> on its own line so as to be consistent with the placement of </head> on its own line. * http/tests/navigation/ping-attribute/anchor-cross-origin.html: Ditto. * http/tests/navigation/ping-attribute/anchor-same-origin.html: Ditto. * http/tests/navigation/ping-attribute/resources/check-ping.php: Removed. * http/tests/navigation/ping-attribute/resources/delete-ping.php: Removed. * http/tests/navigation/ping-attribute/resources/ping-file-path.php: Removed. * http/tests/navigation/ping-attribute/resources/save-Ping.php: Removed. * http/tests/navigation/ping-attribute/resources/utilities.js: (clearLastPingResultAndRunTest): (clickElement): Make use of UIScriptController to click the element via a tap on platforms that support touch events and implement UIScriptController (window.uiController). * platform/ios-simulator-wk2/TestExpectations: Unskip ping-attribute tests. * platform/ios-simulator/TestExpectations: Ditto. Canonical link: https://commits.webkit.org/179183@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204720 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 4cd5bdc commit 731237b

15 files changed

Lines changed: 91 additions & 95 deletions

File tree

LayoutTests/ChangeLog

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,30 @@
1+
2016-08-22 Daniel Bates <[email protected]>
2+
3+
[iOS] <a ping> and <area ping> tests time out
4+
https://bugs.webkit.org/show_bug.cgi?id=156857
5+
6+
Reviewed by Simon Fraser.
7+
8+
Update test to use work in WebKitTestRunner and unskip the tests.
9+
10+
Also remove some unused files.
11+
12+
* http/tests/navigation/ping-attribute/anchor-cross-origin-from-https.html: Include external JavaScript
13+
script resources/utilities.js and write code in terms of clickElement(). Additionally, add HTML5 doctype
14+
tag and put <head> on its own line so as to be consistent with the placement of </head> on its own line.
15+
* http/tests/navigation/ping-attribute/anchor-cross-origin.html: Ditto.
16+
* http/tests/navigation/ping-attribute/anchor-same-origin.html: Ditto.
17+
* http/tests/navigation/ping-attribute/resources/check-ping.php: Removed.
18+
* http/tests/navigation/ping-attribute/resources/delete-ping.php: Removed.
19+
* http/tests/navigation/ping-attribute/resources/ping-file-path.php: Removed.
20+
* http/tests/navigation/ping-attribute/resources/save-Ping.php: Removed.
21+
* http/tests/navigation/ping-attribute/resources/utilities.js:
22+
(clearLastPingResultAndRunTest):
23+
(clickElement): Make use of UIScriptController to click the element via a tap on platforms that
24+
support touch events and implement UIScriptController (window.uiController).
25+
* platform/ios-simulator-wk2/TestExpectations: Unskip ping-attribute tests.
26+
* platform/ios-simulator/TestExpectations: Ditto.
27+
128
2016-08-22 Youenn Fablet <[email protected]>
229

330
LayoutTest http/tests/fetch/fetch-in-worker-crash.html is flaky

LayoutTests/http/tests/navigation/ping-attribute/anchor-cross-origin-from-https.html

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
<html><head>
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
24
<title>Ping</title>
5+
<script src="resources/utilities.js"></script>
36
<script>
47

58
if (window.testRunner) {
@@ -23,12 +26,7 @@
2326
return;
2427
}
2528

26-
if (window.eventSender) {
27-
var a = document.getElementById("a");
28-
eventSender.mouseMoveTo(a.offsetLeft + 2, a.offsetTop + 2);
29-
eventSender.mouseDown();
30-
eventSender.mouseUp();
31-
}
29+
clickElement(document.getElementById("a"));
3230
}
3331

3432
</script>

LayoutTests/http/tests/navigation/ping-attribute/anchor-cross-origin.html

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
<html><head>
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
24
<title>Ping</title>
5+
<script src="resources/utilities.js"></script>
36
<script>
47

58
var testCalled = false;
@@ -15,12 +18,7 @@
1518
return;
1619
}
1720

18-
if (window.eventSender) {
19-
var a = document.getElementById("a");
20-
eventSender.mouseMoveTo(a.offsetLeft + 2, a.offsetTop + 2);
21-
eventSender.mouseDown();
22-
eventSender.mouseUp();
23-
}
21+
clickElement(document.getElementById("a"));
2422
}
2523

2624
</script>

LayoutTests/http/tests/navigation/ping-attribute/anchor-same-origin.html

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
<html><head>
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
24
<title>Ping</title>
5+
<script src="resources/utilities.js"></script>
36
<script>
47

58
var testCalled = false;
@@ -15,12 +18,7 @@
1518
return;
1619
}
1720

18-
if (window.eventSender) {
19-
var a = document.getElementById("a");
20-
eventSender.mouseMoveTo(a.offsetLeft + 2, a.offsetTop + 2);
21-
eventSender.mouseDown();
22-
eventSender.mouseUp();
23-
}
21+
clickElement(document.getElementById("a"));
2422
}
2523

2624
</script>

LayoutTests/http/tests/navigation/ping-attribute/resources/check-ping.php

Lines changed: 0 additions & 24 deletions
This file was deleted.

LayoutTests/http/tests/navigation/ping-attribute/resources/delete-ping.php

Lines changed: 0 additions & 5 deletions
This file was deleted.

LayoutTests/http/tests/navigation/ping-attribute/resources/ping-file-path.php

Lines changed: 0 additions & 16 deletions
This file was deleted.

LayoutTests/http/tests/navigation/ping-attribute/resources/save-Ping.php

Lines changed: 0 additions & 15 deletions
This file was deleted.

LayoutTests/http/tests/navigation/ping-attribute/resources/utilities.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,22 @@ function clearLastPingResultAndRunTest(callback)
2626
}
2727

2828
var xhr = new XMLHttpRequest;
29-
xhr.open("GET", "resources/delete-ping.php", true /* async */);
29+
xhr.open("GET", "../../resources/delete-ping.php", true /* async */);
3030
xhr.send(null);
3131
xhr.onload = callback;
3232
xhr.onerror = done;
3333
}
3434

3535
function clickElement(element)
3636
{
37-
if (!window.eventSender)
38-
return;
39-
eventSender.mouseMoveTo(element.offsetLeft + 2, element.offsetTop + 2);
40-
eventSender.mouseDown();
41-
eventSender.mouseUp();
37+
var x = element.offsetLeft + 2;
38+
var y = element.offsetTop + 2;
39+
var supportsTouchEvents = "TouchEvent" in window;
40+
if (testRunner.runUIScript && supportsTouchEvents)
41+
testRunner.runUIScript("(function() { uiController.singleTapAtPoint(" + x + ", " + y + "); })()");
42+
else if (window.eventSender) {
43+
eventSender.mouseMoveTo(x, y);
44+
eventSender.mouseDown();
45+
eventSender.mouseUp();
46+
}
4247
}

LayoutTests/platform/ios-simulator-wk2/TestExpectations

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -405,9 +405,6 @@ http/tests/navigation/no-referrer-reset.html
405405
http/tests/navigation/no-referrer-same-window.html
406406
http/tests/navigation/no-referrer-subframe.html
407407
http/tests/navigation/no-referrer-target-blank.html
408-
http/tests/navigation/ping-attribute/anchor-cross-origin-from-https.html
409-
http/tests/navigation/ping-attribute/anchor-cross-origin.html
410-
http/tests/navigation/ping-attribute/anchor-same-origin.html
411408
http/tests/navigation/redirect-preserves-referrer.html
412409
http/tests/navigation/redirect-to-random-url-versus-memory-cache.html
413410
http/tests/security/aboutBlank/xss-DENIED-navigate-opener-document-write.html
@@ -1741,7 +1738,6 @@ fast/forms/focus-option-control-on-page.html [ Skip ]
17411738
# Skip timeouts
17421739
fast/dom/Geolocation/startUpdatingOnlyWhenPageVisible.html [ Skip ]
17431740
fast/dom/Geolocation/stopUpdatingForHiddenPage.html [ Skip ]
1744-
http/tests/navigation/ping-attribute/anchor-cookie.html [ Skip ]
17451741
webkit.org/b/148709 fast/events/wheelevent-basic.html [ Skip ]
17461742
webkit.org/b/148709 fast/events/wheelevent-mousewheel-interaction.html [ Skip ]
17471743

0 commit comments

Comments
 (0)