Thu, 15 Jan 2015 15:55:04 +0100
Back out 97036ab72558 which inappropriately compared turds to third parties.
1 /* Any copyright is dedicated to the Public Domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ */
4 function test() {
5 waitForExplicitFinish();
7 let url = "http://mochi.test:8888/browser/browser/base/content/test/general/test_wyciwyg_copying.html";
8 let tab = gBrowser.selectedTab = gBrowser.addTab(url);
9 tab.linkedBrowser.addEventListener("pageshow", function () {
10 let btn = content.document.getElementById("btn");
11 executeSoon(function () {
12 EventUtils.synthesizeMouseAtCenter(btn, {}, content);
13 let currentURL = gBrowser.currentURI.spec;
14 ok(/^wyciwyg:\/\//i.test(currentURL), currentURL + " is a wyciwyg URI");
16 executeSoon(function () {
17 testURLBarCopy(url, endTest);
18 });
19 });
20 }, false);
22 function endTest() {
23 while (gBrowser.tabs.length > 1)
24 gBrowser.removeCurrentTab();
25 finish();
26 }
28 function testURLBarCopy(targetValue, cb) {
29 info("Expecting copy of: " + targetValue);
30 waitForClipboard(targetValue, function () {
31 gURLBar.focus();
32 gURLBar.select();
34 goDoCommand("cmd_copy");
35 }, cb, cb);
36 }
37 }