mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-25 02:40:22 -10:00
Automatic update from web-platform-tests Roll WebGPU CTS Change-Id: I568496f29b5bd4c0f202142003ad3f1794663582 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1890020 Reviewed-by: Austin Eng <[email protected]> Commit-Queue: Kai Ninomiya <[email protected]> Cr-Commit-Position: refs/heads/master@{#711085} -- wpt-commits: df3e1cc0af3fbe32569f11d102be0330f12ec1a3 wpt-pr: 20008 Differential Revision: https://phabricator.services.mozilla.com/D53577
60 lines
1.4 KiB
JavaScript
60 lines
1.4 KiB
JavaScript
/**
|
|
* AUTO-GENERATED - DO NOT EDIT. Source: https://github.com/gpuweb/cts
|
|
**/
|
|
|
|
export function encodeSelectively(s) {
|
|
let ret = encodeURIComponent(s);
|
|
ret = ret.replace(/%22/g, '"');
|
|
ret = ret.replace(/%2C/g, ',');
|
|
ret = ret.replace(/%2F/g, '/');
|
|
ret = ret.replace(/%3A/g, ':');
|
|
ret = ret.replace(/%3D/g, '=');
|
|
ret = ret.replace(/%5B/g, '[');
|
|
ret = ret.replace(/%5D/g, ']');
|
|
ret = ret.replace(/%7B/g, '{');
|
|
ret = ret.replace(/%7D/g, '}');
|
|
return ret;
|
|
}
|
|
export function extractPublicParams(params) {
|
|
const publicParams = {};
|
|
|
|
for (const k of Object.keys(params)) {
|
|
if (!k.startsWith('_')) {
|
|
publicParams[k] = params[k];
|
|
}
|
|
}
|
|
|
|
return publicParams;
|
|
}
|
|
export function checkPublicParamType(v) {
|
|
if (typeof v === 'number' || typeof v === 'string' || typeof v === 'boolean' || v === undefined) {
|
|
return;
|
|
}
|
|
|
|
if (v instanceof Array) {
|
|
for (const x of v) {
|
|
if (typeof x !== 'number') {
|
|
break;
|
|
}
|
|
}
|
|
|
|
return;
|
|
}
|
|
|
|
throw new Error('Invalid type for test case params ' + v);
|
|
}
|
|
export function makeQueryString(spec, testcase) {
|
|
let s = spec.suite + ':';
|
|
s += spec.path + ':';
|
|
|
|
if (testcase !== undefined) {
|
|
s += testcase.test + '=';
|
|
|
|
if (testcase.params) {
|
|
s += JSON.stringify(extractPublicParams(testcase.params));
|
|
}
|
|
}
|
|
|
|
return encodeSelectively(s);
|
|
}
|
|
//# sourceMappingURL=url_query.js.map
|