Files
firefox/testing/web-platform/tests/webgpu/framework/loader.js
T
Kai Ninomiya 1c83680b14 Bug 1592809 [wpt PR 20008] - Roll WebGPU CTS, a=testonly
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
2019-11-20 11:19:26 +00:00

50 lines
1.3 KiB
JavaScript

/**
* 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) {
return this.loadTests(filters);
}
async loadTests(filters) {
const loads = filters.map(f => loadFilter(this.fileLoader, f));
return concat((await Promise.all(loads)));
}
}
//# sourceMappingURL=loader.js.map