|
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 type="application/javascript" |
|
13 src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> |
|
14 <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/> |
|
15 </head> |
|
16 |
|
17 <body> |
|
18 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=46555">Mozilla Bug 46555</a> |
|
19 <p id="display"></p> |
|
20 <div id="content" style="display: none"> |
|
21 </div> |
|
22 |
|
23 <input type="text" value="" id="t1" /> |
|
24 |
|
25 <pre id="test"> |
|
26 <script type="application/javascript"> |
|
27 |
|
28 /** Test for Bug 46555 **/ |
|
29 SimpleTest.waitForExplicitFinish(); |
|
30 SimpleTest.waitForFocus(function() { |
|
31 const kCmd = "cmd_selectAll"; |
|
32 |
|
33 var input = document.getElementById("t1"); |
|
34 input.focus(); |
|
35 var controller = 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> |