1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/editor/libeditor/base/tests/test_bug46555.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,47 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<!-- This Source Code Form is subject to the terms of the Mozilla Public 1.6 + - License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> 1.8 +<html> 1.9 +<!-- 1.10 +https://bugzilla.mozilla.org/show_bug.cgi?id=46555 1.11 +--> 1.12 + 1.13 +<head> 1.14 + <title>Test for Bug 46555</title> 1.15 + <script type="application/javascript" 1.16 + src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> 1.17 + <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/> 1.18 +</head> 1.19 + 1.20 +<body> 1.21 + <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=46555">Mozilla Bug 46555</a> 1.22 + <p id="display"></p> 1.23 + <div id="content" style="display: none"> 1.24 + </div> 1.25 + 1.26 + <input type="text" value="" id="t1" /> 1.27 + 1.28 + <pre id="test"> 1.29 + <script type="application/javascript"> 1.30 + 1.31 + /** Test for Bug 46555 **/ 1.32 + SimpleTest.waitForExplicitFinish(); 1.33 + SimpleTest.waitForFocus(function() { 1.34 + const kCmd = "cmd_selectAll"; 1.35 + 1.36 + var input = document.getElementById("t1"); 1.37 + input.focus(); 1.38 + var controller = input.controllers.getControllerForCommand(kCmd); 1.39 + 1.40 + // Test 1: Select All should be disabled if editor is empty 1.41 + is(controller.isCommandEnabled(kCmd), false, 1.42 + "Select All command disabled when editor is empty"); 1.43 + 1.44 + SimpleTest.finish(); 1.45 + }); 1.46 + </script> 1.47 + </pre> 1.48 + 1.49 +</body> 1.50 +</html>