Add test case for nsIAcceptLang

This commit is contained in:
tao%netscape.com 2000-05-12 21:51:11 +00:00
parent c06ee76d8e
commit bb077d2b78

View File

@ -25,6 +25,7 @@
#include "nsCOMPtr.h"
#include "nsIPersistentProperties2.h"
#include "nsIStringBundle.h"
#include "nsIAcceptLang.h"
#include "nsIEventQueueService.h"
#include "nsILocale.h"
#include <iostream.h>
@ -67,6 +68,9 @@ static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
static NS_DEFINE_IID(kStringBundleServiceCID, NS_STRINGBUNDLESERVICE_CID);
static NS_DEFINE_IID(kIStringBundleServiceIID, NS_ISTRINGBUNDLESERVICE_IID);
static NS_DEFINE_IID(kAcceptLangCID, NS_ACCEPTLANG_CID);
static NS_DEFINE_IID(kIAcceptLangIID, NS_IACCEPTLANG_IID);
////////////////////////////////////////////////////////////////////////////////////////////////////
//
// let add some locale stuff
@ -175,6 +179,15 @@ main(int argc, char *argv[])
return 1;
}
nsIAcceptLang* Aservice = nsnull;
ret = nsServiceManager::GetService(kAcceptLangCID,
kIAcceptLangIID, (nsISupports**) &Aservice);
if (NS_FAILED(ret)) {
printf("cannot create AcceptLang service\n");
return 1;
}
printf("\n ** created AcceptLang service\n");
nsILocale* locale = get_applocale();
nsIStringBundle* bundle = nsnull;