* Tests trust determination by origin. * * @param {string} origin URL under test. * @param {boolean} toBeTrusted The expected outcome. * @param {boolean=} opt_inWebView Whether doc is in a web view.
(origin, toBeTrusted, opt_inWebView)
| 1398 | * @param {boolean=} opt_inWebView Whether doc is in a web view. |
| 1399 | */ |
| 1400 | function test(origin, toBeTrusted, opt_inWebView) { |
| 1401 | it('testing ' + origin, () => { |
| 1402 | const viewer = new ViewerImpl(ampdoc); |
| 1403 | viewer.isWebviewEmbedded_ = !!opt_inWebView; |
| 1404 | expect(viewer.isTrustedViewerOrigin_(origin)).to.equal(toBeTrusted); |
| 1405 | }); |
| 1406 | } |
| 1407 | |
| 1408 | describe('should trust trusted viewer origins', () => { |
| 1409 | test('https://google.com', true); |
no test coverage detected