ruffle/web/packages/selfhosted/test/js_api/metadata.js

28 lines
759 B
JavaScript
Raw Normal View History

2023-05-30 20:24:43 +00:00
const { jsApiBefore } = require("../utils");
const { expect, use } = require("chai");
const chaiHtml = require("chai-html");
use(chaiHtml);
describe("RufflePlayer.metadata", () => {
2023-05-30 20:24:43 +00:00
jsApiBefore("/test_assets/example.swf");
it("has metadata after load", async () => {
const player = await browser.$("<ruffle-player>");
const metadata = await browser.execute(
(player) => player.metadata,
2023-07-20 11:19:39 +00:00
player,
);
expect(metadata).to.eql({
width: 550,
height: 400,
frameRate: 24,
numFrames: 1,
swfVersion: 15,
isActionScript3: false,
backgroundColor: "#FF0000",
uncompressedLength: 1450,
});
});
});