1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/toolkit/content/tests/chrome/bug366992_window.xul Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,57 @@ 1.4 +<?xml version="1.0"?> 1.5 + 1.6 +<!-- This Source Code Form is subject to the terms of the Mozilla Public 1.7 + - License, v. 2.0. If a copy of the MPL was not distributed with this 1.8 + - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> 1.9 + 1.10 +<?xml-stylesheet href="chrome://global/skin" type="text/css"?> 1.11 +<?xul-overlay href="chrome://global/content/editMenuOverlay.xul"?> 1.12 + 1.13 +<window id="366992 test" 1.14 + xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" 1.15 + onload="onLoad();" 1.16 + width="600" 1.17 + height="600" 1.18 + title="366992 test"> 1.19 + 1.20 + <commandset id="editMenuCommands"/> 1.21 + 1.22 + <script type="application/javascript" 1.23 + src="chrome://global/content/globalOverlay.js"/> 1.24 + <script type="application/javascript"><![CDATA[ 1.25 + // Without the fix for bug 366992, the copy command would be enabled 1.26 + // for the textbox even though the textbox's controller for this command 1.27 + // disables it. 1.28 + var gShouldNotBeReachedController = { 1.29 + supportsCommand: function(aCommand) { 1.30 + return aCommand == "cmd_copy"; 1.31 + }, 1.32 + isCommandEnabled: function(aCommand) { 1.33 + return aCommand == "cmd_copy"; 1.34 + }, 1.35 + doCommand: function(aCommand) { } 1.36 + } 1.37 + 1.38 + function ok(condition, message) { 1.39 + window.opener.wrappedJSObject.SimpleTest.ok(condition, message); 1.40 + } 1.41 + function finish() { 1.42 + window.controllers.removeController(gShouldNotBeReachedController); 1.43 + window.close(); 1.44 + window.opener.wrappedJSObject.SimpleTest.finish(); 1.45 + } 1.46 + 1.47 + function onLoad() { 1.48 + document.getElementById("textbox").focus(); 1.49 + var copyDisabled = document.getElementById("cmd_copy") 1.50 + .getAttribute("disabled") == "true"; 1.51 + ok(copyDisabled, 1.52 + "cmd_copy should be disabled when the empty textbox is focused"); 1.53 + finish(); 1.54 + } 1.55 + 1.56 + window.controllers.appendController(gShouldNotBeReachedController); 1.57 + ]]></script> 1.58 + 1.59 + <textbox id="textbox"/> 1.60 +</window>