--- a/tests/touch-events-v1/submissions/Nokia/create-touch-touchlist.html Wed Feb 27 15:21:16 2013 -0500
+++ b/tests/touch-events-v1/submissions/Nokia/create-touch-touchlist.html Thu Mar 28 08:32:17 2013 -0400
@@ -17,12 +17,10 @@
<head>
<title>Touch Events createTouch and createTouchList Interface Tests</title>
<meta name="viewport" content="width=device-width">
-<script src="../../../testharness.js"></script>
+<script src="/resources/testharness.js"></script>
<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) {
@@ -73,22 +71,13 @@
test(function() {
assert_equals(Object.prototype.toString.call(tl), "[object TouchList]", "touch list is of type TouchList");
}, "touch list is a TouchList object");
- test(function() {
- // A common failure mode (eg. WebKit bug 96294), don't report multiple errors for it
- hasIdentifiedTouch = 'identifiedTouch' in tl;
- assert_true(hasIdentifiedTouch);
- }, "TouchList contains an identifiedTouch property");
[
["unsigned long", "length"],
["function", "item"],
- ["function", "identifiedTouch"],
].forEach(function(attr) {
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");
@@ -103,7 +92,7 @@
break;
case "function":
test(function() {
- assert_equals(typeof tl[name], "function", name + " attribute of type long");
+ assert_equals(typeof tl[name], "function", name + " attribute of type function");
}, "TouchList." + name + " attribute is of type function");
break;
default:
@@ -114,14 +103,6 @@
for (var i=0; i < tl.length; i++) {
check_Touch_object(tl.item(i));
}
- // identifiedTouch should return the member Touch object with the specified identifier
- test(function() {
- if (hasIdentifiedTouch) {
- for (var i=0; i < tl.length; i++) {
- assert_equals(tl.item(i), tl.identifiedTouch(tl.item(i).identifier), "TouchList.identifiedTouch returns the correct item");
- }
- }
- }, "TouchList.identifiedTouch returns the correct item");
}
function check_touch_clientXY(touch) {
@@ -147,6 +128,14 @@
touch2 = document.createTouch(window, target0, 44, 25, 30, 45, 50);
var touchList;
+
+ test(function() {
+ touchList = document.createTouchList();
+ assert_equals(touchList.length, 0, "touchList.length is 0");
+ }, "document.createTouchList exists and correctly creates a TouchList from zero Touch objects");
+
+ if (touchList)
+ check_TouchList_object(touchList);
test(function() {
touchList = document.createTouchList(touch1);
@@ -156,23 +145,16 @@
if (touchList)
check_TouchList_object(touchList);
-
+
test(function() {
- touchList = document.createTouchList([touch1]);
- assert_equals(touchList.length, 1, "touchList.length is 1");
- assert_equals(touchList.item(0), touch1, "touchList.item(0) is input touch1");
- if (touchList)
- check_TouchList_object(touchList);
- }, "document.createTouchList exists and correctly creates a TouchList from a Touch array of 1 item");
-
- test(function() {
- touchList = document.createTouchList([touch1, touch2]);
+ touchList = document.createTouchList(touch1, touch2);
assert_equals(touchList.length, 2, "touchList.length is 2");
assert_equals(touchList.item(0), touch1, "touchList.item(0) is input touch1");
assert_equals(touchList.item(1), touch2, "touchList.item(1) is input touch2");
- if (touchList)
- check_TouchList_object(touchList);
- }, "document.createTouchList exists and correctly creates a TouchList from a Touch array of 2 items");
+ }, "document.createTouchList exists and correctly creates a TouchList from two Touch objects");
+
+ if (touchList)
+ check_TouchList_object(touchList);
target0.innerHTML = "Test complete."
done();