Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions custom/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2256,7 +2256,7 @@ api:
}
return bcd.testOptionParam(createContext, null, 'willReadFrequently', true);
webgpu_context: |-
bcd.skipIf('safari', '16.5', 'Creating a WebGPU context on Safari 16.5 crashes the browser');
bcd.skipIf('Creating a WebGPU context on Safari 16.5 crashes the browser', 'safari', '16.5');

if (!(instance && instance.getContext)) {
return {result: false, message: 'instance.getContext is not defined'};
Expand Down Expand Up @@ -3919,7 +3919,7 @@ api:
var instance = reusableInstances.audioContext.createScriptProcessor();
SecurityPolicyViolationEvent:
__base: |-
bcd.skipIf('edge', '15', 'Constructing this event causes the page to reload');
bcd.skipIf('Constructing this event causes the page to reload', 'edge', '15');

if (!('SecurityPolicyViolationEvent' in self)) {
return {result: false, message: 'SecurityPolicyViolationEvent is not defined'};
Expand Down
22 changes: 10 additions & 12 deletions static/resources/harness.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,23 +208,21 @@
/**
* Skips the test by throwing an error if the browser (and possibly version) matches
* Avoid using this if possible
* @param {string?} reason - The reason for skipping
* @param {string} browserName - The name of the browser to skip
* @param {string?} browserVersion - The browser version to skip, if needed
* @param {string?} reason - The reason for skipping
*/
function skipIf(browserName, browserVersion, reason) {
if (!browserName) {
return;
}

if (browserName !== browser.name) {
return;
}

if (browserVersion) {
if (browserVersion !== browser.version) {
function skipIf(reason, browserName, browserVersion) {
if (browserName) {
if (browserName !== browser.name) {
return;
}

if (browserVersion) {
if (browserVersion !== browser.version) {
return;
}
}
}

throw new Error(
Expand Down