* Return one of three expected values * https://github.com/web-platform-tests/wpt/blob/1c6ff12/tools/wptrunner/wptrunner/tests/test_update.py#L953-L958 * @returns {'linux'|'mac'|'win'}
()
| 29 | * @returns {'linux'|'mac'|'win'} |
| 30 | */ |
| 31 | function getOs() { |
| 32 | switch (os.type()) { |
| 33 | case 'Linux': |
| 34 | return 'linux'; |
| 35 | case 'Darwin': |
| 36 | return 'mac'; |
| 37 | case 'Windows_NT': |
| 38 | return 'win'; |
| 39 | default: |
| 40 | throw new Error('Unsupported os.type()'); |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | // https://github.com/web-platform-tests/wpt/blob/b24eedd/resources/testharness.js#L3705 |
| 45 | function sanitizeUnpairedSurrogates(str) { |