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

Wed, 31 Dec 2014 13:27:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 13:27:57 +0100
branch
TOR_BUG_3246
changeset 6
8bccb770b82d
permissions
-rw-r--r--

Ignore runtime configuration files generated during quality assurance.

     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 }

mercurial