idlharness.any.js (866B)
1 // META: global=window,worker,shadowrealm-in-window 2 // META: script=/resources/WebIDLParser.js 3 // META: script=/resources/idlharness.js 4 // META: timeout=long 5 6 // https://w3c.github.io/user-timing/ 7 8 'use strict'; 9 10 idl_test( 11 ['user-timing'], 12 ['hr-time', 'performance-timeline', 'dom'], 13 idl_array => { 14 if (self.GLOBAL.isShadowRealm()) { 15 return; 16 } 17 18 try { 19 performance.mark('test'); 20 performance.measure('test'); 21 for (const m of performance.getEntriesByType('mark')) { 22 self.mark = m; 23 } 24 for (const m of performance.getEntriesByType('measure')) { 25 self.measure = m; 26 } 27 } catch (e) { 28 // Will be surfaced when mark is undefined below. 29 } 30 31 idl_array.add_objects({ 32 Performance: ['performance'], 33 PerformanceMark: ['mark'], 34 PerformanceMeasure: ['measure'], 35 }); 36 } 37 );