summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/mozilla/tests/webgpu/common/runtime/helper/options.js
blob: 946c0bdc11945b4e36315821af5375289f1d9156 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/**
 * AUTO-GENERATED - DO NOT EDIT. Source: https://github.com/gpuweb/cts
 **/ let windowURL = undefined;
function getWindowURL() {
  if (windowURL === undefined) {
    windowURL = new URL(window.location.toString());
  }
  return windowURL;
}

export function optionEnabled(opt, searchParams = getWindowURL().searchParams) {
  const val = searchParams.get(opt);
  return val !== null && val !== '0';
}

export function optionString(opt, searchParams = getWindowURL().searchParams) {
  return searchParams.get(opt) || '';
}