зеркало из https://github.com/mozilla/pjs.git
Bug 389655 square in Bind DN field instead national sign. r/sr=Neil
This commit is contained in:
Родитель
cb4ad7b68d
Коммит
30183d0b8e
|
@ -54,7 +54,7 @@ interface nsILDAPURL;
|
|||
* XXX This should really inherit from nsIAbDirectory, and some day it will.
|
||||
* But for now, doing that complicates implementation.
|
||||
*/
|
||||
[scriptable, uuid(684c8f3e-dcd1-4f16-9cfc-f0f77080a249)]
|
||||
[scriptable, uuid(2f689622-3d73-43aa-8580-6a7ba232be2b)]
|
||||
interface nsIAbLDAPDirectory : nsISupports
|
||||
{
|
||||
/**
|
||||
|
@ -77,7 +77,7 @@ interface nsIAbLDAPDirectory : nsISupports
|
|||
/**
|
||||
* The AuthDN to use to access the server.
|
||||
*/
|
||||
attribute ACString authDn;
|
||||
attribute AUTF8String authDn;
|
||||
|
||||
/**
|
||||
* The maximum number of matches that the server will return per a search.
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* Test suite for basic LDAP address book functions
|
||||
*/
|
||||
|
||||
do_import_script("mailnews/test/resources/mailDirService.js");
|
||||
do_import_script("mailnews/addrbook/test/resources/abSetup.js");
|
||||
do_import_script("mailnews/addrbook/test/resources/abCleanup.js");
|
||||
|
||||
const kLDAPDirectory = 0; // defined in nsDirPrefs.h
|
||||
const kLDAPUriPrefix = "moz-abldapdirectory://";
|
||||
const kLDAPTestSpec = "ldap://invalidhost:389//dc=intranet??sub?(objectclass=*)";
|
||||
|
||||
function run_test() {
|
||||
// Test 1 - Create an LDAP directory
|
||||
var abManager = Components.classes["@mozilla.org/abmanager;1"]
|
||||
.getService(Components.interfaces.nsIAbManager);
|
||||
|
||||
var ldapUrl = Components.classes["@mozilla.org/network/ldap-url;1"]
|
||||
.createInstance(Components.interfaces.nsILDAPURL);
|
||||
|
||||
ldapUrl.spec = kLDAPTestSpec;
|
||||
|
||||
var abUri = abManager.newAddressBook("test", ldapUrl.spec, kLDAPDirectory);
|
||||
|
||||
// Test 2 - Check we have the directory.
|
||||
var abDir = abManager.getDirectory(kLDAPUriPrefix + abUri)
|
||||
.QueryInterface(Components.interfaces.nsIAbLDAPDirectory);
|
||||
|
||||
// Test 3 - Check various fields
|
||||
do_check_eq(abDir.dirName, "test");
|
||||
do_check_eq(abDir.lDAPURL.spec, kLDAPTestSpec);
|
||||
|
||||
// Test 4 - Write a UTF-8 Auth DN and check it
|
||||
abDir.authDn = "test\u00D0";
|
||||
|
||||
do_check_eq(abDir.authDn, "test\u00D0");
|
||||
|
||||
cleanup();
|
||||
};
|
Загрузка…
Ссылка в новой задаче