tests/touch-events-v1/submissions/Nokia/multi-touch-interfaces.html
author Cathy Chan <cathy.chan@nokia.com>
Mon, 26 Nov 2012 15:53:05 -0500
changeset 163 e5a493429528
permissions -rw-r--r--
Multi-touch tests submitted by Nokia
163
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
     1
<!DOCTYPE HTML>
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
     2
<html>
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
     3
<!-- 
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
     4
     Test cases for Touch Events v1 Candiate Recommendation
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
     5
     http://www.w3.org/TR/2011/CR-touch-events-20111215/
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
     6
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
     7
     These tests are based on Mozilla-Nokia-Google's single-touch tests and to some extent Olli Pettay's multi-touch tests. 
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
     8
	 http://w3c-test.org/webevents/tests/touch-events-v1/submissions/Moz-Nok-Goog/single-touch.html
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
     9
     http://w3c-test.org/webevents/tests/touch-events-v1/submissions/Mozilla/multi-touch.html
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    10
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    11
	 The primary purpose of the tests in this document is checking that the various interfaces of the Touch Events APIs are correctly implemented.
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    12
	 Other interactions are covered in other test files.
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    13
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    14
     This document references Test Assertions (abbrev TA below) written by Cathy Chan
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    15
     http://www.w3.org/2010/webevents/wiki/TestAssertions
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    16
-->
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    17
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    18
<head>
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    19
<title>Touch Events Multi-Touch Interface Tests</title>
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    20
<meta name="viewport" content="width=device-width">
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    21
<script src="../../../testharness.js"></script>
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    22
<script>
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    23
    setup({explicit_done: true});
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    24
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    25
    var hasIdentifiedTouch = true;
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    26
    
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    27
    // Check a Touch object's atttributes for existence and correct type
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    28
    // TA: 1.1.2, 1.1.3
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    29
    function check_Touch_object (t) {
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    30
        test(function() {
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    31
           assert_equals(Object.prototype.toString.call(t), "[object Touch]", "touch is of type Touch");
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    32
        }, "touch point is a Touch object");
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    33
        [
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    34
          ["long", "identifier"],
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    35
          ["EventTarget", "target"],
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    36
          ["long", "screenX"],
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    37
          ["long", "screenY"],
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    38
          ["long", "clientX"],
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    39
          ["long", "clientY"],
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    40
          ["long", "pageX"],
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    41
          ["long", "pageY"],
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    42
        ].forEach(function(attr) {
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    43
            var type = attr[0];
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    44
            var name = attr[1];
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    45
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    46
            // existence check
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    47
            test(function() {
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    48
                assert_true(name in t, name + " attribute in Touch object");
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    49
            }, "Touch." + name + " attribute exists");
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    50
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    51
            // type check
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    52
            switch(type) {
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    53
            case "long":
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    54
                test(function() {
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    55
                    assert_equals(typeof t[name], "number", name + " attribute of type long");
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    56
                }, "Touch." + name + " attribute is of type number (long)");
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    57
                break;
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    58
            case "EventTarget":
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    59
                // An event target is some type of Element
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    60
                test(function() {
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    61
                    assert_true(t[name] instanceof Element, "EventTarget must be an Element.");
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    62
                }, "Touch." + name + " attribute is of type Element");
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    63
                break;
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    64
            default:
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    65
                break;
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    66
            }
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    67
       }); 
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    68
    }
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    69
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    70
    // Check a TouchList object's attributes and methods for existence and proper type
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    71
    // Also make sure all of the members of the list are Touch objects
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    72
    // TA: 1.2.1, 1.2.2, 1.2.5, 1.2.6
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    73
    function check_TouchList_object (tl) {
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    74
        test(function() {
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    75
           assert_equals(Object.prototype.toString.call(tl), "[object TouchList]", "touch list is of type TouchList");
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    76
        }, "touch list is a TouchList object");
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    77
		if(hasIdentifiedTouch) {
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    78
			test(function() {
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    79
				// A common failure mode (eg. WebKit bug 96294), don't report multiple errors for it
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    80
				hasIdentifiedTouch = 'identifiedTouch' in tl;
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    81
				assert_true(hasIdentifiedTouch);
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    82
			}, "TouchList contains an identifiedTouch property");
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    83
		}
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    84
        [
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    85
          ["unsigned long", "length"],
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    86
          ["function", "item"],
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    87
          ["function", "identifiedTouch"],
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    88
        ].forEach(function(attr) {
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    89
            var type = attr[0];
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    90
            var name = attr[1];
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    91
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    92
            if (name == "identifiedTouch" && !hasIdentifiedTouch)
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    93
              return;
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    94
              
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    95
            // existence check
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    96
            test(function() {
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    97
                assert_true(name in tl, name + " attribute in TouchList");
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    98
            }, "TouchList." + name + " attribute exists");
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
    99
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   100
            // type check
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   101
            switch(type) {
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   102
            case "unsigned long":
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   103
                test(function() {
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   104
                    assert_equals(typeof tl[name], "number", name + " attribute of type long");
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   105
                }, "TouchList." + name + " attribute is of type number (unsigned long)");
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   106
                break;
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   107
            case "function":
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   108
                test(function() {
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   109
                    assert_equals(typeof tl[name], "function", name + " attribute of type long");
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   110
                }, "TouchList." + name + " attribute is of type function");
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   111
                break;
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   112
            default:
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   113
                break;
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   114
            }
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   115
       }); 
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   116
       // Each member of tl should be a proper Touch object
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   117
       for (var i=0; i < tl.length; i++) {
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   118
           check_Touch_object(tl.item(i));
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   119
       }
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   120
       // identifiedTouch should return the member Touch object with the specified identifier
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   121
	   test(function() {
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   122
		   if (hasIdentifiedTouch) {
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   123
			  for (var i=0; i < tl.length; i++) {
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   124
				  assert_equals(tl.item(i), tl.identifiedTouch(tl.item(i).identifier), "TouchList.identifiedTouch returns the correct item");
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   125
			   }
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   126
		   }
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   127
		}, "TouchList.identifiedTouch returns the correct item");
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   128
    }
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   129
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   130
    // Check a TouchEvent event's attributes for existence and proper type
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   131
    // Also check that each of the event's TouchList objects are valid
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   132
    // TA: 1.{3,4,5}.1.1, 1.{3,4,5}.1.2
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   133
    function check_TouchEvent(ev) {
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   134
        test(function() {
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   135
           assert_true(ev instanceof TouchEvent, "event is a TouchEvent event");
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   136
        }, ev.type + " event is a TouchEvent event");
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   137
        [
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   138
          ["TouchList", "touches"],
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   139
          ["TouchList", "targetTouches"],
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   140
          ["TouchList", "changedTouches"],
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   141
          ["boolean", "altKey"],
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   142
          ["boolean", "metaKey"],
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   143
          ["boolean", "ctrlKey"],
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   144
          ["boolean", "shiftKey"],
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   145
        ].forEach(function(attr) {
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   146
            var type = attr[0];
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   147
            var name = attr[1];
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   148
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   149
            // existence check
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   150
            test(function() {
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   151
                assert_true(name in ev, name + " attribute in " + ev.type + " event");
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   152
            }, ev.type + "." + name + " attribute exists");
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   153
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   154
            // type check
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   155
            switch(type) {
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   156
            case "boolean":
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   157
                test(function() {
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   158
                    assert_equals(typeof ev[name], "boolean", name + " attribute of type boolean");
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   159
                }, ev.type + "." + name + " attribute is of type boolean");
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   160
                break;
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   161
            case "TouchList":
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   162
                test(function() {
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   163
                    assert_equals(Object.prototype.toString.call(ev[name]), "[object TouchList]", name + " attribute of type TouchList");
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   164
                }, ev.type + "." + name + " attribute is of type TouchList");
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   165
                // Now check the validity of the TouchList
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   166
                check_TouchList_object(ev[name]);
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   167
                break;
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   168
            default:
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   169
                break;
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   170
            }
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   171
       }); 
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   172
    }
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   173
    
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   174
    function is_touch_over_element(touch, element) {
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   175
      var bounds = element.getBoundingClientRect();
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   176
      return touch.pageX >= bounds.left && touch.pageX <= bounds.right &&
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   177
          touch.pageY >= bounds.top && touch.pageY <= bounds.bottom;
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   178
    }
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   179
    
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   180
    function check_touch_clientXY(touch) {
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   181
      assert_equals(touch.clientX, touch.pageX - window.pageXOffset, "touch.clientX is touch.pageX - window.pageXOffset.");
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   182
      assert_equals(touch.clientY, touch.pageY - window.pageYOffset, "touch.clientY is touch.pageY - window.pageYOffset.");
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   183
    }
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   184
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   185
    function run() {
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   186
		var target0 = document.getElementById("target0");
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   187
		var target1 = document.getElementById("target1");
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   188
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   189
		var test_touchstart = async_test("touchstart event received");
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   190
		var test_touchmove = async_test("touchmove event received");
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   191
		var test_touchend = async_test("touchend event received");
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   192
		var test_mousedown = async_test("Interaction with mouse events");
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   193
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   194
		var touchstart_received = 0;
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   195
		var touchmove_received = false;
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   196
		var touchend_received = false;
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   197
		var invalid_touchmove_received = false;
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   198
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   199
		on_event(target0, "touchstart", function onTouchStart(ev) {
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   200
			ev.preventDefault();
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   201
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   202
			if(!touchstart_received) {
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   203
				// Check event ordering TA: 1.6.2
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   204
				test_touchstart.step(function() {
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   205
					assert_false(touchmove_received, "touchstart precedes touchmove");
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   206
					assert_false(touchend_received, "touchstart precedes touchend");
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   207
				});
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   208
				test_touchstart.done();
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   209
				test_mousedown.done(); // If we got here, then the mouse event test is not needed.
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   210
			}
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   211
			
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   212
			if(++touchstart_received <= 2)
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   213
				check_TouchEvent(ev);
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   214
		});
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   215
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   216
		on_event(target0, "touchmove", function onTouchMove(ev) {
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   217
			ev.preventDefault();
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   218
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   219
			if (touchmove_received)
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   220
			  return;
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   221
			touchmove_received = true;
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   222
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   223
			test_touchmove.step(function() {
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   224
				assert_true(touchstart_received>0, "touchmove follows touchstart");
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   225
				assert_false(touchend_received, "touchmove precedes touchend");
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   226
			});
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   227
			test_touchmove.done();
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   228
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   229
			check_TouchEvent(ev);
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   230
		});
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   231
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   232
		on_event(target1, "touchmove", function onTouchMove(ev) {
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   233
			invalid_touchmove_received = true;
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   234
		});
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   235
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   236
		on_event(window, "touchend", function onTouchEnd(ev) {
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   237
			touchend_received = true;
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   238
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   239
			test_touchend.step(function() {
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   240
				assert_true(touchstart_received>0, "touchend follows touchstart");
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   241
				assert_true(touchmove_received, "touchend follows touchmove");
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   242
				assert_false(invalid_touchmove_received, "touchmove dispatched to correct target");
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   243
			});
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   244
			test_touchend.done();
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   245
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   246
			check_TouchEvent(ev);
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   247
			done();
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   248
		});
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   249
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   250
		on_event(target0, "mousedown", function onMouseDown(ev) {
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   251
			test_mousedown.step(function() {
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   252
				assert_true(touchstart_received,
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   253
					"The touchstart event must be dispatched before any mouse " +
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   254
					"events. (If this fails, it might mean that the user agent does " +
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   255
					"not implement W3C touch events at all.)"
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   256
				);
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   257
			});
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   258
			test_mousedown.done();
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   259
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   260
			if (!touchstart_received) {
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   261
				// Abort the tests.  If touch events are not supported, then most of
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   262
				// the other event handlers will never be called, and the test will
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   263
				// time out with misleading results.
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   264
				done();
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   265
			}
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   266
		});
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   267
	}
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   268
</script>
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   269
<style>
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   270
	div {
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   271
		margin: 0em;
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   272
		padding: 2em;
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   273
	}
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   274
	#target0 {
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   275
		background: yellow;
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   276
		border: 1px solid orange;
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   277
	}
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   278
	#target1 {
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   279
		background: lightblue;
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   280
		border: 1px solid blue;
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   281
	}
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   282
</style>
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   283
</head>
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   284
<body onload="run()">
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   285
	<h1>Touch Events: multi-touch interface tests</h1>
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   286
	<div id="target0">
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   287
		Touch this box with one finger, then another one...
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   288
	</div>
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   289
	<div id="target1">
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   290
		...then drag to this box and lift your fingers.
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   291
	</div>
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   292
	<div id="log"></div>
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   293
</body>
e5a493429528 Multi-touch tests submitted by Nokia
Cathy Chan <cathy.chan@nokia.com>
parents:
diff changeset
   294
</html>