browser/base/content/test/general/browser_wyciwyg_urlbarCopying.js

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:05e3bf4ec80c
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

mercurial