Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(768)

Unified Diff: third_party/WebKit/LayoutTests/usb/resources/usb-helpers.js

Issue 1912223002: Make new WebUSB implementation more resilient to garbage collection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased again. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | third_party/WebKit/LayoutTests/usb/usbDevice.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/usb/resources/usb-helpers.js
diff --git a/third_party/WebKit/LayoutTests/usb/resources/usb-helpers.js b/third_party/WebKit/LayoutTests/usb/resources/usb-helpers.js
index 5d86799f5bcbea9d94fb8fed35df03154e15560f..932f3f6c477b9ddd436ceaef02ebf5ef75e05dd0 100644
--- a/third_party/WebKit/LayoutTests/usb/resources/usb-helpers.js
+++ b/third_party/WebKit/LayoutTests/usb/resources/usb-helpers.js
@@ -24,6 +24,14 @@ function callWithKeyDown(functionCalledOnKeyPress) {
});
}
+function runGarbageCollection() {
+ // Run gc() as a promise.
+ return new Promise((resolve, reject) => {
+ GCController.collect();
+ setTimeout(resolve, 0);
+ });
+}
+
function usbMocks(mojo) {
return define('USB Mocks', [
'device/usb/public/interfaces/chooser_service.mojom',
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | third_party/WebKit/LayoutTests/usb/usbDevice.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698