summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/webhid/resources/automation.js
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/webhid/resources/automation.js')
-rw-r--r--testing/web-platform/tests/webhid/resources/automation.js42
1 files changed, 0 insertions, 42 deletions
diff --git a/testing/web-platform/tests/webhid/resources/automation.js b/testing/web-platform/tests/webhid/resources/automation.js
deleted file mode 100644
index f7477d1ecc..0000000000
--- a/testing/web-platform/tests/webhid/resources/automation.js
+++ /dev/null
@@ -1,42 +0,0 @@
-'use strict';
-
-let fakeHidService = undefined;
-
-function hid_test(func, name, properties) {
- promise_test(async (test) => {
- assert_implements(navigator.hid, 'missing navigator.hid');
- if (fakeHidService === undefined) {
- // Try loading a polyfill for the fake hid service.
- if (isChromiumBased) {
- const fakes = await import('/resources/chromium/fake-hid.js');
- fakeHidService = fakes.fakeHidService;
- }
- }
- assert_implements(
- fakeHidService, 'missing fakeHidService after initialization');
-
- fakeHidService.start();
- try {
- await func(test, fakeHidService);
- } finally {
- fakeHidService.stop();
- fakeHidService.reset();
- }
- }, name, properties);
-}
-
-function trustedClick() {
- return new Promise(resolve => {
- let button = document.createElement('button');
- button.textContent = 'click to continue test';
- button.style.display = 'block';
- button.style.fontSize = '20px';
- button.style.padding = '10px';
- button.onclick = () => {
- document.body.removeChild(button);
- resolve();
- };
- document.body.appendChild(button);
- test_driver.click(button);
- });
-}