latest testembed update
git-svn-id: svn://10.0.0.236/trunk@103630 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -396,7 +396,7 @@ NS_IMETHODIMP CBrowserImpl::SetVisibility(PRBool aVisibility)
|
||||
}
|
||||
|
||||
//*****************************************************************************
|
||||
// CBrowserImpl::nsIStreamListener (used for nsIRequest tests)
|
||||
// CBrowserImpl::nsIStreamListener (used for nsIRequest)
|
||||
|
||||
NS_IMETHODIMP CBrowserImpl::OnDataAvailable(nsIRequest *request,
|
||||
nsISupports *ctxt, nsIInputStream *input,
|
||||
|
||||
@@ -55,15 +55,8 @@ class CBrowserView;
|
||||
|
||||
NS_IMETHODIMP CBrowserImpl::OnHistoryNewEntry(nsIURI *theUri)
|
||||
{
|
||||
<<<<<<< BrowserImplHistoryLstnr.cpp
|
||||
QAOutput("nsIHistoryListener::OnHistoryNewEntry()", 2);
|
||||
GetTheUri(theUri, 1);
|
||||
=======
|
||||
CQaUtils::QAOutput("nsIHistoryListener::OnHistoryNewEntry()", 2);
|
||||
|
||||
CQaUtils::GetTheUri(theUri, 1);
|
||||
|
||||
>>>>>>> 1.6
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@@ -72,17 +65,10 @@ NS_IMETHODIMP CBrowserImpl::OnHistoryGoBack(nsIURI *theUri, PRBool *notify)
|
||||
{
|
||||
QAOutput("nsIHistoryListener::OnHistoryGoBack()", 2);
|
||||
|
||||
<<<<<<< BrowserImplHistoryLstnr.cpp
|
||||
GetTheUri(theUri, 1);
|
||||
*notify = PR_TRUE;
|
||||
FormatAndPrintOutput("OnHistoryGoBack() notification = ", *notify, 1);
|
||||
|
||||
=======
|
||||
CQaUtils::GetTheUri(theUri, 1);
|
||||
*notify = PR_TRUE;
|
||||
CQaUtils::FormatAndPrintOutput("OnHistoryGoBack() notification = ", *notify, 1);
|
||||
|
||||
>>>>>>> 1.6
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@@ -90,33 +76,19 @@ NS_IMETHODIMP CBrowserImpl::OnHistoryGoForward(nsIURI *theUri, PRBool *notify)
|
||||
{
|
||||
QAOutput("nsIHistoryListener::OnHistoryGoForward()", 2);
|
||||
|
||||
<<<<<<< BrowserImplHistoryLstnr.cpp
|
||||
GetTheUri(theUri, 1);
|
||||
*notify = PR_TRUE;
|
||||
FormatAndPrintOutput("OnHistoryGoForward() notification = ", *notify, 1);
|
||||
|
||||
=======
|
||||
CQaUtils::GetTheUri(theUri, 1);
|
||||
*notify = PR_TRUE;
|
||||
CQaUtils::FormatAndPrintOutput("OnHistoryGoForward() notification = ", *notify, 1);
|
||||
|
||||
>>>>>>> 1.6
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP CBrowserImpl::OnHistoryReload(nsIURI *theUri, PRUint32 reloadFlags, PRBool *notify)
|
||||
{
|
||||
<<<<<<< BrowserImplHistoryLstnr.cpp
|
||||
char flagString[100];
|
||||
|
||||
QAOutput("nsIHistoryListener::OnHistoryReload()", 2);
|
||||
=======
|
||||
char flagString[100];
|
||||
|
||||
CQaUtils::QAOutput("nsIHistoryListener::OnHistoryReload()", 2);
|
||||
>>>>>>> 1.6
|
||||
|
||||
<<<<<<< BrowserImplHistoryLstnr.cpp
|
||||
GetTheUri(theUri, 1);
|
||||
*notify = PR_TRUE;
|
||||
FormatAndPrintOutput("OnHistoryReload() notification = ", *notify, 1);
|
||||
@@ -134,25 +106,6 @@ NS_IMETHODIMP CBrowserImpl::OnHistoryReload(nsIURI *theUri, PRUint32 reloadFlags
|
||||
|
||||
FormatAndPrintOutput("OnHistoryReload() flag = ", flagString, 2);
|
||||
|
||||
=======
|
||||
CQaUtils::GetTheUri(theUri, 1);
|
||||
*notify = PR_TRUE;
|
||||
CQaUtils::FormatAndPrintOutput("OnHistoryReload() notification = ", *notify, 1);
|
||||
|
||||
if (reloadFlags == 0x0000)
|
||||
strcpy(flagString, "LOAD_FLAGS_NONE");
|
||||
else if (reloadFlags == 0x0100)
|
||||
strcpy(flagString, "LOAD_FLAGS_BYPASS_CACHE");
|
||||
else if (reloadFlags == 0x0200)
|
||||
strcpy(flagString, "LOAD_FLAGS_BYPASS_PROXY");
|
||||
else if (reloadFlags == 0x0400)
|
||||
strcpy(flagString, "LOAD_FLAGS_CHARSET_CHANGE");
|
||||
else if (reloadFlags == (0x0200 | 0x0400))
|
||||
strcpy(flagString, "LOAD_RELOAD_BYPASS_PROXY_AND_CACHE");
|
||||
|
||||
CQaUtils::FormatAndPrintOutput("OnHistoryReload() flag = ", flagString, 2);
|
||||
|
||||
>>>>>>> 1.6
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@@ -160,21 +113,12 @@ NS_IMETHODIMP CBrowserImpl::OnHistoryGotoIndex(PRInt32 theIndex, nsIURI *theUri,
|
||||
{
|
||||
QAOutput("nsIHistoryListener::OnHistoryGotoIndex()", 2);
|
||||
|
||||
<<<<<<< BrowserImplHistoryLstnr.cpp
|
||||
GetTheUri(theUri, 1);
|
||||
*notify = PR_TRUE;
|
||||
FormatAndPrintOutput("OnHistoryGotoIndex() notification = ", *notify, 1);
|
||||
|
||||
FormatAndPrintOutput("OnHistoryGotoIndex() index = ", theIndex, 2);
|
||||
|
||||
=======
|
||||
CQaUtils::GetTheUri(theUri, 1);
|
||||
*notify = PR_TRUE;
|
||||
CQaUtils::FormatAndPrintOutput("OnHistoryGotoIndex() notification = ", *notify, 1);
|
||||
|
||||
CQaUtils::FormatAndPrintOutput("OnHistoryGotoIndex() index = ", theIndex, 2);
|
||||
|
||||
>>>>>>> 1.6
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@@ -182,19 +126,11 @@ NS_IMETHODIMP CBrowserImpl::OnHistoryPurge(PRInt32 theNumEntries, PRBool *notify
|
||||
{
|
||||
QAOutput("nsIHistoryListener::OnHistoryPurge()", 2);
|
||||
|
||||
<<<<<<< BrowserImplHistoryLstnr.cpp
|
||||
*notify = PR_TRUE;
|
||||
FormatAndPrintOutput("OnHistoryPurge() notification = ", *notify, 1);
|
||||
|
||||
FormatAndPrintOutput("OnHistoryGotoIndex() theNumEntries = ", theNumEntries, 2);
|
||||
|
||||
=======
|
||||
*notify = PR_TRUE;
|
||||
CQaUtils::FormatAndPrintOutput("OnHistoryPurge() notification = ", *notify, 1);
|
||||
|
||||
CQaUtils::FormatAndPrintOutput("OnHistoryGotoIndex() theNumEntries = ", theNumEntries, 2);
|
||||
|
||||
>>>>>>> 1.6
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -61,8 +61,6 @@
|
||||
// Print Includes
|
||||
#include "PrintProgressDialog.h"
|
||||
|
||||
// Mozilla Includes
|
||||
#include "nsIWidget.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
@@ -467,9 +465,9 @@ void CBrowserView::OnNavReload()
|
||||
}
|
||||
|
||||
void CBrowserView::OnNavStop()
|
||||
{
|
||||
if(mWebNav)
|
||||
mWebNav->Stop(nsIWebNavigation::STOP_ALL);
|
||||
{
|
||||
if(mWebNav)
|
||||
mWebNav->Stop();
|
||||
}
|
||||
|
||||
void CBrowserView::OnUpdateNavStop(CCmdUI* pCmdUI)
|
||||
|
||||
@@ -57,13 +57,8 @@ nsresult CProfileMgr::StartUp()
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
<<<<<<< ProfileMgr.cpp
|
||||
//NS_WITH_SERVICE(nsIProfile, profileService, NS_PROFILE_CONTRACTID, &rv);
|
||||
nsCOMPtr<nsIProfile> profileService(do_GetService(NS_PROFILE_CONTRACTID,&rv));
|
||||
=======
|
||||
nsCOMPtr<nsIProfile> profileService =
|
||||
do_GetService(NS_PROFILE_CONTRACTID, &rv);
|
||||
>>>>>>> 1.3
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
PRInt32 profileCount;
|
||||
@@ -121,15 +116,9 @@ nsresult CProfileMgr::DoManageProfilesDialog(PRBool bAtStartUp)
|
||||
{
|
||||
SetShowDialogOnStart(dialog.m_bAskAtStartUp);
|
||||
|
||||
<<<<<<< ProfileMgr.cpp
|
||||
//NS_WITH_SERVICE(nsIProfile, profileService, NS_PROFILE_CONTRACTID, &rv);
|
||||
nsCOMPtr<nsIProfile> profileService(do_GetService(NS_PROFILE_CONTRACTID,&rv));
|
||||
if (NS_FAILED(rv))
|
||||
=======
|
||||
nsCOMPtr<nsIProfile> profileService =
|
||||
do_GetService(NS_PROFILE_CONTRACTID, &rv);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
>>>>>>> 1.3
|
||||
rv = profileService->SetCurrentProfile(dialog.m_SelectedProfile.get());
|
||||
}
|
||||
return NS_OK;
|
||||
|
||||
@@ -25,13 +25,8 @@ static void ValidateProfileName(const CString& profileName, CDataExchange* pDX)
|
||||
PRBool exists = FALSE;
|
||||
|
||||
{
|
||||
<<<<<<< ProfilesDlg.cpp
|
||||
//NS_WITH_SERVICE(nsIProfile, profileService, NS_PROFILE_CONTRACTID, &rv);
|
||||
nsCOMPtr<nsIProfile> profileService(do_GetService(NS_PROFILE_CONTRACTID));
|
||||
=======
|
||||
nsCOMPtr<nsIProfile> profileService =
|
||||
do_GetService(NS_PROFILE_CONTRACTID, &rv);
|
||||
>>>>>>> 1.2
|
||||
rv = profileService->ProfileExists(T2W(profileName), &exists);
|
||||
}
|
||||
|
||||
@@ -189,13 +184,8 @@ BOOL CProfilesDlg::OnInitDialog()
|
||||
|
||||
// Fill the list of profiles
|
||||
nsresult rv;
|
||||
<<<<<<< ProfilesDlg.cpp
|
||||
//NS_WITH_SERVICE(nsIProfile, profileService, NS_PROFILE_CONTRACTID, &rv);
|
||||
nsCOMPtr<nsIProfile> profileService(do_GetService(NS_PROFILE_CONTRACTID));
|
||||
=======
|
||||
nsCOMPtr<nsIProfile> profileService =
|
||||
do_GetService(NS_PROFILE_CONTRACTID, &rv);
|
||||
>>>>>>> 1.2
|
||||
profileService->GetCurrentProfile(getter_Copies(curProfileName));
|
||||
|
||||
PRInt32 selectedRow = 0;
|
||||
@@ -230,13 +220,8 @@ void CProfilesDlg::OnNewProfile()
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
<<<<<<< ProfilesDlg.cpp
|
||||
//NS_WITH_SERVICE(nsIProfile, profileService, NS_PROFILE_CONTRACTID, &rv);
|
||||
nsCOMPtr<nsIProfile> profileService(do_GetService(NS_PROFILE_CONTRACTID,&rv));
|
||||
=======
|
||||
nsCOMPtr<nsIProfile> profileService =
|
||||
do_GetService(NS_PROFILE_CONTRACTID, &rv);
|
||||
>>>>>>> 1.2
|
||||
ASSERT(NS_SUCCEEDED(rv));
|
||||
if (NS_SUCCEEDED(rv))
|
||||
{
|
||||
@@ -271,13 +256,8 @@ void CProfilesDlg::OnRenameProfile()
|
||||
|
||||
nsresult rv;
|
||||
|
||||
<<<<<<< ProfilesDlg.cpp
|
||||
//NS_WITH_SERVICE(nsIProfile, profileService, NS_PROFILE_CONTRACTID, &rv);
|
||||
nsCOMPtr<nsIProfile> profileService(do_GetService(NS_PROFILE_CONTRACTID,&rv));
|
||||
=======
|
||||
nsCOMPtr<nsIProfile> profileService =
|
||||
do_GetService(NS_PROFILE_CONTRACTID, &rv);
|
||||
>>>>>>> 1.2
|
||||
ASSERT(NS_SUCCEEDED(rv));
|
||||
if (NS_SUCCEEDED(rv))
|
||||
{
|
||||
@@ -298,14 +278,9 @@ void CProfilesDlg::OnDeleteProfile()
|
||||
m_ProfileList.GetText(itemIndex, selectedProfile);
|
||||
|
||||
nsresult rv;
|
||||
<<<<<<< ProfilesDlg.cpp
|
||||
//NS_WITH_SERVICE(nsIProfile, profileService, NS_PROFILE_CONTRACTID, &rv);
|
||||
nsCOMPtr<nsIProfile> profileService(do_GetService(NS_PROFILE_CONTRACTID,&rv));
|
||||
|
||||
=======
|
||||
nsCOMPtr<nsIProfile> profileService =
|
||||
do_GetService(NS_PROFILE_CONTRACTID, &rv);
|
||||
>>>>>>> 1.2
|
||||
ASSERT(NS_SUCCEEDED(rv));
|
||||
if (NS_SUCCEEDED(rv))
|
||||
{
|
||||
|
||||
@@ -207,7 +207,6 @@ void WebProgDOMWindowTest(nsIWebProgress *progress, const char *inString,
|
||||
else
|
||||
RvTestResult(rv, totalStr2, displayMethod);
|
||||
}
|
||||
<<<<<<< QaUtils.cpp
|
||||
|
||||
void GetTheUri(nsIURI *theUri, int displayMethod)
|
||||
{
|
||||
@@ -284,15 +283,3 @@ void CShowTestResults::AddItemToList(LPCTSTR szTestCaseName, BOOL bResult)
|
||||
//m_ListResults.InsertItem(&lvitem);
|
||||
|
||||
}
|
||||
=======
|
||||
|
||||
void CQaUtils::GetTheUri(nsIURI *theUri, int displayMethod)
|
||||
{
|
||||
nsresult rv;
|
||||
char *uriSpec;
|
||||
|
||||
rv = theUri->GetSpec(&uriSpec);
|
||||
RvTestResult(rv, "nsIURI::GetSpec() test", displayMethod);
|
||||
FormatAndPrintOutput("the uri = ", uriSpec, displayMethod);
|
||||
}
|
||||
>>>>>>> 1.7
|
||||
|
||||
@@ -59,7 +59,6 @@ public:
|
||||
CShowTestResults(CWnd* pParent = NULL); // standard constructor
|
||||
void AddItemToList(LPCTSTR szTestCaseName, BOOL bResult);
|
||||
|
||||
<<<<<<< QaUtils.h
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CShowTestResults)
|
||||
enum { IDD = IDD_RUNTESTSDLG };
|
||||
@@ -78,17 +77,6 @@ public:
|
||||
private:
|
||||
LPCTSTR m_TitleString ;
|
||||
protected:
|
||||
=======
|
||||
void static RvTestResult(nsresult, const char *, int displayMethod=1);
|
||||
void static WriteToOutputFile(const char *);
|
||||
void static QAOutput(const char *pLine, int displayMethod=1);
|
||||
void static FormatAndPrintOutput(const char *, const char *, int);
|
||||
void static FormatAndPrintOutput(const char *, int, int);
|
||||
void static RequestName(nsIRequest *, nsCString &, int displayMethod=1);
|
||||
void static WebProgDOMWindowTest(nsIWebProgress *, const char *,
|
||||
int displayMethod=1);
|
||||
void static GetTheUri(nsIURI *, int displayMethod=1);
|
||||
>>>>>>> 1.8
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CShowTestResults)
|
||||
|
||||
@@ -59,7 +59,6 @@
|
||||
#include "nsIWebProgress.h"
|
||||
#include "nsIWindowCreator.h"
|
||||
#include "nsIInterfaceRequestor.h"
|
||||
#include "nsIInterfaceRequestorUtils.h"
|
||||
#include "nsIDocShellTreeOwner.h"
|
||||
#include "nsIDocShellTreeItem.h"
|
||||
#include "nsIClipboardCommands.h"
|
||||
@@ -101,7 +100,6 @@
|
||||
#include "nsIDOMDocumentType.h"
|
||||
#include "nsIURIContentListener.h"
|
||||
#include "nsIHelperAppLauncherDialog.h"
|
||||
<<<<<<< StdAfx.h
|
||||
|
||||
#include "nsIDOMWindow.h"
|
||||
#include "nsIDOMRange.h"
|
||||
@@ -109,9 +107,6 @@
|
||||
#include "nsIDOMWindowCollection.h"
|
||||
#include "nsISelection.h"
|
||||
#include "nsITooltipListener.h"
|
||||
=======
|
||||
//#include "nsIStreamObserver.h"
|
||||
>>>>>>> 1.8
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
@@ -447,15 +447,11 @@ void CTestEmbedApp::OnEditPreferences()
|
||||
|
||||
// Save these changes to disk now
|
||||
nsresult rv;
|
||||
<<<<<<< TestEmbed.cpp
|
||||
|
||||
//NS_WITH_SERVICE(nsIPref, prefs, NS_PREF_CONTRACTID, &rv);
|
||||
|
||||
nsCOMPtr<nsIPref> prefs(do_GetService(NS_PREF_CONTRACTID,&rv));
|
||||
|
||||
=======
|
||||
nsCOMPtr<nsIPref> prefs(do_GetService(NS_PREF_CONTRACTID, &rv));
|
||||
>>>>>>> 1.5
|
||||
if (NS_SUCCEEDED(rv))
|
||||
{
|
||||
prefs->SetIntPref("browser.startup.page", m_iStartupPage);
|
||||
@@ -474,16 +470,7 @@ BOOL CTestEmbedApp::InitializeProfiles()
|
||||
if (!m_ProfileMgr)
|
||||
return FALSE;
|
||||
|
||||
<<<<<<< TestEmbed.cpp
|
||||
nsresult rv;
|
||||
=======
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIObserverService> observerService =
|
||||
do_GetService(NS_OBSERVERSERVICE_CONTRACTID, &rv);
|
||||
observerService->AddObserver(this, NS_LITERAL_STRING("profile-approve-change").get());
|
||||
observerService->AddObserver(this, NS_LITERAL_STRING("profile-change-teardown").get());
|
||||
observerService->AddObserver(this, NS_LITERAL_STRING("profile-after-change").get());
|
||||
>>>>>>> 1.5
|
||||
|
||||
//NS_WITH_SERVICE(nsIObserverService, observerService, NS_OBSERVERSERVICE_CONTRACTID, &rv);
|
||||
|
||||
@@ -521,14 +508,10 @@ BOOL CTestEmbedApp::CreateHiddenWindow()
|
||||
nsresult CTestEmbedApp::InitializePrefs()
|
||||
{
|
||||
nsresult rv;
|
||||
<<<<<<< TestEmbed.cpp
|
||||
//NS_WITH_SERVICE(nsIPref, prefs, NS_PREF_CONTRACTID, &rv);
|
||||
|
||||
nsCOMPtr<nsIPref> prefs(do_GetService(NS_PREF_CONTRACTID,&rv));
|
||||
|
||||
=======
|
||||
nsCOMPtr<nsIPref> prefs(do_GetService(NS_PREF_CONTRACTID, &rv));
|
||||
>>>>>>> 1.5
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
|
||||
// We are using the default prefs from mozilla. If you were
|
||||
|
||||
@@ -179,15 +179,8 @@ void CTests::OnTestsChangeUrl()
|
||||
strcpy(theUrl, myDialog.m_urlfield);
|
||||
rv = qaWebNav->LoadURI(NS_ConvertASCIItoUCS2(theUrl).get(),
|
||||
nsIWebNavigation::LOAD_FLAGS_BYPASS_HISTORY);
|
||||
<<<<<<< Tests.cpp
|
||||
RvTestResult(rv, "rv LoadURI() test", 1);
|
||||
FormatAndPrintOutput("The url = ", theUrl, 2);
|
||||
=======
|
||||
// LOAD_FLAGS_NONE
|
||||
// LOAD_FLAGS_BYPASS_HISTORY
|
||||
CQaUtils::RvTestResult(rv, "rv LoadURI() test", 1);
|
||||
CQaUtils::FormatAndPrintOutput("The url = ", theUrl, 2);
|
||||
>>>>>>> 1.16
|
||||
|
||||
/*
|
||||
char *uriSpec;
|
||||
@@ -323,16 +316,9 @@ void CTests::OnTestsCreateprofile()
|
||||
|
||||
if (myDialog.DoModal() == IDOK)
|
||||
{
|
||||
<<<<<<< Tests.cpp
|
||||
// NS_WITH_SERVICE(nsIProfile, profileService, NS_PROFILE_CONTRACTID, &rv);
|
||||
nsCOMPtr<nsIProfile> theProfServ(do_GetService(NS_PROFILE_CONTRACTID,&rv));
|
||||
if (NS_FAILED(rv))
|
||||
=======
|
||||
// nsCOMPtr<nsIProfile> profileService =
|
||||
// do_GetService(NS_PROFILE_CONTRACTID, &rv);
|
||||
nsCOMPtr<nsIProfile> theProfServ(do_GetService(NS_PROFILE_CONTRACTID));
|
||||
if (!theProfServ)
|
||||
>>>>>>> 1.16
|
||||
{
|
||||
QAOutput("Didn't get profile service. No profile tests performed.", 2);
|
||||
return;
|
||||
@@ -451,8 +437,6 @@ void CTests::OnToolsRemoveAllGH()
|
||||
void CTests::OnToolsTestYourMethod()
|
||||
{
|
||||
// place your test code here
|
||||
|
||||
GoToIndexTest();
|
||||
}
|
||||
|
||||
// ***********************************************************************
|
||||
@@ -584,695 +568,12 @@ void CTests::FileMoveTest(nsILocalFile *theTestFile, nsILocalFile *theFileOpDir)
|
||||
rv = theTestFile->InitWithPath("c:\\Program Files\\myFile2.txt");
|
||||
rv = theTestFile->Exists(&exists);
|
||||
if (!exists)
|
||||
<<<<<<< Tests.cpp
|
||||
QAOutput("File wasn't moved. MoveTo() test Failed.", 2);
|
||||
=======
|
||||
CQaUtils::QAOutput("File wasn't moved. MoveTo() test Failed.", 2);
|
||||
else
|
||||
CQaUtils::QAOutput("File was moved. MoveTo() test Passed.", 2);
|
||||
}
|
||||
|
||||
// ***********************************************************************
|
||||
// ***********************************************************************
|
||||
// nsISHistory & nsIHistoryEntry ifaces:
|
||||
|
||||
void CTests::OnInterfacesNsishistory()
|
||||
{
|
||||
nsresult rv;
|
||||
PRInt32 numEntries = 5;
|
||||
PRInt32 theIndex;
|
||||
PRInt32 theMaxLength = 100;
|
||||
|
||||
CString shString;
|
||||
|
||||
nsCOMPtr<nsISHistory> theSessionHistory;
|
||||
nsCOMPtr<nsIHistoryEntry> theHistoryEntry;
|
||||
nsCOMPtr<nsIURI> theUri;
|
||||
// do_QueryInterface
|
||||
// NS_HISTORYENTRY_CONTRACTID
|
||||
// NS_SHISTORYLISTENER_CONTRACTID
|
||||
|
||||
// get Session History through web nav iface
|
||||
if (qaWebNav)
|
||||
qaWebNav->GetSessionHistory( getter_AddRefs(theSessionHistory));
|
||||
|
||||
if (!theSessionHistory)
|
||||
{
|
||||
CQaUtils::QAOutput("theSessionHistory object wasn't created. No session history tests performed.", 2);
|
||||
return;
|
||||
}
|
||||
else
|
||||
CQaUtils::QAOutput("theSessionHistory object was created.", 2);
|
||||
|
||||
|
||||
// test count attribute in nsISHistory.idl
|
||||
GetCountTest(theSessionHistory, &numEntries);
|
||||
|
||||
// test index attribute in nsISHistory.idl
|
||||
GetIndexTest(theSessionHistory, &theIndex);
|
||||
|
||||
// test maxLength attribute in nsISHistory.idl
|
||||
SetMaxLengthTest(theSessionHistory, theMaxLength);
|
||||
GetMaxLengthTest(theSessionHistory, &theMaxLength);
|
||||
|
||||
CQaUtils::QAOutput("Start nsiHistoryEntry tests.", 2);
|
||||
|
||||
// get theHistoryEntry object
|
||||
theSessionHistory->GetEntryAtIndex(0, PR_FALSE, getter_AddRefs(theHistoryEntry));
|
||||
if (!theHistoryEntry)
|
||||
CQaUtils::QAOutput("We didn't get the History Entry object. No hist entry tests performed.", 1);
|
||||
else
|
||||
{
|
||||
CQaUtils::QAOutput("We have the History Entry object!", 1);
|
||||
|
||||
// getEntryAtIndex() tests
|
||||
for (theIndex = 0; theIndex < numEntries; theIndex++)
|
||||
{
|
||||
CQaUtils::FormatAndPrintOutput("the index = ", theIndex, 2);
|
||||
|
||||
// GetEntryAtIndexTest(theSessionHistory, theHistoryEntry, theIndex);
|
||||
theSessionHistory->GetEntryAtIndex(theIndex, PR_FALSE, getter_AddRefs(theHistoryEntry));
|
||||
// nsiHistoryEntry.idl tests
|
||||
|
||||
// test URI attribute in nsIHistoryEntry.idl
|
||||
GetURIHistTest(theHistoryEntry);
|
||||
|
||||
// test title attribute in nsIHistoryEntry.idl
|
||||
GetTitleHistTest(theHistoryEntry);
|
||||
|
||||
// test isSubFrame attribute in nsIHistoryEntry.idl
|
||||
GetIsSubFrameTest(theHistoryEntry);
|
||||
|
||||
} // end for loop
|
||||
} // end outer else
|
||||
|
||||
|
||||
// test SHistoryEnumerator attribute in nsISHistory.idl
|
||||
nsCOMPtr<nsISimpleEnumerator> theSimpleEnum;
|
||||
|
||||
// GetSHEnumTest(theSessionHistory, theSimpleEnum);
|
||||
|
||||
rv = theSessionHistory->GetSHistoryEnumerator(getter_AddRefs(theSimpleEnum));
|
||||
if (!theSimpleEnum)
|
||||
CQaUtils::QAOutput("theSimpleEnum for GetSHistoryEnumerator() invalid. Test failed.", 1);
|
||||
else
|
||||
CQaUtils::RvTestResult(rv, "GetSHistoryEnumerator() (SHistoryEnumerator attribute) test", 2);
|
||||
|
||||
SimpleEnumTest(theSimpleEnum);
|
||||
|
||||
// PurgeHistory() test
|
||||
|
||||
PurgeHistoryTest(theSessionHistory, numEntries);
|
||||
}
|
||||
|
||||
// ***********************************************************************
|
||||
// Individual nsISHistory tests
|
||||
|
||||
void CTests::GetCountTest(nsISHistory *theSessionHistory, PRInt32 *numEntries)
|
||||
{
|
||||
rv = theSessionHistory->GetCount(numEntries);
|
||||
if (*numEntries < 0)
|
||||
CQaUtils::QAOutput("numEntries for GetCount() is < 0. Test failed.", 1);
|
||||
else {
|
||||
CQaUtils::FormatAndPrintOutput("number of entries = ", *numEntries, 2);
|
||||
CQaUtils::RvTestResult(rv, "GetCount() (count attribute) test", 2);
|
||||
}
|
||||
}
|
||||
|
||||
void CTests::GetIndexTest(nsISHistory *theSessionHistory, PRInt32 *theIndex)
|
||||
{
|
||||
rv = theSessionHistory->GetIndex(theIndex);
|
||||
if (*theIndex < 0)
|
||||
CQaUtils::QAOutput("theIndex for GetIndex() is < 0. Test failed.", 1);
|
||||
else
|
||||
CQaUtils::RvTestResult(rv, "GetIndex() (index attribute) test", 2);
|
||||
}
|
||||
|
||||
void CTests::SetMaxLengthTest(nsISHistory *theSessionHistory, PRInt32 theMaxLength)
|
||||
{
|
||||
rv = theSessionHistory->SetMaxLength(theMaxLength);
|
||||
CQaUtils::RvTestResult(rv, "SetMaxLength() (MaxLength attribute) test", 2);
|
||||
}
|
||||
|
||||
void CTests::GetMaxLengthTest(nsISHistory *theSessionHistory, PRInt32 *theMaxLength)
|
||||
{
|
||||
rv = theSessionHistory->GetMaxLength(theMaxLength);
|
||||
if (*theMaxLength < 0)
|
||||
CQaUtils::QAOutput("theMaxLength for GetMaxLength() < 0. Test failed.", 1);
|
||||
else {
|
||||
CQaUtils::FormatAndPrintOutput("theMaxLength = ", *theMaxLength, 2);
|
||||
CQaUtils::RvTestResult(rv, "GetMaxLength() (MaxLength attribute) test", 2);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
void CTests::GetEntryAtIndexTest(nsISHistory *theSessionHistory,
|
||||
nsIHistoryEntry *theHistoryEntry,
|
||||
PRInt32 theIndex)
|
||||
{
|
||||
theSessionHistory->GetEntryAtIndex(theIndex, PR_FALSE, getter_AddRefs(theHistoryEntry));
|
||||
}
|
||||
*/
|
||||
|
||||
void CTests::GetURIHistTest(nsIHistoryEntry* theHistoryEntry)
|
||||
{
|
||||
rv = theHistoryEntry->GetURI(getter_AddRefs(theUri));
|
||||
if (!theUri)
|
||||
CQaUtils::QAOutput("theUri for GetURI() invalid. Test failed.", 1);
|
||||
>>>>>>> 1.16
|
||||
else
|
||||
QAOutput("File was moved. MoveTo() test Passed.", 2);
|
||||
}
|
||||
|
||||
<<<<<<< Tests.cpp
|
||||
=======
|
||||
void CTests::GetTitleHistTest(nsIHistoryEntry* theHistoryEntry)
|
||||
{
|
||||
nsXPIDLString theTitle;
|
||||
const char * titleCString;
|
||||
|
||||
rv = theHistoryEntry->GetTitle(getter_Copies(theTitle));
|
||||
if (!theTitle) {
|
||||
CQaUtils::QAOutput("theTitle for GetTitle() is blank. Test failed.", 1);
|
||||
return;
|
||||
}
|
||||
else
|
||||
CQaUtils::RvTestResult(rv, "GetTitle() (title attribute) test", 1);
|
||||
titleCString = NS_ConvertUCS2toUTF8(theTitle).get();
|
||||
CQaUtils::FormatAndPrintOutput("The title = ", (char *)titleCString, 2);
|
||||
|
||||
}
|
||||
|
||||
void CTests::GetIsSubFrameTest(nsIHistoryEntry* theHistoryEntry)
|
||||
{
|
||||
PRBool isSubFrame;
|
||||
|
||||
rv = theHistoryEntry->GetIsSubFrame(&isSubFrame);
|
||||
CQaUtils::RvTestResult(rv, "GetIsSubFrame() (isSubFrame attribute) test", 1);
|
||||
CQaUtils::FormatAndPrintOutput("The subFrame boolean value = ", isSubFrame, 2);
|
||||
}
|
||||
|
||||
/*
|
||||
void CTests::GetSHEnumTest(nsISHistory *theSessionHistory,
|
||||
nsISimpleEnumerator *theSimpleEnum)
|
||||
{
|
||||
rv = theSessionHistory->GetSHistoryEnumerator(getter_AddRefs(theSimpleEnum));
|
||||
if (!theSimpleEnum)
|
||||
CQaUtils::QAOutput("theSimpleEnum for GetSHistoryEnumerator() invalid. Test failed.", 1);
|
||||
else
|
||||
CQaUtils::RvTestResult(rv, "GetSHistoryEnumerator() (SHistoryEnumerator attribute) test", 2);
|
||||
}
|
||||
*/
|
||||
|
||||
void CTests::SimpleEnumTest(nsISimpleEnumerator *theSimpleEnum)
|
||||
{
|
||||
PRBool bMore = PR_FALSE;
|
||||
nsCOMPtr<nsISupports> nextObj;
|
||||
nsCOMPtr<nsIHistoryEntry> nextHistoryEntry;
|
||||
|
||||
while (NS_SUCCEEDED(theSimpleEnum->HasMoreElements(&bMore)) && bMore)
|
||||
{
|
||||
theSimpleEnum->GetNext(getter_AddRefs(nextObj));
|
||||
if (!nextObj)
|
||||
continue;
|
||||
nextHistoryEntry = do_QueryInterface(nextObj);
|
||||
if (!nextHistoryEntry)
|
||||
continue;
|
||||
rv = nextHistoryEntry->GetURI(getter_AddRefs(theUri));
|
||||
rv = theUri->GetSpec(&uriSpec);
|
||||
if (!uriSpec)
|
||||
CQaUtils::QAOutput("uriSpec for GetSpec() invalid. Test failed.", 1);
|
||||
else
|
||||
CQaUtils::FormatAndPrintOutput("The SimpleEnum URL = ", uriSpec, 2);
|
||||
}
|
||||
}
|
||||
|
||||
void CTests::PurgeHistoryTest(nsISHistory* theSessionHistory, PRInt32 numEntries)
|
||||
{
|
||||
rv = theSessionHistory->PurgeHistory(numEntries);
|
||||
CQaUtils::RvTestResult(rv, "PurgeHistory() test", 2);
|
||||
CQaUtils::FormatAndPrintOutput("Number of entries removed = ", numEntries, 2);
|
||||
}
|
||||
|
||||
>>>>>>> 1.16
|
||||
// ***********************************************************************
|
||||
<<<<<<< Tests.cpp
|
||||
=======
|
||||
// ***********************************************************************
|
||||
// nsIWebNavigation iface
|
||||
|
||||
// Url table for web navigation
|
||||
NavElement UrlTable[] = {
|
||||
{"http://www.yahoo.com/", nsIWebNavigation::LOAD_FLAGS_NONE},
|
||||
{"http://www.oracle.com/", nsIWebNavigation::LOAD_FLAGS_NONE},
|
||||
{"http://www.sun.com/", nsIWebNavigation::LOAD_FLAGS_IS_REFRESH},
|
||||
{"http://www.netscape.com/", nsIWebNavigation::LOAD_FLAGS_IS_LINK},
|
||||
{"http://www.aol.com/", nsIWebNavigation::LOAD_FLAGS_REPLACE_HISTORY}
|
||||
};
|
||||
|
||||
void CTests::OnInterfacesNsiwebnav()
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
if (qaWebNav)
|
||||
CQaUtils::QAOutput("We have the web nav object.", 2);
|
||||
else {
|
||||
CQaUtils::QAOutput("We don't have the web nav object. No tests performed.", 2);
|
||||
return;
|
||||
}
|
||||
|
||||
// canGoBack attribute test
|
||||
CanGoBackTest();
|
||||
|
||||
// GoBack test
|
||||
GoBackTest();
|
||||
|
||||
// canGoForward attribute test
|
||||
CanGoForwardTest();
|
||||
|
||||
// GoForward test
|
||||
GoForwardTest();
|
||||
|
||||
// GotoIndex test
|
||||
GoToIndexTest();
|
||||
|
||||
// LoadURI() & reload tests
|
||||
|
||||
CQaUtils::QAOutput("Run a few LoadURI() tests.", 2);
|
||||
|
||||
for (i=0; i < 5; i++)
|
||||
{
|
||||
LoadUriTest(UrlTable[i].theUri, UrlTable[i].theFlag);
|
||||
switch (i)
|
||||
{
|
||||
case 0:
|
||||
ReloadTest(nsIWebNavigation::LOAD_FLAGS_NONE);
|
||||
break;
|
||||
case 1:
|
||||
ReloadTest(nsIWebNavigation::LOAD_FLAGS_BYPASS_CACHE);
|
||||
break;
|
||||
case 2:
|
||||
ReloadTest(nsIWebNavigation::LOAD_FLAGS_BYPASS_PROXY);
|
||||
break;
|
||||
// simulate shift-reload
|
||||
case 3:
|
||||
ReloadTest(nsIWebNavigation::LOAD_FLAGS_BYPASS_CACHE |
|
||||
nsIWebNavigation::LOAD_FLAGS_BYPASS_PROXY);
|
||||
break;
|
||||
case 4:
|
||||
ReloadTest(nsIWebNavigation::LOAD_FLAGS_CHARSET_CHANGE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Stop() test
|
||||
StopUriTest("http://www.microsoft.com/");
|
||||
|
||||
// document test
|
||||
GetDocumentTest();
|
||||
|
||||
// uri test
|
||||
GetCurrentURITest();
|
||||
|
||||
// session history test
|
||||
GetSHTest();
|
||||
}
|
||||
|
||||
// ***********************************************************************
|
||||
// Individual nsIWebNavigation tests
|
||||
|
||||
void CTests::CanGoBackTest()
|
||||
{
|
||||
PRBool canGoBack = PR_FALSE;
|
||||
rv = qaWebNav->GetCanGoBack(&canGoBack);
|
||||
CQaUtils::RvTestResult(rv, "GetCanGoBack() attribute test", 2);
|
||||
CQaUtils::FormatAndPrintOutput("canGoBack value = ", canGoBack, 2);
|
||||
}
|
||||
|
||||
void CTests::GoBackTest()
|
||||
{
|
||||
rv = qaWebNav->GoBack();
|
||||
CQaUtils::RvTestResult(rv, "GoBack() test", 2);
|
||||
}
|
||||
|
||||
void CTests::CanGoForwardTest()
|
||||
{
|
||||
PRBool canGoForward = PR_FALSE;
|
||||
rv = qaWebNav->GetCanGoForward(&canGoForward);
|
||||
CQaUtils::RvTestResult(rv, "GetCanGoForward() attribute test", 2);
|
||||
CQaUtils::FormatAndPrintOutput("canGoForward value = ", canGoForward, 2);
|
||||
}
|
||||
|
||||
void CTests::GoForwardTest()
|
||||
{
|
||||
rv = qaWebNav->GoForward();
|
||||
CQaUtils::RvTestResult(rv, "GoForward() test", 2);
|
||||
}
|
||||
|
||||
void CTests::GoToIndexTest()
|
||||
{
|
||||
PRInt32 theIndex = 0;
|
||||
|
||||
rv = qaWebNav->GotoIndex(theIndex);
|
||||
CQaUtils::RvTestResult(rv, "GotoIndex() test", 2);
|
||||
}
|
||||
|
||||
void CTests::LoadUriTest(char *theUrl, const unsigned long theFlag)
|
||||
{
|
||||
char theTotalString[500];
|
||||
char theFlagName[100];
|
||||
|
||||
switch(theFlag)
|
||||
{
|
||||
case nsIWebNavigation::LOAD_FLAGS_NONE:
|
||||
strcpy(theFlagName, "LOAD_FLAGS_NONE");
|
||||
break;
|
||||
case nsIWebNavigation::LOAD_FLAGS_MASK:
|
||||
strcpy(theFlagName, "LOAD_FLAGS_MASK");
|
||||
break;
|
||||
case nsIWebNavigation::LOAD_FLAGS_IS_REFRESH:
|
||||
strcpy(theFlagName, "LOAD_FLAGS_IS_REFRESH");
|
||||
break;
|
||||
case nsIWebNavigation::LOAD_FLAGS_IS_LINK:
|
||||
strcpy(theFlagName, "LOAD_FLAGS_IS_LINK");
|
||||
break;
|
||||
case nsIWebNavigation::LOAD_FLAGS_BYPASS_HISTORY:
|
||||
strcpy(theFlagName, "LOAD_FLAGS_BYPASS_HISTORY");
|
||||
break;
|
||||
case nsIWebNavigation::LOAD_FLAGS_REPLACE_HISTORY:
|
||||
strcpy(theFlagName, "LOAD_FLAGS_REPLACE_HISTORY");
|
||||
break;
|
||||
case nsIWebNavigation::LOAD_FLAGS_BYPASS_CACHE:
|
||||
strcpy(theFlagName, "LOAD_FLAGS_BYPASS_CACHE");
|
||||
break;
|
||||
case nsIWebNavigation::LOAD_FLAGS_BYPASS_PROXY:
|
||||
strcpy(theFlagName, "LOAD_FLAGS_BYPASS_PROXY");
|
||||
break;
|
||||
case nsIWebNavigation::LOAD_FLAGS_CHARSET_CHANGE:
|
||||
strcpy(theFlagName, "LOAD_FLAGS_BYPASS_PROXY");
|
||||
break;
|
||||
}
|
||||
|
||||
rv = qaWebNav->LoadURI(NS_ConvertASCIItoUCS2(theUrl).get(),
|
||||
theFlag);
|
||||
sprintf(theTotalString, "%s%s%s%s%s", "LoadURI(): ", theUrl, " w/ ", theFlagName, " test");
|
||||
CQaUtils::RvTestResult(rv, theTotalString, 2);
|
||||
}
|
||||
|
||||
void CTests::ReloadTest(const unsigned long theFlag)
|
||||
{
|
||||
char theTotalString[500];
|
||||
char theFlagName[100];
|
||||
|
||||
switch(theFlag)
|
||||
{
|
||||
case nsIWebNavigation::LOAD_FLAGS_NONE:
|
||||
strcpy(theFlagName, "LOAD_FLAGS_NONE");
|
||||
break;
|
||||
case nsIWebNavigation::LOAD_FLAGS_MASK:
|
||||
strcpy(theFlagName, "LOAD_FLAGS_MASK");
|
||||
break;
|
||||
case nsIWebNavigation::LOAD_FLAGS_IS_REFRESH:
|
||||
strcpy(theFlagName, "LOAD_FLAGS_IS_REFRESH");
|
||||
break;
|
||||
case nsIWebNavigation::LOAD_FLAGS_IS_LINK:
|
||||
strcpy(theFlagName, "LOAD_FLAGS_IS_LINK");
|
||||
break;
|
||||
case nsIWebNavigation::LOAD_FLAGS_BYPASS_HISTORY:
|
||||
strcpy(theFlagName, "LOAD_FLAGS_BYPASS_HISTORY");
|
||||
break;
|
||||
case nsIWebNavigation::LOAD_FLAGS_REPLACE_HISTORY:
|
||||
strcpy(theFlagName, "LOAD_FLAGS_REPLACE_HISTORY");
|
||||
break;
|
||||
case nsIWebNavigation::LOAD_FLAGS_BYPASS_CACHE:
|
||||
strcpy(theFlagName, "LOAD_FLAGS_BYPASS_CACHE");
|
||||
break;
|
||||
case nsIWebNavigation::LOAD_FLAGS_BYPASS_PROXY:
|
||||
strcpy(theFlagName, "LOAD_FLAGS_BYPASS_PROXY");
|
||||
break;
|
||||
case nsIWebNavigation::LOAD_FLAGS_CHARSET_CHANGE:
|
||||
strcpy(theFlagName, "LOAD_FLAGS_BYPASS_PROXY");
|
||||
break;
|
||||
case nsIWebNavigation::LOAD_FLAGS_BYPASS_CACHE | \
|
||||
nsIWebNavigation::LOAD_FLAGS_BYPASS_PROXY: \
|
||||
strcpy(theFlagName, "nsIWebNavigation::LOAD_FLAGS_BYPASS_CACHE | \
|
||||
nsIWebNavigation::LOAD_FLAGS_BYPASS_PROXY");
|
||||
break;
|
||||
}
|
||||
|
||||
rv = qaWebNav->Reload(theFlag);
|
||||
sprintf(theTotalString, "%s%s%s%s", "Reload(): ", " w/ ", theFlagName, " test");
|
||||
CQaUtils::RvTestResult(rv, theTotalString, 2);
|
||||
}
|
||||
|
||||
void CTests::StopUriTest(char *theUrl)
|
||||
{
|
||||
char theTotalString[200];
|
||||
|
||||
qaWebNav->LoadURI(NS_ConvertASCIItoUCS2(theUrl).get(),
|
||||
nsIWebNavigation::LOAD_FLAGS_NONE);
|
||||
rv = qaWebNav->Stop(nsIWebNavigation::STOP_ALL);
|
||||
sprintf(theTotalString, "%s%s%s", "Stop(): ", theUrl, " test");
|
||||
CQaUtils::RvTestResult(rv, theTotalString, 2);
|
||||
}
|
||||
|
||||
void CTests::GetDocumentTest()
|
||||
{
|
||||
nsCOMPtr<nsIDOMDocument> theDocument;
|
||||
nsCOMPtr<nsIDOMDocumentType> theDocType;
|
||||
|
||||
rv = qaWebNav->GetDocument(getter_AddRefs(theDocument));
|
||||
if (!theDocument)
|
||||
{
|
||||
CQaUtils::QAOutput("We didn't get the document. Test failed.", 2);
|
||||
return;
|
||||
}
|
||||
else
|
||||
CQaUtils::RvTestResult(rv, "GetDocument() test", 2);
|
||||
|
||||
rv = theDocument->GetDoctype(getter_AddRefs(theDocType));
|
||||
CQaUtils::RvTestResult(rv, "nsIDOMDocument::GetDoctype() for nsIWebNav test", 2);
|
||||
}
|
||||
|
||||
void CTests::GetCurrentURITest()
|
||||
{
|
||||
nsCOMPtr<nsIURI> theUri;
|
||||
|
||||
rv = qaWebNav->GetCurrentURI(getter_AddRefs(theUri));
|
||||
if (!theUri)
|
||||
{
|
||||
CQaUtils::QAOutput("We didn't get the URI. Test failed.", 2);
|
||||
return;
|
||||
}
|
||||
else
|
||||
CQaUtils::RvTestResult(rv, "GetCurrentURI() test", 2);
|
||||
|
||||
char *uriSpec;
|
||||
rv = theUri->GetSpec(&uriSpec);
|
||||
CQaUtils::RvTestResult(rv, "nsIURI::GetSpec() for nsIWebNav test", 1);
|
||||
|
||||
CQaUtils::FormatAndPrintOutput("the nsIWebNav uri = ", uriSpec, 2);
|
||||
}
|
||||
|
||||
void CTests::GetSHTest()
|
||||
{
|
||||
PRInt32 numOfElements;
|
||||
|
||||
nsCOMPtr<nsISHistory> theSessionHistory;
|
||||
rv = qaWebNav->GetSessionHistory(getter_AddRefs(theSessionHistory));
|
||||
if (!theSessionHistory)
|
||||
{
|
||||
CQaUtils::QAOutput("We didn't get the session history. Test failed.", 2);
|
||||
return;
|
||||
}
|
||||
else
|
||||
CQaUtils::RvTestResult(rv, "GetSessionHistory() test", 2);
|
||||
|
||||
rv = theSessionHistory->GetCount(&numOfElements);
|
||||
CQaUtils::RvTestResult(rv, "nsISHistory::GetCount() for nsIWebNav test", 1);
|
||||
|
||||
CQaUtils::FormatAndPrintOutput("the sHist entry count = ", numOfElements, 2);
|
||||
}
|
||||
|
||||
// ***********************************************************************
|
||||
// ***********************************************************************
|
||||
// nsIRequest iface
|
||||
|
||||
// table columns corrsp to: pending, status, suspend, resume, cancel,
|
||||
// setLoadGroup & getLoadGroup tests respectively.
|
||||
|
||||
ReqElement UriTable[] = {
|
||||
{"http://www.netscape.com", 1, 1, 0, 0, 0, 1, 1},
|
||||
{"http://www.yahoo.com", 0, 0, 1, 1, 0, 0, 0},
|
||||
{"http://www.cisco.com", 0, 0, 0, 0, 1, 0, 0},
|
||||
{"http://www.sun.com", 0, 0, 0, 0, 0, 1, 1},
|
||||
{"http://www.intel.com", 1, 1, 1, 0, 0, 0, 0},
|
||||
{"http://www.aol.com", 0, 1, 0, 0, 0, 1, 1}
|
||||
};
|
||||
|
||||
void CTests::OnInterfacesNsirequest()
|
||||
{
|
||||
|
||||
// note: nsIRequest tests are called:
|
||||
// 1) in BrowserImpl.cpp, nsIStreamListener::OnDataAvailable()
|
||||
// 2) as individual tests below
|
||||
|
||||
nsCString theSpec;
|
||||
nsCOMPtr<nsIURI> theURI;
|
||||
nsCOMPtr<nsIChannel> theChannel;
|
||||
nsCOMPtr<nsILoadGroup> theLoadGroup(do_CreateInstance(NS_LOADGROUP_CONTRACTID));
|
||||
|
||||
int i=0;
|
||||
|
||||
CQaUtils::QAOutput("Start nsIRequest tests.", 2);
|
||||
|
||||
// theSpec = "http://www.netscape.com";
|
||||
for (i=0; i<6; i++)
|
||||
{
|
||||
theSpec = UriTable[i].theUri;
|
||||
CQaUtils::FormatAndPrintOutput("the uri spec = ", theSpec, 2);
|
||||
|
||||
rv = NS_NewURI(getter_AddRefs(theURI), theSpec);
|
||||
if (!theURI)
|
||||
{
|
||||
CQaUtils::QAOutput("We didn't get the URI. Test failed.", 1);
|
||||
return;
|
||||
}
|
||||
else
|
||||
CQaUtils::RvTestResult(rv, "NS_NewURI", 1);
|
||||
|
||||
rv = NS_OpenURI(getter_AddRefs(theChannel), theURI, nsnull, theLoadGroup);
|
||||
if (!theChannel)
|
||||
{
|
||||
CQaUtils::QAOutput("We didn't get the Channel. Test failed.", 1);
|
||||
return;
|
||||
}
|
||||
else if (!theLoadGroup)
|
||||
{
|
||||
CQaUtils::QAOutput("We didn't get the Load Group. Test failed.", 2);
|
||||
return;
|
||||
}
|
||||
else
|
||||
CQaUtils::RvTestResult(rv, "NS_OpenURI", 1);
|
||||
|
||||
nsCOMPtr<nsIStreamListener> listener(NS_STATIC_CAST(nsIStreamListener*, qaBrowserImpl));
|
||||
nsCOMPtr<nsIWeakReference> thisListener(dont_AddRef(NS_GetWeakReference(listener)));
|
||||
qaWebBrowser->AddWebBrowserListener(thisListener, NS_GET_IID(nsIStreamListener));
|
||||
|
||||
// this calls nsIStreamListener::OnDataAvailable()
|
||||
rv = theChannel->AsyncOpen(listener, nsnull);
|
||||
CQaUtils::RvTestResult(rv, "AsyncOpen()", 1);
|
||||
|
||||
// nsIRequest individual tests
|
||||
|
||||
CQaUtils::QAOutput("***** Individual nsIRequest test begins. *****");
|
||||
|
||||
nsCOMPtr<nsIRequest> theRequest = do_QueryInterface(theChannel);
|
||||
|
||||
|
||||
if (UriTable[i].reqPend == TRUE)
|
||||
IsPendingReqTest(theRequest);
|
||||
|
||||
if (UriTable[i].reqStatus == TRUE)
|
||||
GetStatusReqTest(theRequest);
|
||||
|
||||
if (UriTable[i].reqSuspend == TRUE)
|
||||
SuspendReqTest(theRequest);
|
||||
|
||||
if (UriTable[i].reqResume == TRUE)
|
||||
ResumeReqTest(theRequest);
|
||||
|
||||
if (UriTable[i].reqCancel == TRUE)
|
||||
CancelReqTest(theRequest);
|
||||
|
||||
if (UriTable[i].reqSetLoadGroup == TRUE)
|
||||
SetLoadGroupTest(theRequest, theLoadGroup);
|
||||
|
||||
if (UriTable[i].reqGetLoadGroup == TRUE)
|
||||
GetLoadGroupTest(theRequest);
|
||||
|
||||
CQaUtils::QAOutput("- - - - - - - - - - - - - - - - - - - - -", 1);
|
||||
} // end for loop
|
||||
CQaUtils::QAOutput("End nsIRequest tests.", 2);
|
||||
}
|
||||
|
||||
void CTests::IsPendingReqTest(nsIRequest *request)
|
||||
{
|
||||
PRBool reqPending;
|
||||
nsresult rv;
|
||||
|
||||
rv = request->IsPending(&reqPending);
|
||||
CQaUtils::RvTestResult(rv, "nsIRequest::IsPending() rv test", 1);
|
||||
|
||||
if (!reqPending)
|
||||
CQaUtils::QAOutput("Pending request = false.", 1);
|
||||
else
|
||||
CQaUtils::QAOutput("Pending request = true.", 1);
|
||||
}
|
||||
|
||||
void CTests::GetStatusReqTest(nsIRequest *request)
|
||||
{
|
||||
nsresult theStatusError;
|
||||
nsresult rv;
|
||||
|
||||
rv = request->GetStatus(&theStatusError);
|
||||
CQaUtils::RvTestResult(rv, "nsIRequest::GetStatus() test", 1);
|
||||
CQaUtils::RvTestResult(rv, "the returned status error test", 1);
|
||||
|
||||
}
|
||||
|
||||
void CTests::SuspendReqTest(nsIRequest *request)
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
rv = request->Suspend();
|
||||
CQaUtils::RvTestResult(rv, "nsIRequest::Suspend() test", 1);
|
||||
}
|
||||
|
||||
void CTests::ResumeReqTest(nsIRequest *request)
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
rv = request->Resume();
|
||||
CQaUtils::RvTestResult(rv, "nsIRequest::Resume() test", 1);
|
||||
}
|
||||
|
||||
void CTests::CancelReqTest(nsIRequest *request)
|
||||
{
|
||||
nsresult rv;
|
||||
nsresult status = NS_BINDING_ABORTED;
|
||||
|
||||
rv = request->Cancel(status);
|
||||
CQaUtils::RvTestResult(rv, "nsIRequest::Cancel() rv test", 1);
|
||||
CQaUtils::RvTestResult(status, "nsIRequest::Cancel() status test", 1);
|
||||
}
|
||||
|
||||
void CTests::SetLoadGroupTest(nsIRequest *request,
|
||||
nsILoadGroup *theLoadGroup)
|
||||
{
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsISimpleEnumerator> theSimpEnum;
|
||||
|
||||
rv = request->SetLoadGroup(theLoadGroup);
|
||||
CQaUtils::RvTestResult(rv, "nsIRequest::SetLoadGroup() rv test", 1);
|
||||
}
|
||||
|
||||
void CTests::GetLoadGroupTest(nsIRequest *request)
|
||||
{
|
||||
nsCOMPtr<nsILoadGroup> theLoadGroup;
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsISimpleEnumerator> theSimpEnum;
|
||||
|
||||
rv = request->GetLoadGroup(getter_AddRefs(theLoadGroup));
|
||||
CQaUtils::RvTestResult(rv, "nsIRequest::GetLoadGroup() rv test", 1);
|
||||
|
||||
rv = theLoadGroup->GetRequests(getter_AddRefs(theSimpEnum));
|
||||
CQaUtils::RvTestResult(rv, "nsIRequest:: LoadGroups' GetRequests() rv test", 1);
|
||||
}
|
||||
|
||||
|
||||
// ***********************************************************************
|
||||
>>>>>>> 1.16
|
||||
//DHARMA - nsIClipboardCommands
|
||||
// Checking the paste() method.
|
||||
void CTests::OnPasteTest()
|
||||
|
||||
@@ -139,27 +139,5 @@ protected:
|
||||
void FileCopyTest(nsILocalFile *, nsILocalFile *);
|
||||
void FileMoveTest(nsILocalFile *, nsILocalFile *);
|
||||
};
|
||||
<<<<<<< Tests.h
|
||||
=======
|
||||
|
||||
// structure for uri table
|
||||
typedef struct
|
||||
{
|
||||
char theUri[1024];
|
||||
bool reqPend;
|
||||
bool reqStatus;
|
||||
bool reqSuspend;
|
||||
bool reqResume;
|
||||
bool reqCancel;
|
||||
bool reqSetLoadGroup;
|
||||
bool reqGetLoadGroup;
|
||||
} ReqElement;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char theUri[1024];
|
||||
unsigned long theFlag;
|
||||
} NavElement;
|
||||
>>>>>>> 1.8
|
||||
|
||||
#endif //_TESTS_H
|
||||
|
||||
@@ -40,14 +40,14 @@ CPromptDialog::CPromptDialog(CWnd* pParent, const char* pTitle, const char* pTex
|
||||
: CDialog(CPromptDialog::IDD, pParent),
|
||||
m_bHasCheckBox(bHasCheck)
|
||||
{
|
||||
if(pTitle)
|
||||
m_csDialogTitle = pTitle;
|
||||
if(pText)
|
||||
m_csPromptText = pText;
|
||||
if(pInitPromptText)
|
||||
m_csPromptAnswer = pInitPromptText;
|
||||
if(pCheckText)
|
||||
m_csCheckBoxText = pCheckText;
|
||||
if(pTitle)
|
||||
m_csDialogTitle = pTitle;
|
||||
if(pText)
|
||||
m_csPromptText = pText;
|
||||
if(pInitPromptText)
|
||||
m_csPromptAnswer = pInitPromptText;
|
||||
if(pCheckText)
|
||||
m_csCheckBoxText = pCheckText;
|
||||
}
|
||||
|
||||
void CPromptDialog::DoDataExchange(CDataExchange* pDX)
|
||||
@@ -61,46 +61,46 @@ void CPromptDialog::DoDataExchange(CDataExchange* pDX)
|
||||
|
||||
BEGIN_MESSAGE_MAP(CPromptDialog, CDialog)
|
||||
//{{AFX_MSG_MAP(CPromptDialog)
|
||||
// NOTE: the ClassWizard will add message map macros here
|
||||
// NOTE: the ClassWizard will add message map macros here
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
int CPromptDialog::OnInitDialog()
|
||||
{
|
||||
SetWindowText(m_csDialogTitle);
|
||||
SetWindowText(m_csDialogTitle);
|
||||
|
||||
CWnd *pWnd = GetDlgItem(IDC_PROMPT_TEXT);
|
||||
if(pWnd)
|
||||
pWnd->SetWindowText(m_csPromptText);
|
||||
CWnd *pWnd = GetDlgItem(IDC_PROMPT_TEXT);
|
||||
if(pWnd)
|
||||
pWnd->SetWindowText(m_csPromptText);
|
||||
|
||||
CButton *pChk = (CButton *)GetDlgItem(IDC_CHECK_SAVE_PASSWORD);
|
||||
if(pChk)
|
||||
{
|
||||
if (m_bHasCheckBox)
|
||||
{
|
||||
if(!m_csCheckBoxText.IsEmpty())
|
||||
pChk->SetWindowText(m_csCheckBoxText);
|
||||
pChk->SetCheck(m_bCheckBoxValue ? BST_CHECKED : BST_UNCHECKED);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Hide the check box control if there's no label text
|
||||
// This will be the case when we're not using single sign-on
|
||||
pChk->ShowWindow(SW_HIDE);
|
||||
}
|
||||
}
|
||||
CButton *pChk = (CButton *)GetDlgItem(IDC_CHECK_SAVE_PASSWORD);
|
||||
if(pChk)
|
||||
{
|
||||
if (m_bHasCheckBox)
|
||||
{
|
||||
if(!m_csCheckBoxText.IsEmpty())
|
||||
pChk->SetWindowText(m_csCheckBoxText);
|
||||
pChk->SetCheck(m_bCheckBoxValue ? BST_CHECKED : BST_UNCHECKED);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Hide the check box control if there's no label text
|
||||
// This will be the case when we're not using single sign-on
|
||||
pChk->ShowWindow(SW_HIDE);
|
||||
}
|
||||
}
|
||||
|
||||
CEdit *pEdit = (CEdit *)GetDlgItem(IDC_PROMPT_ANSWER);
|
||||
if(pEdit)
|
||||
{
|
||||
pEdit->SetWindowText(m_csPromptAnswer);
|
||||
pEdit->SetFocus();
|
||||
pEdit->SetSel(0, -1);
|
||||
CEdit *pEdit = (CEdit *)GetDlgItem(IDC_PROMPT_ANSWER);
|
||||
if(pEdit)
|
||||
{
|
||||
pEdit->SetWindowText(m_csPromptAnswer);
|
||||
pEdit->SetFocus();
|
||||
pEdit->SetSel(0, -1);
|
||||
|
||||
return 0; // Returning "0" since we're explicitly setting focus
|
||||
}
|
||||
return 0; // Returning "0" since we're explicitly setting focus
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------//
|
||||
@@ -128,50 +128,50 @@ void CPromptPasswordDialog::DoDataExchange(CDataExchange* pDX)
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CPromptPasswordDialog)
|
||||
DDX_Text(pDX, IDC_PASSWORD, m_csPassword);
|
||||
DDX_Check(pDX, IDC_CHECK_SAVE_PASSWORD, m_bCheckBoxValue);
|
||||
DDX_Check(pDX, IDC_CHECK_SAVE_PASSWORD, m_bCheckBoxValue);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
BEGIN_MESSAGE_MAP(CPromptPasswordDialog, CDialog)
|
||||
//{{AFX_MSG_MAP(CPromptPasswordDialog)
|
||||
// NOTE: the ClassWizard will add message map macros here
|
||||
// NOTE: the ClassWizard will add message map macros here
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
int CPromptPasswordDialog::OnInitDialog()
|
||||
{
|
||||
SetWindowText(m_csDialogTitle);
|
||||
SetWindowText(m_csDialogTitle);
|
||||
|
||||
CWnd *pWnd = GetDlgItem(IDC_PROMPT_TEXT);
|
||||
if(pWnd)
|
||||
pWnd->SetWindowText(m_csPromptText);
|
||||
CWnd *pWnd = GetDlgItem(IDC_PROMPT_TEXT);
|
||||
if(pWnd)
|
||||
pWnd->SetWindowText(m_csPromptText);
|
||||
|
||||
CButton *pChk = (CButton *)GetDlgItem(IDC_CHECK_SAVE_PASSWORD);
|
||||
if(pChk)
|
||||
{
|
||||
if (m_bHasCheckBox)
|
||||
{
|
||||
if(!m_csCheckBoxText.IsEmpty())
|
||||
pChk->SetWindowText(m_csCheckBoxText);
|
||||
pChk->SetCheck(m_bCheckBoxValue ? BST_CHECKED : BST_UNCHECKED);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Hide the check box control if there's no label text
|
||||
// This will be the case when we're not using single sign-on
|
||||
pChk->ShowWindow(SW_HIDE);
|
||||
}
|
||||
}
|
||||
CButton *pChk = (CButton *)GetDlgItem(IDC_CHECK_SAVE_PASSWORD);
|
||||
if(pChk)
|
||||
{
|
||||
if (m_bHasCheckBox)
|
||||
{
|
||||
if(!m_csCheckBoxText.IsEmpty())
|
||||
pChk->SetWindowText(m_csCheckBoxText);
|
||||
pChk->SetCheck(m_bCheckBoxValue ? BST_CHECKED : BST_UNCHECKED);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Hide the check box control if there's no label text
|
||||
// This will be the case when we're not using single sign-on
|
||||
pChk->ShowWindow(SW_HIDE);
|
||||
}
|
||||
}
|
||||
|
||||
CEdit *pEdit = (CEdit *)GetDlgItem(IDC_PASSWORD);
|
||||
if(pEdit)
|
||||
{
|
||||
pEdit->SetFocus();
|
||||
CEdit *pEdit = (CEdit *)GetDlgItem(IDC_PASSWORD);
|
||||
if(pEdit)
|
||||
{
|
||||
pEdit->SetFocus();
|
||||
|
||||
return 0; // Returning "0" since we're explicitly setting focus
|
||||
}
|
||||
return 0; // Returning "0" since we're explicitly setting focus
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------//
|
||||
@@ -184,31 +184,31 @@ CPromptUsernamePasswordDialog::CPromptUsernamePasswordDialog(CWnd* pParent, cons
|
||||
: CDialog(CPromptUsernamePasswordDialog::IDD, pParent),
|
||||
m_bHasCheckBox(bHasCheck), m_bCheckBoxValue(initCheckVal)
|
||||
{
|
||||
if(pTitle)
|
||||
m_csDialogTitle = pTitle;
|
||||
if(pText)
|
||||
m_csPromptText = pText;
|
||||
if(pInitUsername)
|
||||
m_csUserName = pInitUsername;
|
||||
if(pInitPassword)
|
||||
m_csPassword = pInitPassword;
|
||||
if(pCheckText)
|
||||
m_csCheckBoxText = pCheckText;
|
||||
if(pTitle)
|
||||
m_csDialogTitle = pTitle;
|
||||
if(pText)
|
||||
m_csPromptText = pText;
|
||||
if(pInitUsername)
|
||||
m_csUserName = pInitUsername;
|
||||
if(pInitPassword)
|
||||
m_csPassword = pInitPassword;
|
||||
if(pCheckText)
|
||||
m_csCheckBoxText = pCheckText;
|
||||
}
|
||||
|
||||
void CPromptUsernamePasswordDialog::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CPromptUsernamePasswordDialog)
|
||||
DDX_Text(pDX, IDC_USERNAME, m_csUserName);
|
||||
DDX_Text(pDX, IDC_USERNAME, m_csUserName);
|
||||
DDX_Text(pDX, IDC_PASSWORD, m_csPassword);
|
||||
DDX_Check(pDX, IDC_CHECK_SAVE_PASSWORD, m_bCheckBoxValue);
|
||||
DDX_Check(pDX, IDC_CHECK_SAVE_PASSWORD, m_bCheckBoxValue);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
BEGIN_MESSAGE_MAP(CPromptUsernamePasswordDialog, CDialog)
|
||||
//{{AFX_MSG_MAP(CPromptUsernamePasswordDialog)
|
||||
// NOTE: the ClassWizard will add message map macros here
|
||||
// NOTE: the ClassWizard will add message map macros here
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
@@ -216,207 +216,41 @@ int CPromptUsernamePasswordDialog::OnInitDialog()
|
||||
{
|
||||
SetWindowText(m_csDialogTitle);
|
||||
|
||||
CWnd *pWnd = GetDlgItem(IDC_PROMPT_TEXT);
|
||||
if(pWnd)
|
||||
pWnd->SetWindowText(m_csPromptText);
|
||||
CWnd *pWnd = GetDlgItem(IDC_PROMPT_TEXT);
|
||||
if(pWnd)
|
||||
pWnd->SetWindowText(m_csPromptText);
|
||||
|
||||
CButton *pChk = (CButton *)GetDlgItem(IDC_CHECK_SAVE_PASSWORD);
|
||||
if(pChk)
|
||||
{
|
||||
if(m_bHasCheckBox)
|
||||
{
|
||||
if (!m_csCheckBoxText.IsEmpty())
|
||||
pChk->SetWindowText(m_csCheckBoxText);
|
||||
pChk->SetCheck(m_bCheckBoxValue ? BST_CHECKED : BST_UNCHECKED);
|
||||
}
|
||||
else
|
||||
{
|
||||
pChk->ShowWindow(SW_HIDE);
|
||||
}
|
||||
}
|
||||
CButton *pChk = (CButton *)GetDlgItem(IDC_CHECK_SAVE_PASSWORD);
|
||||
if(pChk)
|
||||
{
|
||||
if(m_bHasCheckBox)
|
||||
{
|
||||
if (!m_csCheckBoxText.IsEmpty())
|
||||
pChk->SetWindowText(m_csCheckBoxText);
|
||||
pChk->SetCheck(m_bCheckBoxValue ? BST_CHECKED : BST_UNCHECKED);
|
||||
}
|
||||
else
|
||||
{
|
||||
pChk->ShowWindow(SW_HIDE);
|
||||
}
|
||||
}
|
||||
|
||||
CEdit *pEdit = (CEdit *)GetDlgItem(IDC_PASSWORD);
|
||||
if(pEdit)
|
||||
{
|
||||
pEdit->SetWindowText(m_csPassword);
|
||||
}
|
||||
CEdit *pEdit = (CEdit *)GetDlgItem(IDC_PASSWORD);
|
||||
if(pEdit)
|
||||
{
|
||||
pEdit->SetWindowText(m_csPassword);
|
||||
}
|
||||
|
||||
pEdit = (CEdit *)GetDlgItem(IDC_USERNAME);
|
||||
if(pEdit)
|
||||
{
|
||||
pEdit->SetWindowText(m_csUserName);
|
||||
pEdit->SetSel(0, -1);
|
||||
pEdit = (CEdit *)GetDlgItem(IDC_USERNAME);
|
||||
if(pEdit)
|
||||
{
|
||||
pEdit->SetWindowText(m_csUserName);
|
||||
pEdit->SetSel(0, -1);
|
||||
|
||||
pEdit->SetFocus();
|
||||
pEdit->SetFocus();
|
||||
|
||||
return 0; // Returning "0" since we're explicitly setting focus
|
||||
}
|
||||
return 0; // Returning "0" since we're explicitly setting focus
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------//
|
||||
// CAlertCheckDialog Stuff
|
||||
//--------------------------------------------------------------------------//
|
||||
|
||||
CAlertCheckDialog::CAlertCheckDialog(CWnd* pParent, const char* pTitle, const char* pText,
|
||||
const char* pCheckText, int initCheckVal)
|
||||
: CDialog(CAlertCheckDialog::IDD, pParent)
|
||||
{
|
||||
if(pTitle)
|
||||
m_csDialogTitle = pTitle;
|
||||
if(pText)
|
||||
m_csMsgText = pText;
|
||||
if(pCheckText)
|
||||
m_csCheckBoxText = pCheckText;
|
||||
|
||||
m_bCheckBoxValue = initCheckVal;
|
||||
}
|
||||
|
||||
void CAlertCheckDialog::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CAlertCheckDialog)
|
||||
DDX_Check(pDX, IDC_CHECKBOX, m_bCheckBoxValue);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
BEGIN_MESSAGE_MAP(CAlertCheckDialog, CDialog)
|
||||
//{{AFX_MSG_MAP(CAlertCheckDialog)
|
||||
// NOTE: the ClassWizard will add message map macros here
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
int CAlertCheckDialog::OnInitDialog()
|
||||
{
|
||||
SetWindowText(m_csDialogTitle);
|
||||
|
||||
CWnd *pWnd = GetDlgItem(IDC_MSG_TEXT);
|
||||
if(pWnd)
|
||||
pWnd->SetWindowText(m_csMsgText);
|
||||
|
||||
CButton *pChk = (CButton *)GetDlgItem(IDC_CHECKBOX);
|
||||
if(pChk)
|
||||
{
|
||||
pChk->SetWindowText(m_csCheckBoxText);
|
||||
pChk->SetCheck(m_bCheckBoxValue ? BST_CHECKED : BST_UNCHECKED);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------//
|
||||
// CConfirmCheckDialog Stuff
|
||||
//--------------------------------------------------------------------------//
|
||||
|
||||
CConfirmCheckDialog::CConfirmCheckDialog(CWnd* pParent, const char* pTitle, const char* pText,
|
||||
const char* pCheckText, int initCheckVal,
|
||||
const char *pBtn1Text, const char *pBtn2Text,
|
||||
const char *pBtn3Text)
|
||||
: CDialog(CConfirmCheckDialog::IDD, pParent)
|
||||
{
|
||||
if(pTitle)
|
||||
m_csDialogTitle = pTitle;
|
||||
if(pText)
|
||||
m_csMsgText = pText;
|
||||
if(pCheckText)
|
||||
m_csCheckBoxText = pCheckText;
|
||||
|
||||
m_bCheckBoxValue = initCheckVal;
|
||||
|
||||
if(pBtn1Text)
|
||||
m_csBtn1Text = pBtn1Text;
|
||||
if(pBtn2Text)
|
||||
m_csBtn2Text = pBtn2Text;
|
||||
if(pBtn3Text)
|
||||
m_csBtn3Text = pBtn3Text;
|
||||
}
|
||||
|
||||
void CConfirmCheckDialog::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CConfirmCheckDialog)
|
||||
DDX_Check(pDX, IDC_CHECKBOX, m_bCheckBoxValue);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
BEGIN_MESSAGE_MAP(CConfirmCheckDialog, CDialog)
|
||||
//{{AFX_MSG_MAP(CConfirmCheckDialog)
|
||||
ON_BN_CLICKED(IDC_BTN1, OnBtn1Clicked)
|
||||
ON_BN_CLICKED(IDC_BTN2, OnBtn2Clicked)
|
||||
ON_BN_CLICKED(IDC_BTN3, OnBtn3Clicked)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
int CConfirmCheckDialog::OnInitDialog()
|
||||
{
|
||||
SetWindowText(m_csDialogTitle);
|
||||
|
||||
CWnd *pWnd = GetDlgItem(IDC_MSG_TEXT);
|
||||
if(pWnd)
|
||||
pWnd->SetWindowText(m_csMsgText);
|
||||
|
||||
CButton *pChk = (CButton *)GetDlgItem(IDC_CHECKBOX);
|
||||
if(pChk)
|
||||
{
|
||||
if(m_csCheckBoxText.IsEmpty())
|
||||
{
|
||||
pChk->ShowWindow(SW_HIDE);
|
||||
}
|
||||
else
|
||||
{
|
||||
pChk->SetWindowText(m_csCheckBoxText);
|
||||
pChk->SetCheck(m_bCheckBoxValue ? BST_CHECKED : BST_UNCHECKED);
|
||||
}
|
||||
}
|
||||
|
||||
CButton *pBtn1 = (CButton *)GetDlgItem(IDC_BTN1);
|
||||
if(pBtn1)
|
||||
{
|
||||
if(m_csBtn1Text.IsEmpty())
|
||||
pBtn1->ShowWindow(SW_HIDE);
|
||||
else
|
||||
pBtn1->SetWindowText(m_csBtn1Text);
|
||||
}
|
||||
|
||||
CButton *pBtn2 = (CButton *)GetDlgItem(IDC_BTN2);
|
||||
if(pBtn2)
|
||||
{
|
||||
if(m_csBtn2Text.IsEmpty())
|
||||
pBtn2->ShowWindow(SW_HIDE);
|
||||
else
|
||||
pBtn2->SetWindowText(m_csBtn2Text);
|
||||
}
|
||||
|
||||
CButton *pBtn3 = (CButton *)GetDlgItem(IDC_BTN3);
|
||||
if(pBtn3)
|
||||
{
|
||||
if(m_csBtn3Text.IsEmpty())
|
||||
pBtn3->ShowWindow(SW_HIDE);
|
||||
else
|
||||
pBtn3->SetWindowText(m_csBtn3Text);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CConfirmCheckDialog::OnBtn1Clicked()
|
||||
{
|
||||
UpdateData();
|
||||
|
||||
EndDialog(0); // where 0 indicates that the btn pressed was at index 0
|
||||
}
|
||||
|
||||
void CConfirmCheckDialog::OnBtn2Clicked()
|
||||
{
|
||||
UpdateData();
|
||||
|
||||
EndDialog(1); // where 1 indicates that the btn pressed was at index 1
|
||||
}
|
||||
|
||||
void CConfirmCheckDialog::OnBtn3Clicked()
|
||||
{
|
||||
UpdateData();
|
||||
|
||||
EndDialog(2); // where 2 indicates that the btn pressed was at index 2
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -34,8 +34,10 @@ public:
|
||||
BOOL bHasCheck, const char* pCheckText, int initCheckVal);
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CPromptDialog)
|
||||
enum { IDD = IDD_PROMPT_DIALOG };
|
||||
CString m_csPromptAnswer;
|
||||
//}}AFX_DATA
|
||||
|
||||
CString m_csDialogTitle;
|
||||
CString m_csPromptText;
|
||||
@@ -63,7 +65,9 @@ public:
|
||||
BOOL bHasCheck, const char* pCheckText, int initCheckVal);
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CPromptPasswordDialog)
|
||||
enum { IDD = IDD_PROMPT_PASSWORD_DIALOG };
|
||||
//}}AFX_DATA
|
||||
|
||||
CString m_csDialogTitle;
|
||||
CString m_csPromptText;
|
||||
@@ -92,7 +96,9 @@ public:
|
||||
BOOL bHasCheck, const char* pCheckText, int initCheckVal);
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CPromptUsernamePasswordDialog)
|
||||
enum { IDD = IDD_PROMPT_USERPASS_DIALOG };
|
||||
//}}AFX_DATA
|
||||
|
||||
CString m_csDialogTitle;
|
||||
CString m_csPromptText;
|
||||
@@ -117,66 +123,4 @@ public:
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
class CAlertCheckDialog : public CDialog
|
||||
{
|
||||
public:
|
||||
CAlertCheckDialog(CWnd* pParent, const char* pTitle, const char* pText,
|
||||
const char* pCheckText, int initCheckVal);
|
||||
|
||||
// Dialog Data
|
||||
enum { IDD = IDD_ALERT_CHECK_DIALOG };
|
||||
|
||||
CString m_csDialogTitle;
|
||||
CString m_csMsgText;
|
||||
CString m_csCheckBoxText;
|
||||
int m_bCheckBoxValue;
|
||||
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CAlertCheckDialog)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
//{{AFX_MSG(CAlertCheckDialog)
|
||||
virtual BOOL OnInitDialog();
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
class CConfirmCheckDialog : public CDialog
|
||||
{
|
||||
public:
|
||||
CConfirmCheckDialog(CWnd* pParent, const char* pTitle, const char* pText,
|
||||
const char* pCheckText, int initCheckVal,
|
||||
const char *pBtn1Text, const char *pBtn2Text,
|
||||
const char *pBtn3Text);
|
||||
|
||||
// Dialog Data
|
||||
enum { IDD = IDD_CONFIRM_CHECK_DIALOG };
|
||||
|
||||
CString m_csDialogTitle;
|
||||
CString m_csMsgText;
|
||||
CString m_csCheckBoxText;
|
||||
int m_bCheckBoxValue;
|
||||
CString m_csBtn1Text;
|
||||
CString m_csBtn2Text;
|
||||
CString m_csBtn3Text;
|
||||
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CConfirmCheckDialog)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
//{{AFX_MSG(CConfirmCheckDialog)
|
||||
virtual BOOL OnInitDialog();
|
||||
afx_msg void OnBtn1Clicked();
|
||||
afx_msg void OnBtn2Clicked();
|
||||
afx_msg void OnBtn3Clicked();
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
#endif //_DIALOG_H_
|
||||
|
||||
@@ -50,7 +50,7 @@ BEGIN
|
||||
"LANGUAGE 9, 1\r\n"
|
||||
"#pragma code_page(1252)\r\n"
|
||||
"#endif //_WIN32\r\n"
|
||||
"#include ""res\\mfcembed.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
|
||||
"#include ""res\\testembed.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
|
||||
"#include ""afxres.rc"" // Standard components\r\n"
|
||||
"#endif\r\n"
|
||||
"\0"
|
||||
@@ -108,69 +108,6 @@ BEGIN
|
||||
PUSHBUTTON "Cancel",IDCANCEL,95,101,50,14
|
||||
END
|
||||
|
||||
IDD_ALERT_CHECK_DIALOG DIALOG DISCARDABLE 0, 0, 233, 151
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Alert"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "OK",IDOK,91,127,50,14
|
||||
CONTROL "",IDC_CHECKBOX,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,
|
||||
104,215,10
|
||||
EDITTEXT IDC_MSG_TEXT,10,10,214,88,ES_MULTILINE | ES_READONLY
|
||||
END
|
||||
|
||||
IDD_CONFIRM_CHECK_DIALOG DIALOG DISCARDABLE 0, 0, 371, 111
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "ConfirmCheck"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "Btn1",IDC_BTN1,104,90,50,14
|
||||
CONTROL "",IDC_CHECKBOX,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,
|
||||
62,355,10
|
||||
LTEXT "",IDC_MSG_TEXT,6,10,354,39
|
||||
DEFPUSHBUTTON "Btn2",IDC_BTN2,164,89,50,14
|
||||
DEFPUSHBUTTON "Btn3",IDC_BTN3,224,89,50,14
|
||||
END
|
||||
|
||||
IDD_PROGRESS_DIALOG DIALOG DISCARDABLE 0, 0, 285, 95
|
||||
STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION |
|
||||
WS_SYSMENU
|
||||
CAPTION "Saving File"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
PUSHBUTTON "Cancel",IDCANCEL,115,73,50,14
|
||||
LTEXT "Action:",IDC_STATIC,27,23,26,9
|
||||
CONTROL "",IDC_ACTION,"Static",SS_LEFTNOWORDWRAP |
|
||||
WS_GROUP,59,23,211,8
|
||||
LTEXT "Saving From:",IDC_STATIC,7,6,42,8
|
||||
LTEXT "",IDC_SAVING_FROM,59,6,213,8
|
||||
LTEXT "Progress:",IDC_STATIC,19,41,30,8
|
||||
CONTROL "Progress1",IDC_PROGRESS,"msctls_progress32",PBS_SMOOTH |
|
||||
WS_BORDER,59,41,166,10
|
||||
LTEXT "100%",IDC_STATIC,229,42,18,8
|
||||
END
|
||||
|
||||
IDD_CHOOSE_ACTION_DIALOG DIALOG DISCARDABLE 0, 0, 285, 114
|
||||
STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION |
|
||||
WS_SYSMENU
|
||||
CAPTION "Choose An Action"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
LTEXT "You have chosen to download a file of type: ",
|
||||
IDC_STATIC,8,9,142,8
|
||||
LTEXT "Static",IDC_CONTENT_TYPE,152,10,123,8
|
||||
GROUPBOX "What would you like MfcEmbed to do with this file?",
|
||||
IDC_STATIC,8,24,268,61
|
||||
CONTROL "O&pen using",IDC_OPEN_USING,"Button",BS_AUTORADIOBUTTON |
|
||||
WS_TABSTOP,19,41,60,10
|
||||
CONTROL "&Save this file to disk",IDC_SAVE_TO_DISK,"Button",
|
||||
BS_AUTORADIOBUTTON | WS_TABSTOP,19,69,103,10
|
||||
LTEXT "Static",IDC_APP_NAME,31,53,186,9,SS_SUNKEN
|
||||
PUSHBUTTON "&Choose...",IDC_CHOOSE_APP,222,51,50,12
|
||||
PUSHBUTTON "Ok",IDOK,94,94,50,14
|
||||
PUSHBUTTON "Cancel",IDCANCEL,150,94,50,14
|
||||
END
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
@@ -136,18 +136,7 @@ NS_IMETHODIMP CPromptService::AlertCheck(nsIDOMWindow *parent,
|
||||
const PRUnichar *checkboxMsg,
|
||||
PRBool *checkValue)
|
||||
{
|
||||
ResourceState setState;
|
||||
USES_CONVERSION;
|
||||
|
||||
CWnd *wnd = CWndForDOMWindow(parent);
|
||||
CAlertCheckDialog dlg(wnd, W2T(dialogTitle), W2T(text),
|
||||
W2T(checkboxMsg), checkValue ? *checkValue : 0);
|
||||
|
||||
dlg.DoModal();
|
||||
|
||||
*checkValue = dlg.m_bCheckBoxValue;
|
||||
|
||||
return NS_OK;
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP CPromptService::Confirm(nsIDOMWindow *parent,
|
||||
@@ -178,21 +167,7 @@ NS_IMETHODIMP CPromptService::ConfirmCheck(nsIDOMWindow *parent,
|
||||
PRBool *checkValue,
|
||||
PRBool *_retval)
|
||||
{
|
||||
ResourceState setState;
|
||||
USES_CONVERSION;
|
||||
|
||||
CWnd *wnd = CWndForDOMWindow(parent);
|
||||
CConfirmCheckDialog dlg(wnd, W2T(dialogTitle), W2T(text),
|
||||
W2T(checkboxMsg), checkValue ? *checkValue : 0,
|
||||
"Yes", "No", NULL);
|
||||
|
||||
int iBtnClicked = dlg.DoModal();
|
||||
|
||||
*checkValue = dlg.m_bCheckBoxValue;
|
||||
|
||||
*_retval = iBtnClicked == 0 ? PR_TRUE : PR_FALSE;
|
||||
|
||||
return NS_OK;
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP CPromptService::Prompt(nsIDOMWindow *parent,
|
||||
@@ -334,58 +309,7 @@ NS_IMETHODIMP CPromptService::ConfirmEx(nsIDOMWindow *parent,
|
||||
PRBool *checkValue,
|
||||
PRInt32 *buttonPressed)
|
||||
{
|
||||
ResourceState setState;
|
||||
USES_CONVERSION;
|
||||
|
||||
// First, determine the button titles based on buttonFlags
|
||||
const PRUnichar* buttonStrings[] = { button0Title, button1Title, button2Title };
|
||||
CString csBtnTitles[3];
|
||||
|
||||
for(int i=0; i<3; i++)
|
||||
{
|
||||
switch(buttonFlags & 0xff) {
|
||||
case BUTTON_TITLE_OK:
|
||||
csBtnTitles[i] = "Ok";
|
||||
break;
|
||||
case BUTTON_TITLE_CANCEL:
|
||||
csBtnTitles[i] = "Cancel";
|
||||
break;
|
||||
case BUTTON_TITLE_YES:
|
||||
csBtnTitles[i] = "Yes";
|
||||
break;
|
||||
case BUTTON_TITLE_NO:
|
||||
csBtnTitles[i] = "No";
|
||||
break;
|
||||
case BUTTON_TITLE_SAVE:
|
||||
csBtnTitles[i] = "Save";
|
||||
break;
|
||||
case BUTTON_TITLE_DONT_SAVE:
|
||||
csBtnTitles[i] = "DontSave";
|
||||
break;
|
||||
case BUTTON_TITLE_REVERT:
|
||||
csBtnTitles[i] = "Revert";
|
||||
break;
|
||||
case BUTTON_TITLE_IS_STRING:
|
||||
csBtnTitles[i] = W2T(buttonStrings[i]);
|
||||
break;
|
||||
}
|
||||
|
||||
buttonFlags >>= 8;
|
||||
}
|
||||
|
||||
CWnd *wnd = CWndForDOMWindow(parent);
|
||||
CConfirmCheckDialog dlg(wnd, W2T(dialogTitle), W2T(text),
|
||||
checkMsg ? W2T(checkMsg) : NULL, checkValue ? *checkValue : 0,
|
||||
csBtnTitles[0].IsEmpty() ? NULL : (LPCTSTR)csBtnTitles[0],
|
||||
csBtnTitles[1].IsEmpty() ? NULL : (LPCTSTR)csBtnTitles[1],
|
||||
csBtnTitles[2].IsEmpty() ? NULL : (LPCTSTR)csBtnTitles[2]);
|
||||
|
||||
*buttonPressed = dlg.DoModal();
|
||||
|
||||
if(checkValue)
|
||||
*checkValue = dlg.m_bCheckBoxValue;
|
||||
|
||||
return NS_OK;
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
//*****************************************************************************
|
||||
|
||||
@@ -51,4 +51,3 @@ install:: $(DLL)
|
||||
clobber::
|
||||
$(RM) $(DIST)\bin\$(DLL_NAME).dll
|
||||
$(RM) $(DIST)\lib\$(DLL_NAME).lib
|
||||
$(RM) $(DIST)\lib\$(DLL_NAME).res
|
||||
@@ -5,10 +5,6 @@
|
||||
#define IDD_PROMPT_DIALOG 128
|
||||
#define IDD_PROMPT_PASSWORD_DIALOG 129
|
||||
#define IDD_PROMPT_USERPASS_DIALOG 130
|
||||
#define IDD_ALERT_CHECK_DIALOG 131
|
||||
#define IDD_CONFIRM_CHECK_DIALOG 132
|
||||
#define IDD_PROGRESS_DIALOG 133
|
||||
#define IDD_CHOOSE_ACTION_DIALOG 134
|
||||
#define IDC_PROMPT_ANSWER 1001
|
||||
#define IDC_PROMPT_TEXT 1002
|
||||
#define IDC_USERNAME 1003
|
||||
@@ -16,19 +12,6 @@
|
||||
#define IDC_CHECK_SAVE_PASSWORD 1005
|
||||
#define IDC_USERNAME_LABEL 1006
|
||||
#define IDC_PASSWORD_LABEL 1007
|
||||
#define IDC_CHECKBOX 1008
|
||||
#define IDC_MSG_TEXT 1009
|
||||
#define IDC_BTN1 1010
|
||||
#define IDC_BTN2 1011
|
||||
#define IDC_BTN3 1012
|
||||
#define IDC_ACTION 1013
|
||||
#define IDC_SAVING_FROM 1014
|
||||
#define IDC_PROGRESS 1015
|
||||
#define IDC_CONTENT_TYPE 1016
|
||||
#define IDC_SAVE_TO_DISK 1017
|
||||
#define IDC_OPEN_USING 1018
|
||||
#define IDC_CHOOSE_APP 1019
|
||||
#define IDC_APP_NAME 1020
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
|
||||
@@ -174,17 +174,10 @@ SOURCE=.\Selection.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
<<<<<<< testembed.dsp
|
||||
SOURCE=.\StdAfx.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
=======
|
||||
SOURCE=.\TestCallbacks.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
>>>>>>> 1.3
|
||||
SOURCE=.\TestEmbed.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
@@ -167,14 +167,9 @@ NS_METHOD winEmbedFileLocProvider::CloneMozBinDirectory(nsILocalFile **aLocalFil
|
||||
// This will be set if a directory was passed to NS_InitXPCOM
|
||||
// 2. If that doesn't work, set it to be the current process directory
|
||||
|
||||
<<<<<<< winEmbedFileLocProvider.cpp
|
||||
// NS_WITH_SERVICE(nsIProperties, directoryService, NS_DIRECTORY_SERVICE_CONTRACTID, &rv);
|
||||
nsCOMPtr<nsIProperties> directoryService(do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID,&rv));
|
||||
|
||||
=======
|
||||
nsCOMPtr<nsIProperties> directoryService =
|
||||
do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv);
|
||||
>>>>>>> 1.4
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
@@ -213,14 +208,9 @@ NS_METHOD winEmbedFileLocProvider::GetProductDirectory(nsILocalFile **aLocalFile
|
||||
PRBool exists;
|
||||
nsCOMPtr<nsILocalFile> localDir;
|
||||
|
||||
<<<<<<< winEmbedFileLocProvider.cpp
|
||||
//NS_WITH_SERVICE(nsIProperties, directoryService, NS_DIRECTORY_SERVICE_CONTRACTID, &rv);
|
||||
nsCOMPtr<nsIProperties> directoryService(do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID,&rv));
|
||||
|
||||
=======
|
||||
nsCOMPtr<nsIProperties> directoryService =
|
||||
do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv);
|
||||
>>>>>>> 1.4
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
rv = directoryService->Get(NS_WIN_APPDATA_DIR, NS_GET_IID(nsILocalFile), getter_AddRefs(localDir));
|
||||
if (NS_SUCCEEDED(rv))
|
||||
|
||||
Reference in New Issue
Block a user