testOpenedMenuPositionCorrection() {
    const iframe = dom.getElement('iframe1');
    const iframeDoc = dom.getFrameContentDocument(iframe);
    const iframeDom = dom.getDomHelper(iframeDoc);
    const iframeWindow = dom.getWindow(iframeDoc);

    const button = new MenuButton();
    iframeWindow.scrollTo(0, 0);
    const node = iframeDom.getElement('demoMenuButton');
    button.decorate(node);
    const mockTimer = new Timer();
    // Don't start the timer.  We manually dispatch the Tick event.
    mockTimer.start = () => {};
    /** @suppress {visibility} suppression added to enable type checking */
    button.timer_ = mockTimer;

    const replacer = new PropertyReplacer();
    let positionMenuCalled;
    const origPositionMenu = goog.bind(button.positionMenu, button);
    replacer.set(button, 'positionMenu', () => {
      positionMenuCalled = true;
      origPositionMenu();
    });

    // Show the menu.
    button.setOpen(true);

    // Confirm the menu position
    const menuNode = iframeDom.getElement('demoMenu');
    assertRoughlyEquals(
        menuNode.offsetTop, node.offsetTop + node.offsetHeight, 20);
    assertRoughlyEquals(menuNode.offsetLeft, node.offsetLeft, 20);

    positionMenuCalled = false;
    // A Tick event is dispatched.
    mockTimer.dispatchEvent(Timer.TICK);
    assertFalse('positionMenu() shouldn\'t be called.', positionMenuCalled);

    // Move the menu button by DOM structure change
    const p1 =
        iframeDom.createDom(TagName.P, null, iframeDom.createTextNode('foo'));
    const p2 =
        iframeDom.createDom(TagName.P, null, iframeDom.createTextNode('foo'));
    const p3 =
        iframeDom.createDom(TagName.P, null, iframeDom.createTextNode('foo'));
    iframeDom.insertSiblingBefore(p1, node);
    iframeDom.insertSiblingBefore(p2, node);
    iframeDom.insertSiblingBefore(p3, node);

    // Confirm the menu is detached from the button.
    assertTrue(
        Math.abs(node.offsetTop + node.offsetHeight - menuNode.offsetTop) > 20);

    positionMenuCalled = false;
    // A Tick event is dispatched.
    mockTimer.dispatchEvent(Timer.TICK);
    assertTrue('positionMenu() should be called.', positionMenuCalled);

    // The menu is moved to appropriate position again.
    assertRoughlyEquals(
        menuNode.offsetTop, node.offsetTop + node.offsetHeight, 20);

    // Make the frame page scrollable.
    const viewportHeight = iframeDom.getViewportSize().height;
    const footer = iframeDom.getElement('footer');
    style.setSize(footer, 1, viewportHeight * 2);
    // Change the viewport offset.
    iframeWindow.scrollTo(0, viewportHeight);
    // A Tick event is dispatched and positionMenu() should be called.
    positionMenuCalled = false;
    mockTimer.dispatchEvent(Timer.TICK);
    assertTrue('positionMenu() should be called.', positionMenuCalled);
    style.setSize(footer, 1, 1);

    // Tear down.
    iframeDom.removeNode(p1);
    iframeDom.removeNode(p2);
    iframeDom.removeNode(p3);
    replacer.reset();
    button.dispose();
  }
Shows the menu and moves the menu button, a timer correct the menu
     position.
@suppress {strictMissingProperties} suppression added to enable type
checking