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

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: 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
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 901719b9512e541a58b0d9b5dc518063a9bd301f..b3eff3a324081eed77b6a41ff3075e7a0ea0aa8c 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 | « no previous file | third_party/WebKit/LayoutTests/usb/usbDevice.html » ('j') | third_party/WebKit/Source/modules/webusb/USB.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698