| |
1 /* Any copyright is dedicated to the Public Domain. |
| |
2 http://creativecommons.org/publicdomain/zero/1.0/ */ |
| |
3 |
| |
4 function test() { |
| |
5 waitForExplicitFinish(); |
| |
6 |
| |
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"); |
| |
15 |
| |
16 executeSoon(function () { |
| |
17 testURLBarCopy(url, endTest); |
| |
18 }); |
| |
19 }); |
| |
20 }, false); |
| |
21 |
| |
22 function endTest() { |
| |
23 while (gBrowser.tabs.length > 1) |
| |
24 gBrowser.removeCurrentTab(); |
| |
25 finish(); |
| |
26 } |
| |
27 |
| |
28 function testURLBarCopy(targetValue, cb) { |
| |
29 info("Expecting copy of: " + targetValue); |
| |
30 waitForClipboard(targetValue, function () { |
| |
31 gURLBar.focus(); |
| |
32 gURLBar.select(); |
| |
33 |
| |
34 goDoCommand("cmd_copy"); |
| |
35 }, cb, cb); |
| |
36 } |
| |
37 } |
| |
38 |
| |
39 |