diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /layout/base/tests/browser_bug617076.js | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'layout/base/tests/browser_bug617076.js')
-rw-r--r-- | layout/base/tests/browser_bug617076.js | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/layout/base/tests/browser_bug617076.js b/layout/base/tests/browser_bug617076.js new file mode 100644 index 000000000..d4e55f9b8 --- /dev/null +++ b/layout/base/tests/browser_bug617076.js @@ -0,0 +1,46 @@ +/** + * 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 + */ + +add_task(function* test() { + // Open the test tab + let testTab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, "about:addons"); + + // insert button into test page content + yield ContentTask.spawn(gBrowser.selectedBrowser, null, function* () { + let doc = content.document; + let e = doc.createElement("button"); + e.setAttribute("label", "hello"); + e.setAttribute("tooltiptext", "world"); + e.setAttribute("id", "test-button"); + doc.documentElement.insertBefore(e, doc.documentElement.firstChild); + }); + + // open a second tab and select it + let tab2 = yield BrowserTestUtils.openNewForegroundTab(gBrowser, "about:blank", true); + gBrowser.selectedTab = tab2; + + // Select the testTab then perform mouse events on inserted button + gBrowser.selectedTab = testTab; + let browser = gBrowser.selectedBrowser; + EventUtils.disableNonTestMouseEvents(true); + try { + yield BrowserTestUtils.synthesizeMouse("#test-button", 1, 1, { type: "mouseover" }, browser); + yield BrowserTestUtils.synthesizeMouse("#test-button", 2, 6, { type: "mousemove" }, browser); + yield BrowserTestUtils.synthesizeMouse("#test-button", 2, 4, { type: "mousemove" }, browser); + } finally { + EventUtils.disableNonTestMouseEvents(false); + } + + // cleanup + yield BrowserTestUtils.removeTab(testTab); + yield BrowserTestUtils.removeTab(tab2); + ok(true, "pass if no assertions"); +}); |