mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Update web-platform-tests to revision 82b73b315ce7ed1554e7a9b7bced66a5831e4ee5
This commit is contained in:
parent
00a9f30773
commit
76712d7d25
353 changed files with 6528 additions and 1307 deletions
52
tests/wpt/web-platform-tests/webgpu/framework/loader.js
Normal file
52
tests/wpt/web-platform-tests/webgpu/framework/loader.js
Normal file
|
@ -0,0 +1,52 @@
|
|||
/**
|
||||
* AUTO-GENERATED - DO NOT EDIT. Source: https://github.com/gpuweb/cts
|
||||
**/
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
import { loadFilter } from './test_filter/index.js';
|
||||
|
||||
function* concat(lists) {
|
||||
for (const specs of lists) {
|
||||
yield* specs;
|
||||
}
|
||||
}
|
||||
|
||||
class DefaultTestFileLoader {
|
||||
async listing(suite) {
|
||||
return (await import(`../suites/${suite}/index.js`)).listing;
|
||||
}
|
||||
|
||||
import(path) {
|
||||
return import('../suites/' + path);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export class TestLoader {
|
||||
constructor(fileLoader = new DefaultTestFileLoader()) {
|
||||
_defineProperty(this, "fileLoader", void 0);
|
||||
|
||||
this.fileLoader = fileLoader;
|
||||
} // TODO: Test
|
||||
|
||||
|
||||
async loadTestsFromQuery(query) {
|
||||
return this.loadTests(new URLSearchParams(query).getAll('q'));
|
||||
} // TODO: Test
|
||||
// TODO: Probably should actually not exist at all, just use queries on cmd line too.
|
||||
|
||||
|
||||
async loadTestsFromCmdLine(filters) {
|
||||
// In actual URL queries (?q=...), + represents a space. But decodeURIComponent doesn't do this,
|
||||
// so do it manually. (+ is used over %20 for readability.) (See also encodeSelectively.)
|
||||
return this.loadTests(filters.map(f => decodeURIComponent(f.replace(/\+/g, '%20'))));
|
||||
}
|
||||
|
||||
async loadTests(filters) {
|
||||
const loads = filters.map(f => loadFilter(this.fileLoader, f));
|
||||
return concat((await Promise.all(loads)));
|
||||
}
|
||||
|
||||
}
|
||||
//# sourceMappingURL=loader.js.map
|
Loading…
Add table
Add a link
Reference in a new issue