Add a runtime-disabled dialog element skeleton
[WebKit-https.git] / LayoutTests / webgpu / whlsl / struct.html
1 <!DOCTYPE html>
2 <html>
3 <meta charset=utf-8>
4 <meta name="timeout" content="long">
5 <title>Test structs.</title>
6 <script src="js/test-harness.js"></script>
7 <script src="../js/webgpu-functions.js"></script>
8 <script src="../../resources/testharness.js"></script>
9 <script src="../../resources/testharnessreport.js"></script>
10 <script>
11 const whlslTests = {};
12
13 whlslTests.emptyStruct = async () =>
14 {
15     let program = `
16         struct Thingy { }
17         int foo()
18         {
19             Thingy thingy;
20             return 46;
21         }
22     `;
23     assert_equals(await callIntFunction(program, "foo", []), 46);
24 };
25
26 whlslTests.settingAnArrayInsideAStruct = async () =>
27 {
28     let program = `
29         struct Foo {
30             int[1] array;
31         }
32         int foo()
33         {
34             Foo foo;
35             thread Foo* bar = &foo;
36             bar->array[0] = 21;
37             return foo.array[0];
38         }
39     `;
40     assert_equals(await callIntFunction(program, "foo", []), 21);
41 };
42
43 runTests(whlslTests);
44 </script>
45 </html>