Debian Codegraph @

js/src/tests/test262/built-ins/Atomics/wait/negative-timeout.js

raw
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) 2017 Mozilla Corporation. 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, SharedArrayBuffer, TypedArray]
10 flags: [CanBlockIsTrue]
11 ---*/
12
13 const i32a = new Int32Array(
14 new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4)
15 );
16
17 assert.sameValue(
18 Atomics.wait(i32a, 0, 0, -1),
19 "timed-out",
20 'Atomics.wait(i32a, 0, 0, -1) returns "timed-out"'
21 );
22
23 reportCompare(0, 0);