-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Generate Web Worker script for every test file This will be needed to launch Service Workers, which cannot be generated at runtime and cannot use dynamic import(). * Add service worker support * Update wpt.ts * Run tests * Address kainino0x feedback * Address feedback | part 2 * Address feedback | part 3 * Address feedback | part 4 * Address feedback | part 5 * Address feedback | part 6 * Address feedback | part 7 * Address feedback | part 8 * Apply suggestions from code review * use WorkerTestRunRequest in the postMessage/onmessage interface * Clean up resolvers map * Use express routing for .worker.js * Skip worker tests when run in a worker that can't support them DedicatedWorker can be created from DedicatedWorker, but none of the other nested worker pairs are allowed. * Clean up all service workers on startup and shutdown * Avoid reinitializing service workers for every single case * lint fixes * Catch errors in wrapTestGroupForWorker onMessage * Make sure the service worker has the correct URL --------- Co-authored-by: Kai Ninomiya <[email protected]>
- Loading branch information
1 parent
f9f6c90
commit 5ad7589
Showing
27 changed files
with
512 additions
and
279 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { globalTestConfig } from '../../framework/test_config.js'; | ||
import { Logger } from '../../internal/logging/logger.js'; | ||
import { TestQueryWithExpectation } from '../../internal/query/query.js'; | ||
import { setDefaultRequestAdapterOptions } from '../../util/navigator_gpu.js'; | ||
|
||
import { CTSOptions } from './options.js'; | ||
|
||
export interface WorkerTestRunRequest { | ||
query: string; | ||
expectations: TestQueryWithExpectation[]; | ||
ctsOptions: CTSOptions; | ||
} | ||
|
||
/** | ||
* Set config environment for workers with ctsOptions and return a Logger. | ||
*/ | ||
export function setupWorkerEnvironment(ctsOptions: CTSOptions): Logger { | ||
const { debug, unrollConstEvalLoops, powerPreference, compatibility } = ctsOptions; | ||
globalTestConfig.unrollConstEvalLoops = unrollConstEvalLoops; | ||
globalTestConfig.compatibility = compatibility; | ||
|
||
Logger.globalDebugMode = debug; | ||
const log = new Logger(); | ||
|
||
if (powerPreference || compatibility) { | ||
setDefaultRequestAdapterOptions({ | ||
...(powerPreference && { powerPreference }), | ||
// MAINTENANCE_TODO: Change this to whatever the option ends up being | ||
...(compatibility && { compatibilityMode: true }), | ||
}); | ||
} | ||
|
||
return log; | ||
} |
Oops, something went wrong.