* @param {!Window} win
(win)
| 639 | * @param {!Window} win |
| 640 | */ |
| 641 | constructor(win) { |
| 642 | this.events_ = []; |
| 643 | win.addEventListener('message', (event) => { |
| 644 | const parsedData = this.parseMessageData_(event.data); |
| 645 | |
| 646 | if ( |
| 647 | parsedData && |
| 648 | // Either non-3P or 3P variant of the sentinel. |
| 649 | (/^amp/.test(parsedData.sentinel) || |
| 650 | /^\d+-\d+$/.test(parsedData.sentinel)) |
| 651 | ) { |
| 652 | this.events_.push({ |
| 653 | data: parsedData, |
| 654 | userActivation: event.userActivation, |
| 655 | }); |
| 656 | } |
| 657 | }); |
| 658 | } |
| 659 | |
| 660 | /** |
| 661 | * @param {string} type |
nothing calls this directly
no test coverage detected