diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
commit | 6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch) | |
tree | a68f146d7fa01f0134297619fbe7e33db084e0aa /widget/tests/browser/browser_test_ime_state_on_readonly_change_in_remote_content.js | |
parent | Initial commit. (diff) | |
download | thunderbird-upstream.tar.xz thunderbird-upstream.zip |
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'widget/tests/browser/browser_test_ime_state_on_readonly_change_in_remote_content.js')
-rw-r--r-- | widget/tests/browser/browser_test_ime_state_on_readonly_change_in_remote_content.js | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/widget/tests/browser/browser_test_ime_state_on_readonly_change_in_remote_content.js b/widget/tests/browser/browser_test_ime_state_on_readonly_change_in_remote_content.js new file mode 100644 index 0000000000..a0c0019328 --- /dev/null +++ b/widget/tests/browser/browser_test_ime_state_on_readonly_change_in_remote_content.js @@ -0,0 +1,68 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* import-globals-from ../file_ime_state_test_helper.js */ +/* import-globals-from ../file_test_ime_state_on_readonly_change.js */ + +Services.scriptloader.loadSubScript( + "chrome://mochitests/content/browser/widget/tests/browser/file_ime_state_test_helper.js", + this +); +Services.scriptloader.loadSubScript( + "chrome://mochitests/content/browser/widget/tests/browser/file_test_ime_state_on_readonly_change.js", + this +); +add_task(async function () { + await BrowserTestUtils.withNewTab( + "https://example.com/browser/widget/tests/browser/file_ime_state_tests.html", + async function (browser) { + const tipWrapper = new TIPWrapper(window); + ok( + tipWrapper.isAvailable(), + "TextInputProcessor should've been initialized" + ); + + const tester = new IMEStateOnReadonlyChangeTester(); + for ( + let i = 0; + i < IMEStateOnReadonlyChangeTester.numberOfTextControlTypes; + i++ + ) { + const expectedResultBefore = await SpecialPowers.spawn( + browser, + [i], + aIndex => { + content.wrappedJSObject.runner = + content.wrappedJSObject.createIMEStateOnReadonlyChangeTester( + aIndex + ); + return content.wrappedJSObject.runner.prepareToRun( + aIndex, + content.window, + content.document.body + ); + } + ); + tester.checkBeforeRun(expectedResultBefore, tipWrapper); + const expectedResultOfMakingTextControlReadonly = + await SpecialPowers.spawn(browser, [], () => { + return content.wrappedJSObject.runner.runToMakeTextControlReadonly(); + }); + tester.checkResultOfMakingTextControlReadonly( + expectedResultOfMakingTextControlReadonly + ); + const expectedResultOfMakingTextControlEditable = + await SpecialPowers.spawn(browser, [], () => { + return content.wrappedJSObject.runner.runToMakeTextControlEditable(); + }); + tester.checkResultOfMakingTextControlEditable( + expectedResultOfMakingTextControlEditable + ); + tipWrapper.clearFocusBlurNotifications(); + tester.clear(); + } + } + ); +}); |