mirror of
https://github.com/electron/electron.git
synced 2026-05-02 03:00:22 -04:00
refactor: use std::string instead of base::string16 for IPC channel names (#14286)
This commit is contained in:
committed by
Charles Kerr
parent
605a4570c1
commit
e6e3ccfc50
@@ -154,6 +154,21 @@ describe('ipc renderer module', () => {
|
||||
|
||||
contents.loadURL(`file://${path.join(fixtures, 'pages', 'ping-pong.html')}`)
|
||||
})
|
||||
|
||||
it('sends message to WebContents (channel has special chars)', done => {
|
||||
const webContentsId = remote.getCurrentWebContents().id
|
||||
|
||||
ipcRenderer.once('pong-æøåü', (event, id) => {
|
||||
expect(webContentsId).to.equal(id)
|
||||
done()
|
||||
})
|
||||
|
||||
contents.once('did-finish-load', () => {
|
||||
ipcRenderer.sendTo(contents.id, 'ping-æøåü', webContentsId)
|
||||
})
|
||||
|
||||
contents.loadURL(`file://${path.join(fixtures, 'pages', 'ping-pong.html')}`)
|
||||
})
|
||||
})
|
||||
|
||||
describe('remote listeners', () => {
|
||||
|
||||
3
spec/fixtures/pages/ping-pong.html
vendored
3
spec/fixtures/pages/ping-pong.html
vendored
@@ -5,6 +5,9 @@
|
||||
ipcRenderer.on('ping', function (event, id) {
|
||||
ipcRenderer.sendTo(id, 'pong', id)
|
||||
})
|
||||
ipcRenderer.on('ping-æøåü', function (event, id) {
|
||||
ipcRenderer.sendTo(id, 'pong-æøåü', id)
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user