Bug 1696626 - Run ldap mochitests against JS implementation. r=darktrojan

Depends on D117143.

Differential Revision: https://phabricator.services.mozilla.com/D117144

Depends on D117143
This commit is contained in:
Ping Chen 2021-06-08 10:57:44 +00:00
Родитель 5cdece69e0
Коммит c76bd03b92
7 изменённых файлов: 51 добавлений и 5 удалений

Просмотреть файл

@ -65,6 +65,7 @@ class LDAPOperation {
limit,
res => {
if (res.constructor.name == "SearchResultDone") {
this._messageId = null;
this._listener.onLDAPMessage({
errorCode: res.result.resultCode,
type: Ci.nsILDAPMessage.RES_SEARCH_RESULT,
@ -88,7 +89,9 @@ class LDAPOperation {
}
abandonExt() {
this._client.abandon(this._messageId);
if (this._messageId) {
this._client.abandon(this._messageId);
}
}
}

Просмотреть файл

@ -6,6 +6,8 @@
JAR_MANIFESTS += ["jar.mn"]
BROWSER_CHROME_MANIFESTS += [
"test/browser/browser-jsm.ini",
"test/browser/browser.ini",
"test/browser/new/browser-jsm.ini",
"test/browser/new/browser.ini",
]

Просмотреть файл

@ -0,0 +1,16 @@
[DEFAULT]
head = head.js
prefs =
mailnews.ldap.jsmodule=true
mail.provider.suppress_dialog_on_startup=true
mail.spotlight.firstRunDone=true
mail.winsearch.firstRunDone=true
mailnews.start_page.override_url=about:blank
mailnews.start_page.url=about:blank
signon.rememberSignons=true
subsuite = thunderbird
tags = addrbook
dupe-manifest =
[browser_ldap_search.js]
support-files = ../../../../../mailnews/addrbook/test/unit/data/ldap_contacts.json

Просмотреть файл

@ -1,6 +1,7 @@
[DEFAULT]
head = head.js
prefs =
mailnews.ldap.jsmodule=false
mail.provider.suppress_dialog_on_startup=true
mail.spotlight.firstRunDone=true
mail.winsearch.firstRunDone=true
@ -9,6 +10,7 @@ prefs =
signon.rememberSignons=true
subsuite = thunderbird
tags = addrbook
dupe-manifest =
[browser_cardDAV_init.js]
[browser_cardDAV_properties.js]

Просмотреть файл

@ -0,0 +1,16 @@
[DEFAULT]
head = head.js
prefs =
mailnews.ldap.jsmodule=true
mail.provider.suppress_dialog_on_startup=true
mail.spotlight.firstRunDone=true
mail.winsearch.firstRunDone=true
mailnews.start_page.override_url=about:blank
mailnews.start_page.url=about:blank
signon.rememberSignons=true
subsuite = thunderbird
tags = addrbook
dupe-manifest =
[browser_ldap_search.js]
support-files = ../../../../../../mailnews/addrbook/test/unit/data/ldap_contacts.json

Просмотреть файл

@ -1,6 +1,7 @@
[DEFAULT]
head = head.js
prefs =
mailnews.ldap.jsmodule=false
mail.provider.suppress_dialog_on_startup=true
mail.spotlight.firstRunDone=true
mail.winsearch.firstRunDone=true
@ -9,6 +10,7 @@ prefs =
signon.rememberSignons=true
subsuite = thunderbird
tags = addrbook
dupe-manifest =
[browser_cardDAV_init.js]
[browser_cardDAV_properties.js]

Просмотреть файл

@ -22,6 +22,7 @@ var LDAPServer = {
BindRequest: 0x60,
UnbindRequest: 0x42,
SearchRequest: 0x63,
AbandonRequest: 0x50,
serverSocket: null,
@ -89,11 +90,15 @@ var LDAPServer = {
if (expectedOperation) {
let actualOperation = data[index + 1];
// Unbind requests can happen at any point, when an nsLDAPConnection is
// destroyed. This is unpredictable, and irrelevant for testing. Ignore.
if (actualOperation == LDAPServer.UnbindRequest) {
// Unbind and abandon requests can happen at any point, when an
// nsLDAPConnection is destroyed. This is unpredictable, and irrelevant
// for testing. Ignore.
if (
actualOperation == LDAPServer.UnbindRequest ||
actualOperation == LDAPServer.AbandonRequest
) {
if (PRINT_DEBUG) {
console.log("Ignoring unbind request");
console.log("Ignoring unbind or abandon request");
}
return this.read(expectedOperation);
}