11cb0ef41Sopenharmony_ci<!DOCTYPE html> 21cb0ef41Sopenharmony_ci 31cb0ef41Sopenharmony_ci<script src="/resources/testharness.js"></script> 41cb0ef41Sopenharmony_ci<script src="/resources/testharnessreport.js"></script> 51cb0ef41Sopenharmony_ci<script type="text/javascript"> 61cb0ef41Sopenharmony_ci'use strict'; 71cb0ef41Sopenharmony_cifor (let eventType of ["GamepadEvent"]) { 81cb0ef41Sopenharmony_ci test(function() { 91cb0ef41Sopenharmony_ci let before = performance.now(); 101cb0ef41Sopenharmony_ci let e = new window[eventType]('test'); 111cb0ef41Sopenharmony_ci let after = performance.now(); 121cb0ef41Sopenharmony_ci assert_greater_than_equal(e.timeStamp, before, "Event timestamp should be greater than performance.now() timestamp taken before its creation"); 131cb0ef41Sopenharmony_ci assert_less_than_equal(e.timeStamp, after, "Event timestamp should be less than performance.now() timestamp taken after its creation"); 141cb0ef41Sopenharmony_ci }, `Constructed ${eventType} timestamp should be high resolution and have the same time origin as performance.now()`); 151cb0ef41Sopenharmony_ci} 161cb0ef41Sopenharmony_ci</script> 17