michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: function test() { michael@0: waitForExplicitFinish(); michael@0: michael@0: let url = "http://mochi.test:8888/browser/browser/base/content/test/general/test_wyciwyg_copying.html"; michael@0: let tab = gBrowser.selectedTab = gBrowser.addTab(url); michael@0: tab.linkedBrowser.addEventListener("pageshow", function () { michael@0: let btn = content.document.getElementById("btn"); michael@0: executeSoon(function () { michael@0: EventUtils.synthesizeMouseAtCenter(btn, {}, content); michael@0: let currentURL = gBrowser.currentURI.spec; michael@0: ok(/^wyciwyg:\/\//i.test(currentURL), currentURL + " is a wyciwyg URI"); michael@0: michael@0: executeSoon(function () { michael@0: testURLBarCopy(url, endTest); michael@0: }); michael@0: }); michael@0: }, false); michael@0: michael@0: function endTest() { michael@0: while (gBrowser.tabs.length > 1) michael@0: gBrowser.removeCurrentTab(); michael@0: finish(); michael@0: } michael@0: michael@0: function testURLBarCopy(targetValue, cb) { michael@0: info("Expecting copy of: " + targetValue); michael@0: waitForClipboard(targetValue, function () { michael@0: gURLBar.focus(); michael@0: gURLBar.select(); michael@0: michael@0: goDoCommand("cmd_copy"); michael@0: }, cb, cb); michael@0: } michael@0: } michael@0: michael@0: