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

Unified Diff: third_party/WebKit/LayoutTests/usb/usbDevice-iframe.html

Issue 2831223003: Move the onclose event handler to the FakeUSBDevice object (Closed)
Patch Set: Rebased Created 3 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/usb/resources/webusb-test.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/usb/usbDevice-iframe.html
diff --git a/third_party/WebKit/LayoutTests/usb/usbDevice-iframe.html b/third_party/WebKit/LayoutTests/usb/usbDevice-iframe.html
index b6514072106d3b1b10da023a877cb1fe70a3c2ac..2ccead73c49787c816c251c38d4c60eb698ca9bc 100644
--- a/third_party/WebKit/LayoutTests/usb/usbDevice-iframe.html
+++ b/third_party/WebKit/LayoutTests/usb/usbDevice-iframe.html
@@ -11,7 +11,6 @@ function runIframeDisconnectTest(onDeviceConnected) {
return navigator.usb.test.initialize().then(() => {
return new Promise((resolve, reject) => {
let opened = false;
- let fakeDevice = null;
let iframe = document.createElement('iframe');
iframe.src = 'resources/open-in-iframe.html';
@@ -23,7 +22,11 @@ function runIframeDisconnectTest(onDeviceConnected) {
window.onmessage = messageEvent => {
if (messageEvent.data == 'Ready') {
- fakeDevice = navigator.usb.test.addFakeDevice(fakeDeviceInit);
+ let fakeDevice = navigator.usb.test.addFakeDevice(fakeDeviceInit);
+ fakeDevice.onclose = () => {
+ assert_true(opened);
+ resolve();
+ };
} else if (messageEvent.data == 'Success') {
opened = true;
onDeviceConnected(iframe);
@@ -32,12 +35,6 @@ function runIframeDisconnectTest(onDeviceConnected) {
}
};
- navigator.usb.test.ondeviceclose = closedFakeDevice => {
- assert_equals(closedFakeDevice, fakeDevice);
- assert_true(opened);
- resolve();
- };
-
document.body.appendChild(iframe);
});
});
« no previous file with comments | « third_party/WebKit/LayoutTests/usb/resources/webusb-test.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698