Closed Bug 1679011 Opened 4 years ago Closed 4 years ago

mozmill/utils.jsm, line 155: TypeError: callback.call is not a function

Categories

(MailNews Core :: Security: OpenPGP, defect)

defect

Tracking

(thunderbird_esr78 fixed)

RESOLVED FIXED
85 Branch
Tracking Status
thunderbird_esr78 --- fixed

People

(Reporter: KaiE, Assigned: lasana)

References

Details

Attachments

(1 file, 1 obsolete file)

I see the following output when executing the openpgp tests.

Is this causing a test not execute correctly?

 0:49.31 GECKO(16319) JavaScript error: resource://testing-common/mozmill/utils.jsm, line 155: TypeError: callback.call is not a function
 0:49.31 INFO Console message: [JavaScript Error: "TypeError: callback.call is not a function" {file: "resource://testing-common/mozmill/utils.jsm" line: 155}]
waitFor@resource://testing-common/mozmill/utils.jsm:155:45
MozMillController.prototype.waitFor@resource://testing-common/mozmill/controller.jsm:505:9
testUpdateMessageSignature/<@chrome://mochitests/content/browser/comm/mail/test/browser/openpgp/browser_viewMessage.js:287:9
startTest@resource://testing-common/mozmill/WindowHelpers.jsm:343:16
WindowWatcher_notify@resource://testing-common/mozmill/WindowHelpers.jsm:380:9
openKeyDetails@chrome://openpgp/content/modules/windows.jsm:404:9
viewSignatureKey@chrome://messenger-smime/content/msgReadSMIMEOverlay.js:588:29
oncommand@chrome://messenger/content/messageWindow.xhtml:1:1
synthesizeMouse@resource://testing-common/mozmill/EventUtils.jsm:141:13
MozMillController.prototype.mouseEvent@resource://testing-common/mozmill/controller.jsm:371:16
MozMillController.prototype.click@resource://testing-common/mozmill/controller.jsm:393:10
wrapperFunc@resource://testing-common/mozmill/WindowHelpers.jsm:1343:32
testUpdateMessageSignature@chrome://mochitests/content/browser/comm/mail/test/browser/openpgp/browser_viewMessage.js:292:6

Looks like it's passing the wrong arguments to waitFor. Mochitest does not catch certain javascript errors if I recall correctly. We should probably use BrowserTestUtils instead of the plan_for_modal though.

Assignee: nobody → lasana
Status: NEW → ASSIGNED
Attached patch bug1679011.patch (obsolete) — Splinter Review

Quick fix for the error. Logic not changed, test passed --verify.

Attachment #9189526 - Flags: review?(alessandro)
Comment on attachment 9189526 [details] [diff] [review]
bug1679011.patch

Review of attachment 9189526 [details] [diff] [review]:
-----------------------------------------------------------------

Unfortunately this is not the right fix as I get this error:
```
Console message: [JavaScript Error: "TimeoutError: waitFor: Timeout exceeded for
'()=>dlg.window.document.documentElement.querySelector("dialog").acceptDialog()'"
```
Also, it's not correctly linted.

I had a similar problem in another test and I solved it by waiting for the "unload" event of the subdialog:
https://searchfox.org/comm-central/rev/7e8d6a200456b336bdc593c4bfc699ad077019ea/mail/test/browser/openpgp/browser_keyWizard.js#144-158
Attachment #9189526 - Flags: review?(alessandro) → review-

Apologies, I jumped into this one too quickly. The usage of waitFor was wrong, acceptDialog() does not return anything so it's always false.

I replaced the plan_for_modal_dialog with BrowserTestUtils.domWindowOpened. There is another error showing up related to the usage of waitFor by open_message_from_file, does not appear to affect these tests but I'm looking into it further.

Attachment #9189526 - Attachment is obsolete: true
Attachment #9189646 - Flags: review?(alessandro)
Comment on attachment 9189646 [details] [diff] [review]
bug1679011v2.patch

Review of attachment 9189646 [details] [diff] [review]:
-----------------------------------------------------------------

This works, good job.
Attachment #9189646 - Flags: review?(alessandro) → review+
Target Milestone: --- → 85 Branch

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/4615ee6824ac
Use BrowserTestUtils.domWindowOpened instead of plan_for_modal_dialog when opening key properties dialog. r=aleca

Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED

Comment on attachment 9189646 [details] [diff] [review]
bug1679011v2.patch

[Approval Request Comment]
Regression caused by (bug #):
User impact if declined:
Testing completed (on c-c, etc.):
Risk to taking this patch (and alternatives if risky): low, only affects tests

Fixes a failure during test execution that is observed on comm-esr78, too.

Attachment #9189646 - Flags: approval-comm-esr78?
Blocks: 1682035

Comment on attachment 9189646 [details] [diff] [review]
bug1679011v2.patch

[Triage Comment]
Approved for esr78

Attachment #9189646 - Flags: approval-comm-esr78? → approval-comm-esr78+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: