/
githubmirror
/
angular
Обзор
Документация
Войти
/
githubmirror
/
angular
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
packages/zone.js/test/extra/electron.js
49 строк
1 KB
Joey Perrott
refactor: update license text to point to angular.dev (#57901)
24 сен 2024, 16:33
24 сен 2024, 16:33
9dbe6fc
Код
Авторство
О чём код?
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ var domino = require('domino'); var mockRequire = require('mock-require'); var nativeTimeout = setTimeout; require('./zone-mix.umd'); mockRequire('electron', { desktopCapturer: { getSources: function (callback) { nativeTimeout(callback); }, }, shell: { openExternal: function (callback) { nativeTimeout(callback); }, }, ipcRenderer: { on: function (callback) { nativeTimeout(callback); }, }, }); require('./zone-patch-electron.umd'); var electron = require('electron'); var zone = Zone.current.fork({name: 'zone'}); zone.run(function () { electron.desktopCapturer.getSources(function () { if (Zone.current.name !== 'zone') { process.exit(1); } }); electron.shell.openExternal(function () { console.log('shell', Zone.current.name); if (Zone.current.name !== 'zone') { process.exit(1); } }); electron.ipcRenderer.on(function () { if (Zone.current.name !== 'zone') { process.exit(1); } }); });