Skip to content

Commit 101dd3b

Browse files
authored
fix(test): make video test pass on Mac (#3121)
1 parent 97c1000 commit 101dd3b

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

test/capabilities.jest.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
* limitations under the License.
1515
*/
1616

17-
const {FFOX, CHROMIUM, WEBKIT, WIN, LINUX} = testOptions;
17+
const path = require('path');
18+
19+
const {FFOX, CHROMIUM, WEBKIT, WIN, LINUX, ASSETS_DIR} = testOptions;
1820

1921
describe('Capabilities', function() {
2022
it.fail(WEBKIT && WIN)('Web Assembly should work', async function({page, server}) {
@@ -47,8 +49,16 @@ describe('Capabilities', function() {
4749
await page.goto(server.EMPTY_PAGE);
4850
expect(await page.evaluate(() => window.testStatus)).toBe('SUCCESS');
4951
});
50-
it.fail(WEBKIT && !LINUX)('should play video', async({page, server}) => {
51-
await page.goto(server.PREFIX + '/video.html');
52+
it.fail(WEBKIT && WIN)('should play video', async({page}) => {
53+
// TODO: the test passes on Windows locally but fails on GitHub Action bot,
54+
// apparently due to a Media Pack issue in the Windows Server.
55+
//
56+
// Our test server doesn't support range requests required to play on Mac,
57+
// so we load the page using a file url.
58+
const url = WIN
59+
? 'file:///' + path.join(ASSETS_DIR, 'video.html').replace(/\\/g, '/')
60+
: 'file://' + path.join(ASSETS_DIR, 'video.html');
61+
await page.goto(url);
5262
await page.$eval('video', v => v.play());
5363
await page.$eval('video', v => v.pause());
5464
});

0 commit comments

Comments
 (0)