tests/touch-events-v1/approved/create-touch-touchlist.html
author Cathy Chan <cathy.chan@nokia.com>
Tue, 22 Jan 2013 13:42:26 -0500
changeset 178 67530967ba81
parent 177 19c6f3d0eb8a
child 199 65de4c56206e
permissions -rw-r--r--
Updated tests to use variadic form of Document.createTouchList().
165
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
     1
<!DOCTYPE HTML>
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
     2
<html>
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
     3
<!-- 
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
     4
    Test cases for Touch Events v1 Candiate Recommendation
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
     5
    http://www.w3.org/TR/2011/CR-touch-events-20111215/
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
     6
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
     7
	These tests are based on Mozilla-Nokia-Google's single-touch tests. 
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
     8
	http://w3c-test.org/webevents/tests/touch-events-v1/submissions/Moz-Nok-Goog/single-touch.html
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
     9
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    10
	The primary purpose of the tests in this document is checking that the createTouch and createTouchList interfaces of the Touch Events APIs are correctly implemented.
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    11
	Other interactions are covered in other test files.
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    12
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    13
    This document references Test Assertions (abbrev TA below) written by Cathy Chan
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    14
    http://www.w3.org/2010/webevents/wiki/TestAssertions
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    15
-->
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    16
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    17
<head>
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    18
<title>Touch Events createTouch and createTouchList Interface Tests</title>
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    19
<meta name="viewport" content="width=device-width">
167
418583839ba5 Change path to testharness.js to use version in /resources/
Art Barstow <art.barstow@nokia.com>
parents: 165
diff changeset
    20
<script src="/resources/testharness.js"></script>
165
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    21
<script>
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    22
	setup({explicit_done: true});
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    23
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    24
	// Check a Touch object's atttributes for existence and correct type
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    25
	// TA: 1.1.2, 1.1.3
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    26
	function check_Touch_object (t) {
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    27
		test(function() {
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    28
			assert_equals(Object.prototype.toString.call(t), "[object Touch]", "touch is of type Touch");
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    29
		}, "touch point is a Touch object");
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    30
		[
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    31
			["long", "identifier"],
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    32
			["EventTarget", "target"],
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    33
			["long", "screenX"],
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    34
			["long", "screenY"],
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    35
			["long", "clientX"],
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    36
			["long", "clientY"],
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    37
			["long", "pageX"],
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    38
			["long", "pageY"],
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    39
		].forEach(function(attr) {
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    40
			var type = attr[0];
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    41
			var name = attr[1];
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    42
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    43
			// existence check
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    44
			test(function() {
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    45
				assert_true(name in t, name + " attribute in Touch object");
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    46
			}, "Touch." + name + " attribute exists");
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    47
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    48
			// type check
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    49
			switch(type) {
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    50
			case "long":
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    51
				test(function() {
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    52
					assert_equals(typeof t[name], "number", name + " attribute of type long");
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    53
				}, "Touch." + name + " attribute is of type number (long)");
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    54
				break;
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    55
			case "EventTarget":
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    56
				// An event target is some type of Element
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    57
				test(function() {
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    58
					assert_true(t[name] instanceof Element, "EventTarget must be an Element.");
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    59
				}, "Touch." + name + " attribute is of type Element");
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    60
				break;
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    61
			default:
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    62
				break;
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    63
			}
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    64
		}); 
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    65
	}
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    66
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    67
	// Check a TouchList object's attributes and methods for existence and proper type
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    68
	// Also make sure all of the members of the list are Touch objects
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    69
	// TA: 1.2.1, 1.2.2, 1.2.5, 1.2.6
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    70
	function check_TouchList_object (tl) {
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    71
		test(function() {
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    72
			assert_equals(Object.prototype.toString.call(tl), "[object TouchList]", "touch list is of type TouchList");
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    73
		}, "touch list is a TouchList object");
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    74
		[
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    75
			["unsigned long", "length"],
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    76
			["function", "item"],
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    77
		].forEach(function(attr) {
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    78
			var type = attr[0];
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    79
			var name = attr[1];
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    80
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    81
			// existence check
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    82
			test(function() {
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    83
				assert_true(name in tl, name + " attribute in TouchList");
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    84
			}, "TouchList." + name + " attribute exists");
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    85
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    86
			// type check
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    87
			switch(type) {
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    88
			case "unsigned long":
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    89
				test(function() {
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    90
					assert_equals(typeof tl[name], "number", name + " attribute of type long");
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    91
				}, "TouchList." + name + " attribute is of type number (unsigned long)");
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    92
				break;
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    93
			case "function":
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    94
				test(function() {
177
19c6f3d0eb8a Removed TouchList.identifiedTouch.
Cathy Chan <cathy.chan@nokia.com>
parents: 167
diff changeset
    95
					assert_equals(typeof tl[name], "function", name + " attribute of type function");
165
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    96
				}, "TouchList." + name + " attribute is of type function");
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    97
				break;
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    98
			default:
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
    99
				break;
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   100
			}
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   101
		}); 
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   102
		// Each member of tl should be a proper Touch object
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   103
		for (var i=0; i < tl.length; i++) {
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   104
			check_Touch_object(tl.item(i));
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   105
		}
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   106
	}
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   107
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   108
    function check_touch_clientXY(touch) {
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   109
		assert_equals(touch.clientX, touch.pageX - window.pageXOffset, "touch.clientX is touch.pageX - window.pageXOffset.");
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   110
		assert_equals(touch.clientY, touch.pageY - window.pageYOffset, "touch.clientY is touch.pageY - window.pageYOffset.");
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   111
    }
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   112
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   113
	function run() {
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   114
		var target0 = document.getElementById("target0");
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   115
		var touch1, touch2;
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   116
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   117
		test(function() {
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   118
			touch1 = document.createTouch(window, target0, 42, 15, 20, 35, 40);
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   119
			assert_equals(touch1.target, target0, "touch.target is target0");
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   120
			assert_equals(touch1.identifier, 42, "touch.identifier is requested value");
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   121
			assert_equals(touch1.pageX, 15, "touch.pageX is requested value");
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   122
			assert_equals(touch1.pageY, 20, "touch.pageY is requested value");
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   123
			check_touch_clientXY(touch1);
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   124
			assert_equals(touch1.screenX, 35, "touch.screenX is requested value");
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   125
			assert_equals(touch1.screenY, 40, "touch.screenY is requested value");
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   126
		}, "document.createTouch exists and creates a Touch object with requested properties");
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   127
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   128
		touch2 = document.createTouch(window, target0, 44, 25, 30, 45, 50);
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   129
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   130
		var touchList;
178
67530967ba81 Updated tests to use variadic form of Document.createTouchList().
Cathy Chan <cathy.chan@nokia.com>
parents: 177
diff changeset
   131
		
67530967ba81 Updated tests to use variadic form of Document.createTouchList().
Cathy Chan <cathy.chan@nokia.com>
parents: 177
diff changeset
   132
		test(function() {
67530967ba81 Updated tests to use variadic form of Document.createTouchList().
Cathy Chan <cathy.chan@nokia.com>
parents: 177
diff changeset
   133
			touchList = document.createTouchList();
67530967ba81 Updated tests to use variadic form of Document.createTouchList().
Cathy Chan <cathy.chan@nokia.com>
parents: 177
diff changeset
   134
			assert_equals(touchList.length, 0, "touchList.length is 0");
67530967ba81 Updated tests to use variadic form of Document.createTouchList().
Cathy Chan <cathy.chan@nokia.com>
parents: 177
diff changeset
   135
		}, "document.createTouchList exists and correctly creates a TouchList from zero Touch objects");
67530967ba81 Updated tests to use variadic form of Document.createTouchList().
Cathy Chan <cathy.chan@nokia.com>
parents: 177
diff changeset
   136
67530967ba81 Updated tests to use variadic form of Document.createTouchList().
Cathy Chan <cathy.chan@nokia.com>
parents: 177
diff changeset
   137
		if (touchList)
67530967ba81 Updated tests to use variadic form of Document.createTouchList().
Cathy Chan <cathy.chan@nokia.com>
parents: 177
diff changeset
   138
			check_TouchList_object(touchList);
165
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   139
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   140
		test(function() {
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   141
			touchList = document.createTouchList(touch1);
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   142
			assert_equals(touchList.length, 1, "touchList.length is 1");
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   143
			assert_equals(touchList.item(0), touch1, "touchList.item(0) is input touch1");
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   144
		}, "document.createTouchList exists and correctly creates a TouchList from a single Touch");
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   145
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   146
		if (touchList)
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   147
			check_TouchList_object(touchList);
178
67530967ba81 Updated tests to use variadic form of Document.createTouchList().
Cathy Chan <cathy.chan@nokia.com>
parents: 177
diff changeset
   148
			
165
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   149
		test(function() {
178
67530967ba81 Updated tests to use variadic form of Document.createTouchList().
Cathy Chan <cathy.chan@nokia.com>
parents: 177
diff changeset
   150
			touchList = document.createTouchList(touch1, touch2);
165
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   151
			assert_equals(touchList.length, 2, "touchList.length is 2");
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   152
			assert_equals(touchList.item(0), touch1, "touchList.item(0) is input touch1");
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   153
			assert_equals(touchList.item(1), touch2, "touchList.item(1) is input touch2");
178
67530967ba81 Updated tests to use variadic form of Document.createTouchList().
Cathy Chan <cathy.chan@nokia.com>
parents: 177
diff changeset
   154
		}, "document.createTouchList exists and correctly creates a TouchList from two Touch objects");
67530967ba81 Updated tests to use variadic form of Document.createTouchList().
Cathy Chan <cathy.chan@nokia.com>
parents: 177
diff changeset
   155
67530967ba81 Updated tests to use variadic form of Document.createTouchList().
Cathy Chan <cathy.chan@nokia.com>
parents: 177
diff changeset
   156
		if (touchList)
67530967ba81 Updated tests to use variadic form of Document.createTouchList().
Cathy Chan <cathy.chan@nokia.com>
parents: 177
diff changeset
   157
			check_TouchList_object(touchList);
165
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   158
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   159
		target0.innerHTML = "Test complete."
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   160
		done();
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   161
	}
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   162
</script>
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   163
<style>
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   164
	div {
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   165
		margin: 0em;
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   166
		padding: 2em;
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   167
	}
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   168
    #target0 {
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   169
		background: yellow;
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   170
		border: 1px solid orange;
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   171
    }
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   172
</style>
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   173
</head>
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   174
<body onload="run()">
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   175
	<h1>Touch Events: createTouch and createTouchList tests</h1>
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   176
	<div id="target0">Please wait for test to complete...</div>
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   177
	<div id="log"></div>
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   178
</body>
5a5df40e3cbf Approved test files copied to approved directory
Art Barstow <art.barstow@nokia.com>
parents:
diff changeset
   179
</html>