tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

event-counts-zero.html (1500B)


      1 <!DOCTYPE html>
      2 <html>
      3 <meta charset=utf-8 />
      4 <title>Event Timing: eventCounts.</title>
      5 <script src=/resources/testharness.js></script>
      6 <script src=/resources/testharnessreport.js></script>
      7 <script src=/resources/testdriver.js></script>
      8 <script src=/resources/testdriver-vendor.js></script>
      9 <script>
     10  test(() => {
     11    assert_implements(window.EventCounts, "Event Counts isn't supported");
     12    const eventTypes = [
     13        'auxclick',
     14        'click',
     15        'contextmenu',
     16        'dblclick',
     17        'mousedown',
     18        'mouseenter',
     19        'mouseleave',
     20        'mouseout',
     21        'mouseover',
     22        'mouseup',
     23        'pointerover',
     24        'pointerenter',
     25        'pointerdown',
     26        'pointerup',
     27        'pointercancel',
     28        'pointerout',
     29        'pointerleave',
     30        'gotpointercapture',
     31        'lostpointercapture',
     32        'touchstart',
     33        'touchend',
     34        'touchcancel',
     35        'keydown',
     36        'keypress',
     37        'keyup',
     38        'beforeinput',
     39        'input',
     40        'compositionstart',
     41        'compositionupdate',
     42        'compositionend',
     43        'dragstart',
     44        'dragend',
     45        'dragenter',
     46        'dragleave',
     47        'dragover',
     48        'drop'
     49    ];
     50    eventTypes.forEach(type => {
     51      assert_equals(performance.eventCounts.get(type), 0, 'There is a nonzero value for ' + type);
     52    })
     53    assert_equals(performance.eventCounts.size, eventTypes.length,
     54        'The size of performance.eventCounts is incorrect.');
     55  })
     56 </script>
     57 </html>