Tool scripts should not use PrivilegedAPI from 'public/v3/privileged-api.js'.
Created attachment 338293 [details] Patch
Comment on attachment 338293 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=338293&action=review > Websites/perf.webkit.org/server-tests/api-upload-root-tests.js:12 > +global.PrivilegedAPI = require('../public/v3/privileged-api.js').PrivilegedAPI; This should probably be done in TestServer.inject so that when all these tests are ran at the same time, we use the correct version of PrivilegedAPI instead of whichever loaded last.
Created attachment 338395 [details] Patch
Created attachment 338444 [details] Patch
Comment on attachment 338444 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=338444&action=review > Websites/perf.webkit.org/tools/js/privileged-api.js:8 > + for (let key in data) Use const. > Websites/perf.webkit.org/unit-tests/resources/mock-remote-api.js:63 > + inject: function (urlPrefix, useNodePrivilegedAPI) We should make inject either make a dictionary or the second argument should be a string specifying the type of PrivilegedAPI we use; e.g. 'browser' (default) / 'node'. > Websites/perf.webkit.org/unit-tests/resources/mock-remote-api.js:67 > + const hookPrivilegedAPI = useNodePrivilegedAPI ? NodePrivilegedAPI: BrowserPrivilegedAPI; Use call this PrivilegedAPI.
https://trac.webkit.org/changeset/230960
<rdar://problem/39709519>