https://github.com/mozilla/gecko-dev
Raw File
Tip revision: 6c9ce83bf002cce2799ffa270c6eeb4c1227d972 authored by ffxbld on 07 February 2013, 02:23:21 UTC
Added FENNEC_19_0b5_RELEASE FENNEC_19_0b5_BUILD2 tag(s) for changeset 20d099b63e84. DONTBUILD CLOSED TREE a=release
Tip revision: 6c9ce83
browser_bug617076.js
function test()
{
  waitForExplicitFinish();

  test1();
}

/**
 * 1. load about:addons in a new tab and select that tab
 * 2. insert a button with tooltiptext
 * 3. create a new blank tab and select that tab
 * 4. select the about:addons tab and hover the inserted button
 * 5. remove the about:addons tab
 * 6. remove the blank tab
 *
 * the test succeeds if it doesn't trigger any assertions
 */
function test1() {
  let uri = "about:addons";
  let tab = gBrowser.addTab();

  tab.linkedBrowser.addEventListener("load", function(aEvent) {
    tab.linkedBrowser.removeEventListener("load", arguments.callee, true);

    let doc = gBrowser.contentDocument;
    var e = doc.createElement("button");
    e.setAttribute('label', "hello");
    e.setAttribute('tooltiptext', "world");
    doc.documentElement.insertBefore(e, doc.documentElement.firstChild);

    let tab2 = gBrowser.addTab();
    gBrowser.selectedTab = tab2;

    setTimeout(function() {
      gBrowser.selectedTab = tab;

      let doc = gBrowser.contentDocument;
      var win = gBrowser.contentWindow;
      EventUtils.disableNonTestMouseEvents(true);
      try {
        EventUtils.synthesizeMouse(e, 1, 1, { type: "mouseover" }, win);
        EventUtils.synthesizeMouse(e, 2, 6, { type: "mousemove" }, win);
        EventUtils.synthesizeMouse(e, 2, 4, { type: "mousemove" }, win);
      } finally {
        EventUtils.disableNonTestMouseEvents(false);
      }

      executeSoon(function() {
        gBrowser.removeTab(tab, {animate: false});
        gBrowser.removeTab(tab2, {animate: false});
        ok(true, "pass if no assertions");

        // done
        executeSoon(finish);
      });
    }, 0);
  }, true);

  gBrowser.selectedTab = tab;
  gBrowser.selectedTab.linkedBrowser.loadURI(uri);
}
back to top