Index: third_party/WebKit/LayoutTests/external/wpt/webusb/resources/usb-helpers.js |
diff --git a/third_party/WebKit/LayoutTests/usb/resources/usb-helpers.js b/third_party/WebKit/LayoutTests/external/wpt/webusb/resources/usb-helpers.js |
similarity index 82% |
rename from third_party/WebKit/LayoutTests/usb/resources/usb-helpers.js |
rename to third_party/WebKit/LayoutTests/external/wpt/webusb/resources/usb-helpers.js |
index 22e5a65d657b25440d6e1a14645d1cf05a06097f..454f9090d2ce884417d410aa6b87be9c462f1e93 100644 |
--- a/third_party/WebKit/LayoutTests/usb/resources/usb-helpers.js |
+++ b/third_party/WebKit/LayoutTests/external/wpt/webusb/resources/usb-helpers.js |
@@ -74,24 +74,17 @@ function assertDeviceInfoEquals(usbDevice, deviceInit) { |
} |
} |
-// TODO(reillyg): Remove when jyasskin upstreams this to testharness.js: |
-// https://crbug.com/509058. |
-function callWithKeyDown(functionCalledOnKeyPress) { |
+function callWithTrustedClick(callback) { |
return new Promise(resolve => { |
- function onKeyPress() { |
- document.removeEventListener('keypress', onKeyPress, false); |
- resolve(functionCalledOnKeyPress()); |
- } |
- document.addEventListener('keypress', onKeyPress, false); |
- |
- eventSender.keyDown(' ', []); |
- }); |
-} |
- |
-function runGarbageCollection() { |
- // Run gc() as a promise. |
- return new Promise((resolve, reject) => { |
- GCController.collect(); |
- setTimeout(resolve, 0); |
+ 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 = () => { |
+ resolve(callback()); |
+ document.body.removeChild(button); |
+ }; |
+ document.body.appendChild(button); |
}); |
} |