tests/touch-events-v1/approved/create-touch-touchlist.html
changeset 178 67530967ba81
parent 177 19c6f3d0eb8a
child 199 65de4c56206e
equal deleted inserted replaced
177:19c6f3d0eb8a 178:67530967ba81
   126 		}, "document.createTouch exists and creates a Touch object with requested properties");
   126 		}, "document.createTouch exists and creates a Touch object with requested properties");
   127 
   127 
   128 		touch2 = document.createTouch(window, target0, 44, 25, 30, 45, 50);
   128 		touch2 = document.createTouch(window, target0, 44, 25, 30, 45, 50);
   129 
   129 
   130 		var touchList;
   130 		var touchList;
       
   131 		
       
   132 		test(function() {
       
   133 			touchList = document.createTouchList();
       
   134 			assert_equals(touchList.length, 0, "touchList.length is 0");
       
   135 		}, "document.createTouchList exists and correctly creates a TouchList from zero Touch objects");
       
   136 
       
   137 		if (touchList)
       
   138 			check_TouchList_object(touchList);
   131 
   139 
   132 		test(function() {
   140 		test(function() {
   133 			touchList = document.createTouchList(touch1);
   141 			touchList = document.createTouchList(touch1);
   134 			assert_equals(touchList.length, 1, "touchList.length is 1");
   142 			assert_equals(touchList.length, 1, "touchList.length is 1");
   135 			assert_equals(touchList.item(0), touch1, "touchList.item(0) is input touch1");
   143 			assert_equals(touchList.item(0), touch1, "touchList.item(0) is input touch1");
   136 		}, "document.createTouchList exists and correctly creates a TouchList from a single Touch");
   144 		}, "document.createTouchList exists and correctly creates a TouchList from a single Touch");
   137 
   145 
   138 		if (touchList)
   146 		if (touchList)
   139 			check_TouchList_object(touchList);
   147 			check_TouchList_object(touchList);
   140 
   148 			
   141 		test(function() {
   149 		test(function() {
   142 			touchList = document.createTouchList([touch1]);
   150 			touchList = document.createTouchList(touch1, touch2);
   143 			assert_equals(touchList.length, 1, "touchList.length is 1");
       
   144 			assert_equals(touchList.item(0), touch1, "touchList.item(0) is input touch1");
       
   145 			if (touchList)
       
   146 				check_TouchList_object(touchList);
       
   147 		}, "document.createTouchList exists and correctly creates a TouchList from a Touch array of 1 item");
       
   148 		
       
   149 		test(function() {
       
   150 			touchList = document.createTouchList([touch1, touch2]);
       
   151 			assert_equals(touchList.length, 2, "touchList.length is 2");
   151 			assert_equals(touchList.length, 2, "touchList.length is 2");
   152 			assert_equals(touchList.item(0), touch1, "touchList.item(0) is input touch1");
   152 			assert_equals(touchList.item(0), touch1, "touchList.item(0) is input touch1");
   153 			assert_equals(touchList.item(1), touch2, "touchList.item(1) is input touch2");
   153 			assert_equals(touchList.item(1), touch2, "touchList.item(1) is input touch2");
   154 			if (touchList)
   154 		}, "document.createTouchList exists and correctly creates a TouchList from two Touch objects");
   155 				check_TouchList_object(touchList);
   155 
   156 		}, "document.createTouchList exists and correctly creates a TouchList from a Touch array of 2 items");
   156 		if (touchList)
       
   157 			check_TouchList_object(touchList);
   157 
   158 
   158 		target0.innerHTML = "Test complete."
   159 		target0.innerHTML = "Test complete."
   159 		done();
   160 		done();
   160 	}
   161 	}
   161 </script>
   162 </script>