-
Notifications
You must be signed in to change notification settings - Fork 24.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(zone.js): zone-mix should import correct browser module (#31628)
- Loading branch information
1 parent
0440dc9
commit f064045
Showing
4 changed files
with
46 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/** | ||
* @license | ||
* Copyright Google Inc. 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.io/license | ||
*/ | ||
var domino = require('domino'); | ||
var mockRequire = require('mock-require'); | ||
var nativeTimeout = setTimeout; | ||
require('./zone-mix'); | ||
mockRequire('electron', { | ||
desktopCapturer: {getSources: function(callback) { nativeTimeout(callback); }}, | ||
shell: {openExternal: function(callback) { nativeTimeout(callback); }}, | ||
ipcRenderer: {on: function(callback) { nativeTimeout(callback); }}, | ||
}); | ||
require('./zone-patch-electron'); | ||
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); | ||
} | ||
}); | ||
}); |