4 <script src="../../../../resources/js-test-pre.js"></script>
6 description("Checks that Touch attributes are on the prototype.");
8 var touch = new Touch({ identifier: 1, target: document.body });
9 shouldBe("touch.__proto__", "Touch.prototype");
10 shouldBe("Object.getOwnPropertyNames(touch).length", "0");
12 function checkAttributeGetter(prototype, propertyName)
14 descriptor = Object.getOwnPropertyDescriptor(prototype, propertyName);
15 shouldBeType("descriptor.get", "Function");
16 shouldBeTrue("descriptor.enumerable");
17 shouldBeTrue("descriptor.configurable");
20 for (var propertyName of ["identifier", "target", "screenX", "screenY", "clientX", "clientY", "pageX", "pageY", "force"]) {
22 debug("* touch.__proto__." + propertyName);
23 checkAttributeGetter(touch.__proto__, propertyName);
26 debug("* Touch.prototype." + propertyName);
27 checkAttributeGetter(Touch.prototype, propertyName);
30 <script src="../../../../resources/js-test-post.js"></script>