tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

0001-base-resource-path.patch (1970B)


      1 From 57ad7909547f10d22c8d1a359a44a3ac57a9e06c Mon Sep 17 00:00:00 2001
      2 From: Jamie Nicol <jnicol@mozilla.com>
      3 Date: Wed, 20 Aug 2025 14:03:28 +0100
      4 Subject: [PATCH] Override baseResourcePath for Firefox's WebGPU CTS vendoring
      5 scheme
      6 
      7 Firefox generates test files as a separate HTML file per test, each
      8 located in the same relative directory as the corresponding spec.ts
      9 file. Since these are *not* in the root CTS directory, the default
     10 `baseResourcePath` is incorrect. This patch overrides baseResourcePath
     11 to the correct absolute directory within the vendored CTS tree.
     12 
     13 The path is overridden at runtime when running worker tests, therefore
     14 we must ensure the correct value is used for those as well.
     15 ---
     16 src/common/framework/resources.ts               | 2 +-
     17 src/common/runtime/helper/test_worker-worker.ts | 2 +-
     18 2 files changed, 2 insertions(+), 2 deletions(-)
     19 
     20 diff --git a/src/common/framework/resources.ts b/src/common/framework/resources.ts
     21 index c926aaa280c..762bb5bdaf2 100644
     22 --- a/src/common/framework/resources.ts
     23 +++ b/src/common/framework/resources.ts
     24 @@ -3,7 +3,7 @@
     25  * workers must access resources using a different base path, so this is overridden in
     26  * `test_worker-worker.ts` and `standalone.ts`.
     27  */
     28 -let baseResourcePath = './resources';
     29 +let baseResourcePath = '/_mozilla/webgpu/resources';
     30 let crossOriginHost = '';
     31 
     32 function getAbsoluteBaseResourcePath(path: string) {
     33 diff --git a/src/common/runtime/helper/test_worker-worker.ts b/src/common/runtime/helper/test_worker-worker.ts
     34 index 48bb7b0e3c8..a72cab7129a 100644
     35 --- a/src/common/runtime/helper/test_worker-worker.ts
     36 +++ b/src/common/runtime/helper/test_worker-worker.ts
     37 @@ -12,7 +12,7 @@ declare const self: any;
     38 
     39 const loader = new DefaultTestFileLoader();
     40 
     41 -setBaseResourcePath('../../../resources');
     42 +setBaseResourcePath('/_mozilla/webgpu/resources');
     43 
     44 // MessagePort, DedicatedWorkerGlobalScope, etc.
     45 type Sender = { postMessage: (x: unknown) => void };
     46 -- 
     47 2.50.1