mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Add debugging for TAB tests
This commit is contained in:
@@ -119,8 +119,14 @@ describe('focus handling', () => {
|
||||
w = null as unknown as BrowserWindow
|
||||
})
|
||||
|
||||
ipcMain.on('console-log', (event, test) => {
|
||||
console.log('Console-log: ', test)
|
||||
})
|
||||
|
||||
const expectFocusChange = async () => {
|
||||
console.log('About to await focus-changed')
|
||||
const [, focusedElementId] = await emittedOnce(ipcMain, 'focus-changed')
|
||||
console.log('Got focus-changed event:', focusedElementId)
|
||||
return focusedElementId
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,14 @@
|
||||
if (event.target.tagName && event.target.tagName !== 'WEBVIEW') {
|
||||
const elementId = event.target.id ? `-${event.target.id}` : ''
|
||||
const elementIdentifier = `${event.target.tagName}${elementId}`
|
||||
ipcRenderer.send('console-log', `sending focus-changed event for ${elementIdentifier}`)
|
||||
ipcRenderer.send('focus-changed', elementIdentifier)
|
||||
} else {
|
||||
if (event.target.tagName) {
|
||||
ipcRenderer.send('console-log', `GOT focus event, but tagname "${event.target.tagName}" not expected.`)
|
||||
} else {
|
||||
ipcRenderer.send('console-log', `GOT focus event, but do not have tagname.`)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user