Skip to content

Commit

Permalink
web: Specify polyfill/ path specifically, so it can be other paths later
Browse files Browse the repository at this point in the history
  • Loading branch information
Dinnerbone committed May 28, 2024
1 parent de36fc2 commit dda7411
Show file tree
Hide file tree
Showing 40 changed files with 41 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use(chaiHtml);

describe("Flash inside frame with injected ruffle", () => {
it("loads the test", async () => {
await openTest(browser, import.meta.dirname);
await openTest(browser, `polyfill/classic_frames_injected`);
});

it("polyfills inside a frame", async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use(chaiHtml);

describe("Flash inside frame with provided ruffle", () => {
it("loads the test", async () => {
await openTest(browser, import.meta.dirname);
await openTest(browser, `polyfill/classic_frames_provided`);
});

it("polyfills inside a frame", async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use(chaiHtml);
// [NA] Disabled for now as the test can take too long on CI
describe.skip("Doesn't error with cross-origin frames", () => {
it("Loads the test", async () => {
await openTest(browser, import.meta.dirname);
await openTest(browser, `polyfill/crossorigin_broken_cors`);
});

it("Polyfills with ruffle", async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use(chaiHtml);

describe("Embed tag", () => {
it("loads the test", async () => {
await openTest(browser, import.meta.dirname);
await openTest(browser, `polyfill/embed_default`);
});

it("polyfills with ruffle", async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use(chaiHtml);

describe("Embed with case-insensitive MIME type", () => {
it("loads the test", async () => {
await openTest(browser, import.meta.dirname);
await openTest(browser, `polyfill/embed_insensitive`);
});

it("Polyfills", async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use(chaiHtml);

describe("Embed inside audio node", () => {
it("loads the test", async () => {
await openTest(browser, import.meta.dirname);
await openTest(browser, `polyfill/embed_inside_audio`);
});

it("doesn't polyfill with ruffle", async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use(chaiHtml);

describe("Embed without src attribute", () => {
it("loads the test", async () => {
await openTest(browser, import.meta.dirname);
await openTest(browser, `polyfill/embed_missing_src`);
});

it("doesn't polyfill with ruffle", async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use(chaiHtml);

describe("Embed without type attribute", () => {
it("loads the test", async () => {
await openTest(browser, import.meta.dirname);
await openTest(browser, `polyfill/embed_missing_type`);
});

it("polyfills with ruffle", async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use(chaiHtml);

describe("Embed with unexpected string", () => {
it("loads the test", async () => {
await openTest(browser, import.meta.dirname);
await openTest(browser, `polyfill/embed_unexpected_string`);
});

it("polyfills with ruffle", async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use(chaiHtml);

describe("Embed with wrong type attribute value", () => {
it("loads the test", async () => {
await openTest(browser, import.meta.dirname);
await openTest(browser, `polyfill/embed_wrong_type`);
});

it("polyfills with ruffle", async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use(chaiHtml);

describe("Embed with Flash YouTube video", () => {
it("loads the test", async () => {
await openTest(browser, import.meta.dirname);
await openTest(browser, `polyfill/embed_youtube`);
});

it("doesn't polyfill with ruffle", async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use(chaiHtml);

describe("Flash inside iframe with injected ruffle", () => {
it("loads the test", async () => {
await openTest(browser, import.meta.dirname);
await openTest(browser, `polyfill/iframes_injected`);
});

it("polyfills inside an iframe", async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use(chaiHtml);

describe("iframe onload", () => {
it("loads the test", async () => {
await openTest(browser, import.meta.dirname);
await openTest(browser, `polyfill/iframes_onload`);
});

it("runs the iframe onload event", async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use(chaiHtml);

describe("Flash inside iframe with provided ruffle", () => {
it("loads the test", async () => {
await openTest(browser, import.meta.dirname);
await openTest(browser, `polyfill/iframes_provided`);
});

it("polyfills inside an iframe", async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use(chaiHtml);

describe("Object with case-insensitive MIME type", () => {
it("loads the test", async () => {
await openTest(browser, import.meta.dirname);
await openTest(browser, `polyfill/object_MIME_insensitive`);
});

it("Polyfills", async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use(chaiHtml);

describe("Object with case-insensitive clsid", () => {
it("loads the test", async () => {
await openTest(browser, import.meta.dirname);
await openTest(browser, `polyfill/object_clsid_insensitive`);
});

it("Polyfills", async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use(chaiHtml);

describe("Object with clsid and embed", () => {
it("loads the test", async () => {
await openTest(browser, import.meta.dirname);
await openTest(browser, `polyfill/object_clsid_with_embed`);
});

it("polyfills with ruffle", async () => {
Expand Down
2 changes: 1 addition & 1 deletion web/packages/selfhosted/test/polyfill/object_data/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use(chaiHtml);

describe("Object with only data attribute", () => {
it("loads the test", async () => {
await openTest(browser, import.meta.dirname);
await openTest(browser, `polyfill/object_data`);
});

it("Polyfills", async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use(chaiHtml);

describe("Object tag", () => {
it("loads the test", async () => {
await openTest(browser, import.meta.dirname);
await openTest(browser, `polyfill/object_default`);
});

it("polyfills with ruffle", async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use(chaiHtml);

describe("Object with another object tag", () => {
it("loads the test", async () => {
await openTest(browser, import.meta.dirname);
await openTest(browser, `polyfill/object_double_object`);
});

it("polyfills only the first tag with ruffle", async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use(chaiHtml);

describe("Object using classid with another object tag without classid", () => {
it("loads the test", async () => {
await openTest(browser, import.meta.dirname);
await openTest(browser, `polyfill/object_double_object_classid`);
});

it("polyfills only the second tag with ruffle", async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use(chaiHtml);

describe("Object tag", () => {
it("loads the test", async () => {
await openTest(browser, import.meta.dirname);
await openTest(browser, `polyfill/object_flashvars`);
});

it("polyfills with ruffle", async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use(chaiHtml);

describe("Object tag", () => {
it("loads the test", async () => {
await openTest(browser, import.meta.dirname);
await openTest(browser, `polyfill/object_flashvars_in_url`);
});

it("polyfills with ruffle", async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use(chaiHtml);

describe("Object for old IE must work everywhere", () => {
it("loads the test", async () => {
await openTest(browser, import.meta.dirname);
await openTest(browser, `polyfill/object_ie_only`);
});

it("polyfills with ruffle", async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use(chaiHtml);

describe("Object inside audio node", () => {
it("loads the test", async () => {
await openTest(browser, import.meta.dirname);
await openTest(browser, `polyfill/object_inside_audio`);
});

it("doesn't polyfill with ruffle", async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use(chaiHtml);

describe("Object without data attribute", () => {
it("loads the test", async () => {
await openTest(browser, import.meta.dirname);
await openTest(browser, `polyfill/object_missing_data`);
});

it("doesn't polyfill with ruffle", async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use(chaiHtml);

describe("Object without type attribute", () => {
it("loads the test", async () => {
await openTest(browser, import.meta.dirname);
await openTest(browser, `polyfill/object_missing_type`);
});

it("polyfills with ruffle", async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use(chaiHtml);

describe("Object without type and classid attributes", () => {
it("loads the test", async () => {
await openTest(browser, import.meta.dirname);
await openTest(browser, `polyfill/object_missing_type_and_classid`);
});

it("polyfills with ruffle", async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use(chaiHtml);

describe("Object with unexpected string", () => {
it("loads the test", async () => {
await openTest(browser, import.meta.dirname);
await openTest(browser, `polyfill/object_unexpected_string`);
});

it("polyfills with ruffle", async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use(chaiHtml);

describe("Object with ruffle-embed tag", () => {
it("loads the test", async () => {
await openTest(browser, import.meta.dirname);
await openTest(browser, `polyfill/object_with_ruffle_embed`);
});

it("already polyfilled with ruffle", async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use(chaiHtml);

describe("Object with wrong type attribute value", () => {
it("loads the test", async () => {
await openTest(browser, import.meta.dirname);
await openTest(browser, `polyfill/object_wrong_type`);
});

it("polyfills with ruffle", async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use(chaiHtml);

describe("Object with Flash YouTube video", () => {
it("loads the test", async () => {
await openTest(browser, import.meta.dirname);
await openTest(browser, `polyfill/object_youtube`);
});

it("doesn't polyfill with ruffle", async () => {
Expand Down
2 changes: 1 addition & 1 deletion web/packages/selfhosted/test/polyfill/pdf/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use(chaiHtml);

describe("PDF object", () => {
it("loads the test", async () => {
await openTest(browser, import.meta.dirname);
await openTest(browser, `polyfill/pdf`);
});

it("doesn't polyfill with ruffle", async () => {
Expand Down
2 changes: 1 addition & 1 deletion web/packages/selfhosted/test/polyfill/pdf_with_get/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use(chaiHtml);

describe("PDF with .swf GET", () => {
it("loads the test", async () => {
await openTest(browser, import.meta.dirname);
await openTest(browser, `polyfill/pdf_with_get`);
});

it("doesn't polyfill with ruffle", async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use(chaiHtml);

describe("Remove object", () => {
it("loads the test", async () => {
await openTest(browser, import.meta.dirname);
await openTest(browser, `polyfill/remove_object`);
});

it("polyfills with ruffle", async () => {
Expand Down
2 changes: 1 addition & 1 deletion web/packages/selfhosted/test/polyfill/spl/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use(chaiHtml);

describe("SPL", () => {
it("loads the test", async () => {
await openTest(browser, import.meta.dirname);
await openTest(browser, `polyfill/spl`);
});

it("polyfills with ruffle", async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use(chaiHtml);

describe("SWF extension insensitive", () => {
it("loads the test", async () => {
await openTest(browser, import.meta.dirname);
await openTest(browser, `polyfill/swf_extension_insensitive`);
});

it("Polyfills", async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use(chaiHtml);

describe("SWF extension, file with fragment", () => {
it("loads the test", async () => {
await openTest(browser, import.meta.dirname);
await openTest(browser, `polyfill/swf_extension_with_fragment`);
});

it("Polyfills", async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use(chaiHtml);

describe("SWF extension, file with GET parameter", () => {
it("loads the test", async () => {
await openTest(browser, import.meta.dirname);
await openTest(browser, `polyfill/swf_extension_with_get`);
});

it("Polyfills", async () => {
Expand Down
8 changes: 2 additions & 6 deletions web/packages/selfhosted/test/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import path from "path";
import { expect } from "chai";
import { PublicAPI, RufflePlayer } from "ruffle-core";

Expand Down Expand Up @@ -132,13 +131,10 @@ export async function injectRuffleAndWait(browser: WebdriverIO.Browser) {

export async function openTest(
browser: WebdriverIO.Browser,
absoluteDir: string,
directory: string,
filename: string = "index.html",
) {
const dirname = path.basename(absoluteDir);
await browser.url(
`http://localhost:4567/test/polyfill/${dirname}/${filename}`,
);
await browser.url(`http://localhost:4567/test/${directory}/${filename}`);
}

/** Test set-up for JS API testing. */
Expand Down

0 comments on commit dda7411

Please sign in to comment.