(win)
| 104 | } |
| 105 | |
| 106 | function createCrypto(win) { |
| 107 | if (!win.document) { |
| 108 | win.document = env.win.document; |
| 109 | } |
| 110 | win.performance = new FakePerformance(win); |
| 111 | installDocService(win, /* isSingleDoc */ true); |
| 112 | installExtensionsService(win); |
| 113 | const extensions = Services.extensionsFor(win); |
| 114 | env.sandbox |
| 115 | .stub(extensions, 'preloadExtension') |
| 116 | .callsFake((extensionId) => { |
| 117 | expect(extensionId).to.equal('amp-crypto-polyfill'); |
| 118 | installCryptoPolyfill(win); |
| 119 | return Promise.resolve(); |
| 120 | }); |
| 121 | |
| 122 | return new Crypto(win); |
| 123 | } |
| 124 | |
| 125 | function isModernChrome() { |
| 126 | const platform = new Platform(window); |
no test coverage detected