Skip to content

Commit

Permalink
Fix broken wasm web platform test
Browse files Browse the repository at this point in the history
This addresses a problem for the failing tests surrounding WASM Memory
and table constructors. The type reflection feature added a minimum
parameter which is enabled on nightly but not beta and relese. This
fixes the expectations so they it's expected they fail in those
situations.

It also addresses a problem in a failing test which always passed due to
a missing new keyword.

Differential Revision: https://phabricator.services.mozilla.com/D91152

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1666481
gecko-commit: f9d65fd50034f350383b14c02ff12373352bd991
gecko-reviewers: lth
  • Loading branch information
Jessica Tallon authored and moz-wptsync-bot committed Sep 24, 2020
1 parent f0d83d8 commit c9af305
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions wasm/jsapi/memory/constructor-types.tentative.any.js
@@ -1,4 +1,4 @@
// META: global=jsshell
// META: global=window,dedicatedworker,jsshell
// META: script=/wasm/jsapi/assertions.js
// META: script=/wasm/jsapi/memory/assertions.js

Expand All @@ -13,7 +13,7 @@ test(() => {
assert_Memory(memory, { "size": 0 });
}, "Zero minimum");

test(() => {
test(() => {
const argument = { minimum: 4 };
const memory = new WebAssembly.Memory(argument);
assert_Memory(memory, { "size": 4 });
Expand Down
2 changes: 1 addition & 1 deletion wasm/jsapi/memory/constructor.any.js
Expand Up @@ -76,7 +76,7 @@ test(() => {
switch (x) {
case "shared":
return false;
case "minimum":
case "initial":
case "maximum":
return 0;
default:
Expand Down
10 changes: 5 additions & 5 deletions wasm/jsapi/table/constructor-types.tentative.any.js
@@ -1,20 +1,20 @@
// META: global=jsshell
// META: global=window,dedicatedworker,jsshell
// META: script=/wasm/jsapi/assertions.js
// META: script=/wasm/jsapi/table/assertions.js

test(() => {
const argument = { "element": "anyfunc", "initial": 0, "minimum": 0 };
assert_throws_js(TypeError, () => WebAssembly.Table(argument));
}, "Supplying both initial and minimum");
assert_throws_js(TypeError, () => new WebAssembly.Table(argument));
}, "Initializing with both initial and minimum");

test(() => {
const argument = { "element": "anyfunc", "minimum": 0 };
const table = new WebAssembly.Table(argument);
assert_Table(table, { "length": 0 });
}, "Basic (zero, minimum)");
}, "Zero minimum");

test(() => {
const argument = { "element": "anyfunc", "minimum": 5 };
const table = new WebAssembly.Table(argument);
assert_Table(table, { "length": 5 });
}, "Basic (non-zero, minimum)");
}, "Non-zero minimum");

0 comments on commit c9af305

Please sign in to comment.