Skip to content

Commit

Permalink
temp
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhjacobs committed Sep 30, 2024
1 parent f9368d4 commit 8a94ccc
Showing 1 changed file with 24 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ ExternalInterface.objectID: "flash_name"
await browser.execute(
(player) =>
player.callMethodWithDelay("window.RuffleTest.set", true),
await player,
player,
);
const actualValue = await getCalledValue(browser);
expect(actualValue).to.eql([true]);
Expand All @@ -180,15 +180,12 @@ ExternalInterface.objectID: "flash_name"
it.skip("calls a reentrant JS method", async () => {
// JS -> Flash -> JS within one call
const player = await browser.$("ruffle-object");
const actualValue = await browser.execute(
(player) => {
player.callMethodImmediately("window.RuffleTest.set", {
nested: { object: { complex: true } },
});
return window.RuffleTest.get();
},
await player,
);
const actualValue = await browser.execute((player) => {
player.callMethodImmediately("window.RuffleTest.set", {
nested: { object: { complex: true } },
});
return window.RuffleTest.get();
}, player);

expect(actualValue).to.eql({
nested: { object: { complex: true } },
Expand All @@ -215,15 +212,9 @@ ExternalInterface.objectID: "flash_name"
it("calls a reentrant Flash method", async () => {
// Flash -> JS -> Flash within one call
const player = await browser.$("ruffle-object");
await browser.execute(
(player) => {
player.callMethodWithDelay(
"window.RuffleTest.log",
"Reentrant!",
);
},
await player,
);
await browser.execute((player) => {
player.callMethodWithDelay("window.RuffleTest.log", "Reentrant!");
}, player);

// [NA] Because of the delay, if we fetch immediately we *may* just get part of the log.
await browser.pause(200);
Expand All @@ -246,15 +237,12 @@ log called with 1 argument

it("supports a JS function as name", async () => {
const player = await browser.$("ruffle-object");
await browser.execute(
(player) => {
player.callMethodWithDelay(
"function(name){window.RuffleTest.set(name)}",
"test",
);
},
await player,
);
await browser.execute((player) => {
player.callMethodWithDelay(
"function(name){window.RuffleTest.set(name)}",
"test",
);
}, player);

// [NA] Because of the delay, if we fetch immediately we *may* just get part of the log.
await browser.pause(200);
Expand All @@ -276,12 +264,9 @@ log called with 1 argument

it("supports calling a method that doesn't exist", async () => {
const player = await browser.$("ruffle-object");
await browser.execute(
(player) => {
player.callMethodWithDelay("does.not.exist");
},
await player,
);
await browser.execute((player) => {
player.callMethodWithDelay("does.not.exist");
}, player);

// [NA] Because of the delay, if we fetch immediately we *may* just get part of the log.
await browser.pause(200);
Expand All @@ -299,14 +284,11 @@ log called with 1 argument

it("doesn't enforce Strict Mode", async () => {
const player = await browser.$("ruffle-object");
await browser.execute(
(player) => {
player.callMethodWithDelay(
"function(){return aPropertyThatDoesntExist = 'success!'}",
);
},
await player,
);
await browser.execute((player) => {
player.callMethodWithDelay(
"function(){return aPropertyThatDoesntExist = 'success!'}",
);
}, player);

// [NA] Because of the delay, if we fetch immediately we *may* just get part of the log.
await browser.pause(200);
Expand Down

0 comments on commit 8a94ccc

Please sign in to comment.