2020-10-11 18:44:25 +00:00
|
|
|
const {
|
|
|
|
inject_ruffle_and_wait,
|
|
|
|
open_test,
|
|
|
|
play_and_monitor,
|
2021-04-21 23:48:50 +00:00
|
|
|
} = require("../../utils");
|
2020-10-11 18:44:25 +00:00
|
|
|
const { expect, use } = require("chai");
|
|
|
|
const chaiHtml = require("chai-html");
|
|
|
|
const fs = require("fs");
|
|
|
|
|
|
|
|
use(chaiHtml);
|
|
|
|
|
|
|
|
describe("Object tag", () => {
|
2021-08-21 14:34:08 +00:00
|
|
|
it("loads the test", async () => {
|
|
|
|
await open_test(browser, __dirname);
|
2020-10-11 18:44:25 +00:00
|
|
|
});
|
|
|
|
|
2021-08-21 14:34:08 +00:00
|
|
|
it("polyfills with ruffle", async () => {
|
|
|
|
await inject_ruffle_and_wait(browser);
|
|
|
|
const actual = await browser.$("#test-container").getHTML(false);
|
2020-10-11 18:44:25 +00:00
|
|
|
const expected = fs.readFileSync(`${__dirname}/expected.html`, "utf8");
|
|
|
|
expect(actual).html.to.equal(expected);
|
|
|
|
});
|
|
|
|
|
2021-08-21 14:34:08 +00:00
|
|
|
it("Plays a movie with flashvars", async () => {
|
|
|
|
await play_and_monitor(
|
2020-10-11 18:44:25 +00:00
|
|
|
browser,
|
2021-08-21 14:34:08 +00:00
|
|
|
await browser.$("#test-container").$("<ruffle-embed />"),
|
2020-10-11 18:44:25 +00:00
|
|
|
`// _level0.a
|
|
|
|
1
|
|
|
|
|
|
|
|
// typeof(a)
|
|
|
|
string
|
|
|
|
|
|
|
|
// _level0.b
|
|
|
|
3 %3
|
|
|
|
|
|
|
|
// typeof(b)
|
|
|
|
string
|
|
|
|
|
|
|
|
// _level0.c
|
|
|
|
|
|
|
|
|
|
|
|
// typeof(c)
|
|
|
|
string
|
|
|
|
|
|
|
|
// _level0.d
|
|
|
|
undefined
|
|
|
|
|
|
|
|
// typeof(d)
|
|
|
|
undefined
|
|
|
|
|
|
|
|
`
|
|
|
|
);
|
|
|
|
});
|
|
|
|
});
|