tests: Add YouTube Flash embed/object tests

This commit is contained in:
Daniel Jacobs 2022-04-03 18:32:57 -04:00 committed by Mike Welsh
parent 958b4e7291
commit 7cae84b354
6 changed files with 88 additions and 0 deletions

View File

@ -0,0 +1,5 @@
<embed
src="https://www.youtube.com/v/CquvDLrjgYU?version=3"
width="350"
height="289"
/>

View File

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>EMBED - YOUTUBE</title>
</head>
<body>
<div id="test-container">
<embed
src="https://www.youtube.com/v/CquvDLrjgYU?version=3"
width="350"
height="289"
/>
</div>
</body>
</html>

View File

@ -0,0 +1,19 @@
const { open_test, inject_ruffle_and_wait } = require("../../utils");
const { expect, use } = require("chai");
const chaiHtml = require("chai-html");
const fs = require("fs");
use(chaiHtml);
describe("Embed with Flash YouTube video", () => {
it("loads the test", async () => {
await open_test(browser, __dirname);
});
it("doesn't polyfill with ruffle", async () => {
await inject_ruffle_and_wait(browser);
const actual = await browser.$("#test-container").getHTML(false);
const expected = fs.readFileSync(`${__dirname}/expected.html`, "utf8");
expect(actual).html.to.equal(expected);
});
});

View File

@ -0,0 +1,8 @@
<object
type="application/x-shockwave-flash"
data="https://www.youtube.com/v/ENumi96Btj0"
width="425"
height="350"
>
<param name="movie" value="https://www.youtube.com/v/ENumi96Btj0"/>
</object>

View File

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>OBJECT - YOUTUBE</title>
</head>
<body>
<div id="test-container">
<object
type="application/x-shockwave-flash"
data="https://www.youtube.com/v/ENumi96Btj0"
width="425"
height="350"
>
<param name="movie" value="https://www.youtube.com/v/ENumi96Btj0"/>
</object>
</div>
</body>
</html>

View File

@ -0,0 +1,19 @@
const { open_test, inject_ruffle_and_wait } = require("../../utils");
const { expect, use } = require("chai");
const chaiHtml = require("chai-html");
const fs = require("fs");
use(chaiHtml);
describe("Object with Flash YouTube video", () => {
it("loads the test", async () => {
await open_test(browser, __dirname);
});
it("doesn't polyfill with ruffle", async () => {
await inject_ruffle_and_wait(browser);
const actual = await browser.$("#test-container").getHTML(false);
const expected = fs.readFileSync(`${__dirname}/expected.html`, "utf8");
expect(actual).html.to.equal(expected);
});
});