Browse files

Supress duplicate failures due to missing TouchList.identifiedTouch

This is such a common failure mode at the moment, it would be nice to avoid
cluttering the test results with 25 different errors messages for this one
issue.
  • Loading branch information...
1 parent a272b26 commit eef7fbdb9e08bc5c901d0678d2f7ae35b35f7071 @RByers RByers committed Oct 1, 2012
Showing with 17 additions and 4 deletions.
  1. +17 −4 single-touch.html
View
21 single-touch.html
@@ -19,6 +19,8 @@
<script>
setup({explicit_done: true});
+ var hasIdentifiedTouch = true;
+
// Check a Touch object's atttributes for existence and correct type
// TA: 1.1.2, 1.1.3
function check_Touch_object (t) {
@@ -77,6 +79,9 @@
var type = attr[0];
var name = attr[1];
+ if (name == "identifiedTouch" && !hasIdentifiedTouch)
+ return;
+
// existence check
test(function() {
assert_true(name in tl, name + " attribute in TouchList");
@@ -202,6 +207,12 @@
assert_equals(touchList.item(0), touch, "touchList.item(0) is input touch");
}, "document.createTouchList exists and correctly creates a TouchList from a single Touch");
+ test(function() {
+ // A common failure mode (eg. WebKit bug 96294), don't report multiple errors for it
+ hasIdentifiedTouch = 'identifiedTouch' in touchList;
+ assert_true(hasIdentifiedTouch);
+ }, "TouchList contains an identifiedTouch property");
+
if (touchList)
check_TouchList_object(touchList);
@@ -252,10 +263,12 @@
}, "touchstart: event target same as targetTouches target");
// TA: @TBD
- test(function() {
- assert_equals(ev.touches.identifiedTouch(touchstart_identifier), t, "touches.identifiedTouch is correct.");
- }, "touchstart: touches.identifiedTouch same as first touch point id");
-
+ if (hasIdentifiedTouch) {
+ test(function() {
+ assert_equals(ev.touches.identifiedTouch(touchstart_identifier), t, "touches.identifiedTouch is correct.");
+ }, "touchstart: touches.identifiedTouch same as first touch point id");
+ }
+
// TA: @TBD
test(function() {
assert_true(is_touch_over_element(t, target0), "touch.pageX/pageY is over target0.");

0 comments on commit eef7fbd

Please sign in to comment.