test_bug46555.html (1353B)
1 <!DOCTYPE HTML> 2 <!-- This Source Code Form is subject to the terms of the Mozilla Public 3 - License, v. 2.0. If a copy of the MPL was not distributed with this 4 - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> 5 <html> 6 <!-- 7 https://bugzilla.mozilla.org/show_bug.cgi?id=46555 8 --> 9 10 <head> 11 <title>Test for Bug 46555</title> 12 <script src="/tests/SimpleTest/SimpleTest.js"></script> 13 <link rel="stylesheet" href="/tests/SimpleTest/test.css"> 14 </head> 15 16 <body> 17 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=46555">Mozilla Bug 46555</a> 18 <p id="display"></p> 19 <div id="content" style="display: none"> 20 </div> 21 22 <input type="text" value="" id="t1" /> 23 24 <pre id="test"> 25 <script type="application/javascript"> 26 27 /** Test for Bug 46555 */ 28 SimpleTest.waitForExplicitFinish(); 29 SimpleTest.waitForFocus(function() { 30 const kCmd = "cmd_selectAll"; 31 32 var input = document.getElementById("t1"); 33 input.focus(); 34 var controller = 35 SpecialPowers.wrap(input).controllers.getControllerForCommand(kCmd); 36 37 // Test 1: Select All should be disabled if editor is empty 38 is(controller.isCommandEnabled(kCmd), false, 39 "Select All command disabled when editor is empty"); 40 41 SimpleTest.finish(); 42 }); 43 </script> 44 </pre> 45 46 </body> 47 </html>