Skip to content

Commit 4cb5214

Browse files
test(capabilities): add tests for webgl (#4343)
1 parent 283bc2c commit 4cb5214

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

test/capabilities.spec.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,24 @@ it('should play video', (test, { browserName, platform }) => {
6868
await page.$eval('video', v => v.play());
6969
await page.$eval('video', v => v.pause());
7070
});
71+
72+
it('should support webgl', (test, {browserName, headful}) => {
73+
test.fixme(browserName === 'firefox' && !headful);
74+
}, async ({page}) => {
75+
const hasWebGL2 = await page.evaluate(() => {
76+
const canvas = document.createElement('canvas');
77+
return !!canvas.getContext('webgl');
78+
});
79+
expect(hasWebGL2).toBe(true);
80+
});
81+
82+
it('should support webgl 2', (test, {browserName, headful}) => {
83+
test.skip(browserName === 'webkit', 'Webkit doesn\'t have webgl2 enabled yet upstream.');
84+
test.fixme(browserName === 'firefox' && !headful);
85+
}, async ({page}) => {
86+
const hasWebGL2 = await page.evaluate(() => {
87+
const canvas = document.createElement('canvas');
88+
return !!canvas.getContext('webgl2');
89+
});
90+
expect(hasWebGL2).toBe(true);
91+
});

0 commit comments

Comments
 (0)