negative-timeout.js (904B)
1 // |reftest| skip-if(!xulRuntime.shell||!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration('arm64-simulator'))) -- browser cannot block main thread, Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics 2 // Copyright (C) 2018 Rick Waldron. All rights reserved. 3 // This code is governed by the BSD license found in the LICENSE file. 4 5 /*--- 6 esid: sec-atomics.wait 7 description: > 8 Test that Atomics.wait times out with a negative timeout 9 features: [Atomics, BigInt, SharedArrayBuffer, TypedArray] 10 flags: [CanBlockIsTrue] 11 ---*/ 12 13 const i64a = new BigInt64Array( 14 new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 4) 15 ); 16 17 assert.sameValue( 18 Atomics.wait(i64a, 0, 0n, -1), 19 "timed-out", 20 'Atomics.wait(i64a, 0, 0n, -1) returns "timed-out"' 21 ); 22 23 reportCompare(0, 0);