me' ? '' : 'sub.'}js`;
    } else {
      assert_unreached('Invalid config.fetchType: ' + config.fetchType);
    }

    // Name idetically for each test cases so that it connects to the shared
    // worker with specified type and credentials.
    options.name = `${options.type}_${options.credentials || 'default'}_${config.fetchType}_${config.origin}`;

    const worker = new SharedWorker(workerURL, options);

    // Wait until the worker sends the actual cookie value.
    const msg_event = await new Promis