B2G/gecko/browser/base/content/test/browser_bug561636.js
/**
 * In this test, we check that the popup will hide if we move to another tab.
 */
In this test, we check that the popup will hide if we move to another tab.
In this test we check that the popup will hide if we move to another tab .
function test7()
{
  let uri = "data:text/html,<iframe name='t'></iframe><form target='t' action='data:text/html,'><input id='i' required><input id='s' type='submit'></form>";
  let tab = gBrowser.addTab();
  gInvalidFormPopup.addEventListener("popupshown", function() {
    gInvalidFormPopup.removeEventListener("popupshown", arguments.callee, false);
    let doc = gBrowser.contentDocument;
    is(doc.activeElement, doc.getElementById('i'),
       "First invalid element should be focused");
    checkPopupShow();
    checkPopupMessage(doc);
    gBrowser.selectedTab  = gBrowser.addTab("about:blank", {skipAnimation: true});
    executeSoon(function() {
      checkPopupHide();
      gBrowser.removeTab(gBrowser.selectedTab);
      gBrowser.removeTab(gBrowser.selectedTab);
      executeSoon(test8);
    });
  }, false);
  tab.linkedBrowser.addEventListener("load", function(aEvent) {
    tab.linkedBrowser.removeEventListener("load", arguments.callee, true);
    gBrowser.contentDocument.getElementById('s').click();
  }, true);
  gBrowser.selectedTab = tab;
  gBrowser.selectedTab.linkedBrowser.loadURI(uri);
}
function test7 ( ) { let uri = "data:text/html,<iframe name='t'></iframe><form target='t' action='data:text/html,'><input id='i' required><input id='s' type='submit'></form>" ; let tab = gBrowser . addTab ( ) ; gInvalidFormPopup . addEventListener ( "popupshown" , function ( ) { gInvalidFormPopup . removeEventListener ( "popupshown" , arguments . callee , false ) ; let doc = gBrowser . contentDocument ; is ( doc . activeElement , doc . getElementById ( 'i' ) , "First invalid element should be focused" ) ; checkPopupShow ( ) ; checkPopupMessage ( doc ) ; gBrowser . selectedTab = gBrowser . addTab ( "about:blank" , { skipAnimation : true } ) ; executeSoon ( function ( ) { checkPopupHide ( ) ; gBrowser . removeTab ( gBrowser . selectedTab ) ; gBrowser . removeTab ( gBrowser . selectedTab ) ; executeSoon ( test8 ) ; } ) ; } , false ) ; tab . linkedBrowser . addEventListener ( "load" , function ( aEvent ) { tab . linkedBrowser . removeEventListener ( "load" , arguments . callee , true ) ; gBrowser . contentDocument . getElementById ( 's' ) . click ( ) ; } , true ) ; gBrowser . selectedTab = tab ; gBrowser . selectedTab . linkedBrowser . loadURI ( uri ) ; }
In this test, we check that the popup will hide if we move to another tab.
In this test we check that the popup will hide if we move to another tab .
// Create a new tab and move to it. // Clean-up and next test.