Backed out changeset 2450366cf7ca (bug 1891629) for causing win msix mochitest failures
[gecko.git] / widget / tests / test_ime_state_in_contenteditable_on_readonly_change_in_parent.html
blob8d8662a8d8f68739156cc8595042c0be0cb3f0f8
1 <html>
2 <head>
3 <title>Test for IME state of contenteditable on readonly state change</title>
4 <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
5 <script src="file_ime_state_test_helper.js"></script>
6 <script src="file_test_ime_state_in_contenteditable_on_readonly_change.js"></script>
7 <link rel="stylesheet" href="chrome://mochikit/content/tests/SimpleTest/test.css">
8 <script>
9 "use strict";
11 /* import-globals-from file_ime_state_test_helper.js */
12 /* import-globals-from file_test_ime_state_in_contenteditable_on_readonly_change.js */
14 SimpleTest.waitForExplicitFinish();
15 SimpleTest.waitForFocus(async () => {
16 const tipWrapper = new TIPWrapper(window);
17 const editingHost = document.querySelector("div[contenteditable]");
18 await (async function test_ime_state_in_contenteditable_on_readonly_change() {
19 const tester = new IMEStateInContentEditableOnReadonlyChangeTester();
20 tester.checkResultOfPreparation(await tester.prepareToRun(editingHost, editingHost), window, tipWrapper);
21 tester.checkResultOfMakingHTMLEditorReadonly(await tester.runToMakeHTMLEditorReadonly());
22 tester.checkResultOfMakingHTMLEditorEditable(await tester.runToMakeHTMLEditorEditable());
23 tester.checkResultOfRemovingContentEditableAttribute(await tester.runToRemoveContentEditableAttribute());
24 tester.clear();
25 })();
27 await (async function test_ime_state_in_button_in_contenteditable_on_readonly_change() {
28 const tester = new IMEStateInContentEditableOnReadonlyChangeTester();
29 const button = editingHost.querySelector("button");
30 tester.checkResultOfPreparation(await tester.prepareToRun(editingHost, button), window, tipWrapper);
31 tester.checkResultOfMakingHTMLEditorReadonly(await tester.runToMakeHTMLEditorReadonly());
32 tester.checkResultOfMakingHTMLEditorEditable(await tester.runToMakeHTMLEditorEditable());
33 tester.checkResultOfRemovingContentEditableAttribute(await tester.runToRemoveContentEditableAttribute());
34 tester.clear();
35 })();
37 await (async function test_ime_state_of_text_controls_in_contenteditable_on_readonly_change() {
38 const tester = new IMEStateOfTextControlInContentEditableOnReadonlyChangeTester();
39 for (let index = 0;
40 index < IMEStateOfTextControlInContentEditableOnReadonlyChangeTester.numberOfTextControlTypes;
41 index++) {
42 tester.checkResultOfPreparation(await tester.prepareToRun(index, editingHost), window, tipWrapper);
43 tester.checkResultOfMakingParentEditingHost(await tester.runToMakeParentEditingHost());
44 tester.checkResultOfMakingHTMLEditorReadonly(await tester.runToMakeHTMLEditorReadonly());
45 tester.checkResultOfMakingHTMLEditorEditable(await tester.runToMakeHTMLEditorEditable());
46 tester.checkResultOfMakingParentNonEditable(await tester.runToMakeParentNonEditingHost());
47 tester.clear();
49 editingHost.setAttribute("contenteditable", "");
50 })();
52 await (async function test_ime_state_outside_contenteditable_on_readonly_change() {
53 const tester = new IMEStateOutsideContentEditableOnReadonlyChangeTester();
54 for (let index = 0;
55 index < IMEStateOutsideContentEditableOnReadonlyChangeTester.numberOfFocusTargets;
56 index++) {
57 tester.checkResultOfPreparation(await tester.prepareToRun(index, editingHost), window, tipWrapper);
58 tester.checkResultOfMakingParentEditingHost(await tester.runToMakeParentEditingHost());
59 tester.checkResultOfMakingHTMLEditorReadonly(await tester.runToMakeHTMLEditorReadonly());
60 tester.checkResultOfMakingHTMLEditorEditable(await tester.runToMakeHTMLEditorEditable());
61 tester.checkResultOfMakingParentNonEditable(await tester.runToMakeParentNonEditingHost());
62 tester.clear();
64 editingHost.setAttribute("contenteditable", "");
65 })();
67 SimpleTest.finish();
68 });
69 </script>
70 </head>
71 <body><div contenteditable><br><button>button</button></div></body>
72 </html>