toolkit/content/tests/chrome/bug366992_window.xul

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 <?xml version="1.0"?>
     3 <!-- This Source Code Form is subject to the terms of the Mozilla Public
     4    - License, v. 2.0. If a copy of the MPL was not distributed with this
     5    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
     7 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
     8 <?xul-overlay href="chrome://global/content/editMenuOverlay.xul"?>
    10 <window id="366992 test"
    11         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
    12         onload="onLoad();"
    13         width="600"
    14         height="600"
    15         title="366992 test">
    17   <commandset id="editMenuCommands"/>
    19   <script type="application/javascript"
    20           src="chrome://global/content/globalOverlay.js"/>
    21   <script type="application/javascript"><![CDATA[
    22     // Without the fix for bug 366992, the copy command would be enabled
    23     // for the textbox even though the textbox's controller for this command
    24     // disables it.
    25     var gShouldNotBeReachedController = {
    26       supportsCommand: function(aCommand) {
    27         return aCommand == "cmd_copy";
    28       },
    29       isCommandEnabled: function(aCommand) {
    30         return aCommand == "cmd_copy";
    31       },
    32       doCommand: function(aCommand) { }
    33     }
    35     function ok(condition, message) {
    36       window.opener.wrappedJSObject.SimpleTest.ok(condition, message);
    37     }
    38     function finish() {
    39       window.controllers.removeController(gShouldNotBeReachedController);
    40       window.close();
    41       window.opener.wrappedJSObject.SimpleTest.finish();
    42     }
    44     function onLoad() {
    45       document.getElementById("textbox").focus();
    46       var copyDisabled = document.getElementById("cmd_copy")
    47                                  .getAttribute("disabled") == "true";
    48       ok(copyDisabled,
    49          "cmd_copy should be disabled when the empty textbox is focused");
    50       finish();
    51     }
    53     window.controllers.appendController(gShouldNotBeReachedController);
    54   ]]></script>
    56   <textbox id="textbox"/>
    57 </window>

mercurial