зеркало из https://github.com/mozilla/pjs.git
Added test cases for nsIWebProgress->GetIsDocumentLoading() and nsIWebNavigation->SetSessionHistory(). Added IsDocumentLoading tracking in web progress listeners. not part of the build.
This commit is contained in:
Родитель
1c6c051db0
Коммит
0f746eb967
|
@ -104,7 +104,7 @@ NS_IMETHODIMP CBrowserImpl::OnProgressChange(nsIWebProgress *progress, nsIReques
|
|||
|
||||
QAOutput("nsIWebProgLstnr::OnProgressChange(): Progress Update complete!", 1);
|
||||
}
|
||||
|
||||
WebProgIsDocLoadingTest(progress, "OnProgressChange()", 1);
|
||||
m_pBrowserFrameGlue->UpdateProgress(nProgress, nProgressMax);
|
||||
|
||||
QAOutput("Exiting nsIWebProgLstnr::OnProgressChange().\r\n");
|
||||
|
@ -144,8 +144,9 @@ NS_IMETHODIMP CBrowserImpl::OnStateChange(nsIWebProgress *progress, nsIRequest *
|
|||
else if (progressStateFlags & STATE_REDIRECTING)
|
||||
strcpy(theStateType, "STATE_REDIRECTING");
|
||||
|
||||
else if (progressStateFlags & STATE_TRANSFERRING)
|
||||
strcpy(theStateType, "STATE_TRANSFERRING");
|
||||
else if (progressStateFlags & STATE_TRANSFERRING) {
|
||||
strcpy(theStateType, "STATE_TRANSFERRING");
|
||||
}
|
||||
|
||||
else if (progressStateFlags & STATE_NEGOTIATING)
|
||||
strcpy(theStateType, "STATE_NEGOTIATING");
|
||||
|
@ -162,8 +163,7 @@ NS_IMETHODIMP CBrowserImpl::OnStateChange(nsIWebProgress *progress, nsIRequest *
|
|||
m_pBrowserFrameGlue->UpdateStatusBarText(nsnull); // Clear the status bar
|
||||
|
||||
// web progress DOMWindow test
|
||||
WebProgDOMWindowTest(progress, "OnStateChange()", 1);
|
||||
|
||||
WebProgDOMWindowTest(progress, "OnStateChange()", 1);
|
||||
}
|
||||
|
||||
onStateChangeString(theStateType, theDocType, stringMsg, status, displayMode);
|
||||
|
@ -233,6 +233,8 @@ NS_IMETHODIMP CBrowserImpl::OnStateChange(nsIWebProgress *progress, nsIRequest *
|
|||
onStateChangeString(theStateType, theDocType, stringMsg, status, displayMode);
|
||||
|
||||
}
|
||||
// web progress isDocumentLoading test
|
||||
WebProgIsDocLoadingTest(progress, "OnStateChange()", 1);
|
||||
|
||||
QAOutput("Exiting nsIWebProgLstnr::OnStateChange().\r\n");
|
||||
|
||||
|
@ -273,6 +275,7 @@ NS_IMETHODIMP CBrowserImpl::OnLocationChange(nsIWebProgress* aWebProgress,
|
|||
}
|
||||
if (domWindow != topDomWindow)
|
||||
isSubFrameLoad = PR_TRUE;
|
||||
WebProgIsDocLoadingTest(aWebProgress, "OnLocationChange()", 1);
|
||||
}
|
||||
|
||||
if (!isSubFrameLoad) // Update urlbar only if it is not a subframe load
|
||||
|
@ -302,6 +305,8 @@ CBrowserImpl::OnStatusChange(nsIWebProgress* aWebProgress,
|
|||
|
||||
// web progress DOMWindow test (typically the host name)
|
||||
WebProgDOMWindowTest(aWebProgress, "OnStatusChange(): web prog DOM window test", 1);
|
||||
// web progress isDocumentLoading test
|
||||
WebProgIsDocLoadingTest(aWebProgress, "OnStatusChange()", 1);
|
||||
|
||||
m_pBrowserFrameGlue->UpdateStatusBarText(aMessage);
|
||||
|
||||
|
@ -339,6 +344,8 @@ CBrowserImpl::OnSecurityChange(nsIWebProgress *aWebProgress,
|
|||
|
||||
// web progress DOMWindow test
|
||||
WebProgDOMWindowTest(aWebProgress, "OnSecurityChange()", 1);
|
||||
// web progress isDocumentLoading test
|
||||
WebProgIsDocLoadingTest(aWebProgress, "OnSecurityChange()", 1);
|
||||
|
||||
QAOutput("Exiting nsIWebProgLstnr::OnSecurityChange().\r\n");
|
||||
|
||||
|
|
|
@ -297,6 +297,21 @@ void WebProgDOMWindowTest(nsIWebProgress *progress, const char *inString,
|
|||
RvTestResult(rv, totalStr2.get(), displayMethod);
|
||||
}
|
||||
|
||||
void WebProgIsDocLoadingTest(nsIWebProgress *progress, const char *inString,
|
||||
int displayMethod)
|
||||
{
|
||||
nsresult rv;
|
||||
PRBool docLoading;
|
||||
nsCString totalStr;
|
||||
|
||||
totalStr = inString;
|
||||
totalStr += ": nsIWebProgress:IsDocumentLoading attribute test";
|
||||
|
||||
rv = progress->GetIsLoadingDocument(&docLoading);
|
||||
RvTestResult(rv, totalStr.get(), displayMethod);
|
||||
FormatAndPrintOutput("nsIWebProgress: isDocumentLoading return value = ", docLoading, displayMethod);
|
||||
}
|
||||
|
||||
nsIDOMWindow * GetTheDOMWindow(nsIWebBrowser *webBrowser)
|
||||
{
|
||||
nsCOMPtr<nsIDOMWindow> theDOMWindow;
|
||||
|
|
|
@ -64,6 +64,7 @@ extern void FormatAndPrintOutput(const char *, double, int);
|
|||
extern void FormatAndPrintOutput(const char *, PRUint32, int);
|
||||
extern void RequestName(nsIRequest *, nsCString &, int displayMethod=1);
|
||||
extern void WebProgDOMWindowTest(nsIWebProgress *, const char *,int displayMethod=1);
|
||||
extern void WebProgIsDocLoadingTest(nsIWebProgress *, const char *, int displayMethod=1);
|
||||
extern nsIDOMWindow * GetTheDOMWindow(nsIWebBrowser *);
|
||||
extern nsCAutoString GetTheUri(nsIURI *theUri, int displayMethod=1);
|
||||
extern void onStateChangeString(char *, char *, nsCString, PRUint32, int displayMethod=1);
|
||||
|
|
|
@ -240,6 +240,7 @@ BEGIN_MESSAGE_MAP(CTests, CWnd)
|
|||
ON_COMMAND(ID_INTERFACES_NSIWEBPROGRESS_ADDPROGRESSLISTENER, OnInterfacesNsiwebprogress)
|
||||
ON_COMMAND(ID_INTERFACES_NSIWEBPROGRESS_REMOVEPROGRESSLISTENER, OnInterfacesNsiwebprogress)
|
||||
ON_COMMAND(ID_INTERFACES_NSIWEBPROGRESS_GETDOMWINDOW, OnInterfacesNsiwebprogress)
|
||||
ON_COMMAND(ID_INTERFACES_NSIWEBPROGRESS_ISLOADINGDOCUMENT, OnInterfacesNsiwebprogress)
|
||||
|
||||
ON_COMMAND(ID_INTERFACES_NSIWEBBROWSERFIND_RUNALLTESTS, OnInterfacesNsiwebbrowfind)
|
||||
ON_COMMAND(ID_INTERFACES_NSIWEBBROWSERFIND_SETSEARCHSTRINGTEST, OnInterfacesNsiwebbrowfind)
|
||||
|
|
|
@ -111,6 +111,10 @@ void CNsIWebBrowser::WBSetContainerWindow(PRInt16 displayMode)
|
|||
// SetContainerWindow
|
||||
|
||||
rv = qaWebBrowser->SetContainerWindow(qaWebBrowserChrome);
|
||||
if (!qaWebBrowserChrome) {
|
||||
QAOutput("Didn't get web browser chrome object.", displayMode);
|
||||
return;
|
||||
}
|
||||
RvTestResult(rv, "nsIWebBrowser::SetContainerWindow() test", displayMode);
|
||||
RvTestResultDlg(rv, "nsIWebBrowser::SetContainerWindow() test");
|
||||
}
|
||||
|
|
|
@ -99,40 +99,41 @@ void CNsIWebNav::OnStartTests(UINT nMenuID)
|
|||
RunAllTests();
|
||||
break ;
|
||||
case ID_INTERFACES_NSIWEBNAV_GETCANGOBACK :
|
||||
CanGoBackTest();
|
||||
CanGoBackTest(2);
|
||||
break ;
|
||||
case ID_INTERFACES_NSIWEBNAV_GETCANGOFORWARD :
|
||||
CanGoForwardTest();
|
||||
CanGoForwardTest(2);
|
||||
break ;
|
||||
case ID_INTERFACES_NSIWEBNAV_GOBACK :
|
||||
GoBackTest();
|
||||
GoBackTest(2);
|
||||
break ;
|
||||
case ID_INTERFACES_NSIWEBNAV_GOFORWARD :
|
||||
GoForwardTest();
|
||||
GoForwardTest(2);
|
||||
break ;
|
||||
case ID_INTERFACES_NSIWEBNAV_GOTOINDEX :
|
||||
GoToIndexTest();
|
||||
GoToIndexTest(2);
|
||||
break ;
|
||||
case ID_INTERFACES_NSIWEBNAV_LOADURI :
|
||||
LoadUriTest(nsnull, nsnull, 1);
|
||||
LoadUriTest(nsnull, nsnull, 2, PR_FALSE);
|
||||
break ;
|
||||
case ID_INTERFACES_NSIWEBNAV_RELOAD :
|
||||
ReloadTest(nsIWebNavigation::LOAD_FLAGS_NONE);
|
||||
ReloadTest(nsIWebNavigation::LOAD_FLAGS_NONE, 2);
|
||||
break ;
|
||||
case ID_INTERFACES_NSIWEBNAV_STOP :
|
||||
StopUriTest("file://C|/Program Files",
|
||||
nsIWebNavigation::STOP_CONTENT);
|
||||
nsIWebNavigation::STOP_CONTENT, 2);
|
||||
break ;
|
||||
case ID_INTERFACES_NSIWEBNAV_GETDOCUMENT :
|
||||
GetDocumentTest();
|
||||
GetDocumentTest(2);
|
||||
break ;
|
||||
case ID_INTERFACES_NSIWEBNAV_GETCURRENTURI :
|
||||
GetCurrentURITest();
|
||||
GetCurrentURITest(2);
|
||||
break ;
|
||||
case ID_INTERFACES_NSIWEBNAV_GETSESSIONHISTORY :
|
||||
GetSHTest();
|
||||
GetSHTest(2);
|
||||
break ;
|
||||
case ID_INTERFACES_NSIWEBNAV_SETSESSIONHISTORY :
|
||||
SetSHTest(2);
|
||||
break ;
|
||||
}
|
||||
}
|
||||
|
@ -142,52 +143,53 @@ void CNsIWebNav::RunAllTests()
|
|||
int i=0;
|
||||
|
||||
if (qaWebNav)
|
||||
QAOutput("We have the web nav object.", 2);
|
||||
QAOutput("We have the web nav object.", 1);
|
||||
else {
|
||||
QAOutput("We don't have the web nav object. No tests performed.", 2);
|
||||
return;
|
||||
}
|
||||
|
||||
// load a couple of URLs to get things going
|
||||
LoadUriTest("http://www.cisco.com", nsIWebNavigation::LOAD_FLAGS_NONE);
|
||||
LoadUriTest("www.google.com", nsIWebNavigation::LOAD_FLAGS_NONE);
|
||||
LoadUriTest("http://www.cisco.com", nsIWebNavigation::LOAD_FLAGS_NONE, 2, PR_TRUE);
|
||||
LoadUriTest("www.google.com", nsIWebNavigation::LOAD_FLAGS_NONE, 2, PR_TRUE);
|
||||
|
||||
// canGoBack attribute test
|
||||
CanGoBackTest();
|
||||
CanGoBackTest(1);
|
||||
|
||||
// GoBack test
|
||||
GoBackTest();
|
||||
GoBackTest(2);
|
||||
|
||||
// canGoForward attribute test
|
||||
CanGoForwardTest();
|
||||
CanGoForwardTest(1);
|
||||
|
||||
// GoForward test
|
||||
GoForwardTest();
|
||||
GoForwardTest(2);
|
||||
|
||||
// GotoIndex test
|
||||
GoToIndexTest();
|
||||
GoToIndexTest(2);
|
||||
|
||||
// LoadURI() & reload tests
|
||||
|
||||
QAOutput("Run a few LoadURI() tests.", 2);
|
||||
QAOutput("Run a few LoadURI() tests.", 1);
|
||||
|
||||
|
||||
LoadUriandReload(11);
|
||||
|
||||
|
||||
// Stop() tests
|
||||
StopUriTest("http://www.microsoft.com", nsIWebNavigation::STOP_ALL);
|
||||
StopUriTest("https://www.microsoft.com/", nsIWebNavigation::STOP_NETWORK);
|
||||
StopUriTest("ftp://ftp.microsoft.com/", nsIWebNavigation::STOP_CONTENT);
|
||||
StopUriTest("http://www.microsoft.com", nsIWebNavigation::STOP_ALL, 1);
|
||||
StopUriTest("https://www.microsoft.com/", nsIWebNavigation::STOP_NETWORK, 1);
|
||||
StopUriTest("ftp://ftp.microsoft.com/", nsIWebNavigation::STOP_CONTENT, 1);
|
||||
|
||||
// document test
|
||||
GetDocumentTest();
|
||||
GetDocumentTest(1);
|
||||
|
||||
// uri test
|
||||
GetCurrentURITest();
|
||||
GetCurrentURITest(1);
|
||||
|
||||
// session history test
|
||||
GetSHTest();
|
||||
SetSHTest(1);
|
||||
GetSHTest(1);
|
||||
}
|
||||
|
||||
void CNsIWebNav::LoadUriandReload(int URItotal)
|
||||
|
@ -195,34 +197,34 @@ void CNsIWebNav::LoadUriandReload(int URItotal)
|
|||
int i=0, j=0;
|
||||
// LoadURI() & reload tests
|
||||
|
||||
QAOutput("Run a few LoadURI() and Reload() tests.", 2);
|
||||
QAOutput("Run a few LoadURI() and Reload() tests.", 1);
|
||||
|
||||
for (j=0; j < 9; j++)
|
||||
{
|
||||
for (i=0; i < URItotal; i++)
|
||||
{
|
||||
LoadUriTest(UrlTable[i].theUri, UrlTable[j].theFlag);
|
||||
LoadUriTest(UrlTable[i].theUri, UrlTable[j].theFlag, 2, PR_TRUE);
|
||||
switch (i)
|
||||
{
|
||||
case 0:
|
||||
ReloadTest(nsIWebNavigation::LOAD_FLAGS_NONE);
|
||||
ReloadTest(nsIWebNavigation::LOAD_FLAGS_NONE, 1);
|
||||
break;
|
||||
case 1:
|
||||
ReloadTest(nsIWebNavigation::LOAD_FLAGS_BYPASS_CACHE);
|
||||
ReloadTest(nsIWebNavigation::LOAD_FLAGS_BYPASS_CACHE, 1);
|
||||
break;
|
||||
case 2:
|
||||
ReloadTest(nsIWebNavigation::LOAD_FLAGS_BYPASS_PROXY);
|
||||
ReloadTest(nsIWebNavigation::LOAD_FLAGS_BYPASS_PROXY, 1);
|
||||
break;
|
||||
// simulate shift-reload
|
||||
case 3:
|
||||
ReloadTest(nsIWebNavigation::LOAD_FLAGS_BYPASS_CACHE |
|
||||
nsIWebNavigation::LOAD_FLAGS_BYPASS_PROXY);
|
||||
nsIWebNavigation::LOAD_FLAGS_BYPASS_PROXY, 1);
|
||||
break;
|
||||
case 4:
|
||||
ReloadTest(nsIWebNavigation::LOAD_FLAGS_CHARSET_CHANGE);
|
||||
ReloadTest(nsIWebNavigation::LOAD_FLAGS_CHARSET_CHANGE, 1);
|
||||
break;
|
||||
case 5:
|
||||
ReloadTest(nsIWebNavigation::LOAD_FLAGS_NONE);
|
||||
ReloadTest(nsIWebNavigation::LOAD_FLAGS_NONE, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -233,49 +235,49 @@ void CNsIWebNav::LoadUriandReload(int URItotal)
|
|||
// Individual nsIWebNavigation tests
|
||||
|
||||
|
||||
void CNsIWebNav::CanGoBackTest()
|
||||
void CNsIWebNav::CanGoBackTest(PRInt16 displayMode)
|
||||
{
|
||||
PRBool canGoBack = PR_FALSE;
|
||||
rv = qaWebNav->GetCanGoBack(&canGoBack);
|
||||
RvTestResult(rv, "GetCanGoBack() attribute test", 2);
|
||||
FormatAndPrintOutput("canGoBack value = ", canGoBack, 2);
|
||||
RvTestResult(rv, "GetCanGoBack() attribute test", displayMode);
|
||||
FormatAndPrintOutput("canGoBack value = ", canGoBack, displayMode);
|
||||
}
|
||||
|
||||
void CNsIWebNav::GoBackTest()
|
||||
void CNsIWebNav::GoBackTest(PRInt16 displayMode)
|
||||
{
|
||||
rv = qaWebNav->GoBack();
|
||||
RvTestResult(rv, "GoBack() test", 2);
|
||||
RvTestResult(rv, "GoBack() test", displayMode);
|
||||
}
|
||||
|
||||
void CNsIWebNav::CanGoForwardTest()
|
||||
void CNsIWebNav::CanGoForwardTest(PRInt16 displayMode)
|
||||
{
|
||||
PRBool canGoForward = PR_FALSE;
|
||||
rv = qaWebNav->GetCanGoForward(&canGoForward);
|
||||
RvTestResult(rv, "GetCanGoForward() attribute test", 2);
|
||||
FormatAndPrintOutput("canGoForward value = ", canGoForward, 2);
|
||||
RvTestResult(rv, "GetCanGoForward() attribute test", displayMode);
|
||||
FormatAndPrintOutput("canGoForward value = ", canGoForward, displayMode);
|
||||
}
|
||||
|
||||
void CNsIWebNav::GoForwardTest()
|
||||
void CNsIWebNav::GoForwardTest(PRInt16 displayMode)
|
||||
{
|
||||
rv = qaWebNav->GoForward();
|
||||
RvTestResult(rv, "GoForward() test", 2);
|
||||
RvTestResult(rv, "GoForward() test", displayMode);
|
||||
}
|
||||
|
||||
void CNsIWebNav::GoToIndexTest()
|
||||
void CNsIWebNav::GoToIndexTest(PRInt16 displayMode)
|
||||
{
|
||||
PRInt32 theIndex = 0;
|
||||
|
||||
rv = qaWebNav->GotoIndex(theIndex);
|
||||
RvTestResult(rv, "GotoIndex() test", 2);
|
||||
RvTestResult(rv, "GotoIndex() test", displayMode);
|
||||
}
|
||||
|
||||
void CNsIWebNav::LoadUriTest(char *theUrl, PRUint32 theFlag,
|
||||
PRInt16 displayMode)
|
||||
PRInt16 displayMode, PRBool runAllTests)
|
||||
{
|
||||
char theTotalString[500];
|
||||
char theFlagName[200];
|
||||
|
||||
if (displayMode == 1) // load just one url from Url dialog
|
||||
if (runAllTests == PR_FALSE) // load just one url from Url dialog
|
||||
{
|
||||
CUrlDialog myDialog;
|
||||
if (myDialog.DoModal() == IDOK)
|
||||
|
@ -285,8 +287,8 @@ void CNsIWebNav::LoadUriTest(char *theUrl, PRUint32 theFlag,
|
|||
myDialog.m_flagvalue, nsnull,nsnull, nsnull);
|
||||
|
||||
RvTestResult(rv, "rv LoadURI() test", 1);
|
||||
FormatAndPrintOutput("The url = ", myDialog.m_urlfield, 2);
|
||||
FormatAndPrintOutput("The flag = ", myDialog.m_flagvalue, 1);
|
||||
FormatAndPrintOutput("The url = ", myDialog.m_urlfield, displayMode);
|
||||
FormatAndPrintOutput("The flag = ", myDialog.m_flagvalue, displayMode);
|
||||
QAOutput("End Change URL test.", 1);
|
||||
}
|
||||
return;
|
||||
|
@ -329,10 +331,10 @@ void CNsIWebNav::LoadUriTest(char *theUrl, PRUint32 theFlag,
|
|||
nsnull,
|
||||
nsnull);
|
||||
sprintf(theTotalString, "%s%s%s%s%s", "LoadURI(): ", theUrl, " w/ ", theFlagName, " test");
|
||||
RvTestResult(rv, theTotalString, 2);
|
||||
RvTestResult(rv, theTotalString, displayMode);
|
||||
}
|
||||
|
||||
void CNsIWebNav::ReloadTest(PRUint32 theFlag)
|
||||
void CNsIWebNav::ReloadTest(PRUint32 theFlag, PRInt16 displayMode)
|
||||
{
|
||||
char theTotalString[500];
|
||||
char theFlagName[200];
|
||||
|
@ -373,10 +375,11 @@ void CNsIWebNav::ReloadTest(PRUint32 theFlag)
|
|||
|
||||
rv = qaWebNav->Reload(theFlag);
|
||||
sprintf(theTotalString, "%s%s%s%s", "Reload(): ", " w/ ", theFlagName, " test");
|
||||
RvTestResult(rv, theTotalString, 1);
|
||||
RvTestResult(rv, theTotalString, displayMode);
|
||||
}
|
||||
|
||||
void CNsIWebNav::StopUriTest(char *theUrl, PRUint32 theFlag)
|
||||
void CNsIWebNav::StopUriTest(char *theUrl, PRUint32 theFlag,
|
||||
PRInt16 displayMode)
|
||||
{
|
||||
char theTotalString[200];
|
||||
char flagString[100];
|
||||
|
@ -396,10 +399,10 @@ void CNsIWebNav::StopUriTest(char *theUrl, PRUint32 theFlag)
|
|||
|
||||
rv = qaWebNav->Stop(theFlag);
|
||||
sprintf(theTotalString, "%s%s%s%s", "Stop(): ", theUrl, " test: ", flagString);
|
||||
RvTestResult(rv, theTotalString, 2);
|
||||
RvTestResult(rv, theTotalString, displayMode);
|
||||
}
|
||||
|
||||
void CNsIWebNav::GetDocumentTest()
|
||||
void CNsIWebNav::GetDocumentTest(PRInt16 displayMode)
|
||||
{
|
||||
nsCOMPtr<nsIDOMDocument> theDocument;
|
||||
nsCOMPtr<nsIDOMDocumentType> theDocType;
|
||||
|
@ -410,13 +413,13 @@ void CNsIWebNav::GetDocumentTest()
|
|||
return;
|
||||
}
|
||||
else
|
||||
RvTestResult(rv, "GetDocument() test", 2);
|
||||
RvTestResult(rv, "GetDocument() test", displayMode);
|
||||
|
||||
rv = theDocument->GetDoctype(getter_AddRefs(theDocType));
|
||||
RvTestResult(rv, "nsIDOMDocument::GetDoctype() for nsIWebNav test", 2);
|
||||
RvTestResult(rv, "nsIDOMDocument::GetDoctype() for nsIWebNav test", displayMode);
|
||||
}
|
||||
|
||||
void CNsIWebNav::GetCurrentURITest()
|
||||
void CNsIWebNav::GetCurrentURITest(PRInt16 displayMode)
|
||||
{
|
||||
nsCOMPtr<nsIURI> theUri;
|
||||
|
||||
|
@ -426,16 +429,16 @@ void CNsIWebNav::GetCurrentURITest()
|
|||
return;
|
||||
}
|
||||
else
|
||||
RvTestResult(rv, "GetCurrentURI() test", 2);
|
||||
RvTestResult(rv, "GetCurrentURI() test", displayMode);
|
||||
|
||||
nsCAutoString uriString;
|
||||
rv = theUri->GetSpec(uriString);
|
||||
RvTestResult(rv, "nsIURI::GetSpec() for nsIWebNav test", 1);
|
||||
|
||||
FormatAndPrintOutput("the nsIWebNav uri = ", uriString, 2);
|
||||
FormatAndPrintOutput("the nsIWebNav uri = ", uriString, displayMode);
|
||||
}
|
||||
|
||||
void CNsIWebNav::GetSHTest()
|
||||
void CNsIWebNav::GetSHTest(PRInt16 displayMode)
|
||||
{
|
||||
PRInt32 numOfElements;
|
||||
|
||||
|
@ -446,10 +449,19 @@ void CNsIWebNav::GetSHTest()
|
|||
return;
|
||||
}
|
||||
else
|
||||
RvTestResult(rv, "GetSessionHistory() test", 2);
|
||||
RvTestResult(rv, "GetSessionHistory() test", displayMode);
|
||||
|
||||
rv = theSessionHistory->GetCount(&numOfElements);
|
||||
RvTestResult(rv, "nsISHistory::GetCount() for nsIWebNav test", 1);
|
||||
|
||||
FormatAndPrintOutput("the sHist entry count = ", numOfElements, 2);
|
||||
FormatAndPrintOutput("the sHist entry count = ", numOfElements, displayMode);
|
||||
}
|
||||
|
||||
void CNsIWebNav::SetSHTest(PRInt16 displayMode)
|
||||
{
|
||||
nsCOMPtr<nsISHistory> theSessionHistory;
|
||||
rv = qaWebNav->SetSessionHistory(theSessionHistory);
|
||||
RvTestResult(rv, "SetSessionHistory() test", displayMode);
|
||||
if (!theSessionHistory)
|
||||
QAOutput("We didn't get the session history. Test failed.", 2);
|
||||
}
|
|
@ -67,17 +67,19 @@ public:
|
|||
public:
|
||||
|
||||
// individual nsIWebNavigation tests
|
||||
void CanGoBackTest();
|
||||
void GoBackTest();
|
||||
void CanGoForwardTest();
|
||||
void GoForwardTest();
|
||||
void GoToIndexTest();
|
||||
void LoadUriTest(char *, PRUint32, PRInt16 displayMode=2);
|
||||
void ReloadTest(PRUint32);
|
||||
void StopUriTest(char *, PRUint32);
|
||||
void GetDocumentTest(void);
|
||||
void GetCurrentURITest(void);
|
||||
void GetSHTest(void);
|
||||
void CanGoBackTest(PRInt16);
|
||||
void GoBackTest(PRInt16);
|
||||
void CanGoForwardTest(PRInt16);
|
||||
void GoForwardTest(PRInt16);
|
||||
void GoToIndexTest(PRInt16);
|
||||
void LoadUriTest(char *, PRUint32, PRInt16 displayMode=1,
|
||||
PRBool runAllTests=PR_FALSE);
|
||||
void ReloadTest(PRUint32, PRInt16);
|
||||
void StopUriTest(char *, PRUint32, PRInt16);
|
||||
void GetDocumentTest(PRInt16);
|
||||
void GetCurrentURITest(PRInt16);
|
||||
void GetSHTest(PRInt16);
|
||||
void SetSHTest(PRInt16);
|
||||
void LoadUriandReload(int);
|
||||
void OnStartTests(UINT nMenuID);
|
||||
void RunAllTests();
|
||||
|
|
|
@ -90,45 +90,52 @@ nsIWebProgress * CnsiWebProg::GetWebProgObject()
|
|||
}
|
||||
}
|
||||
|
||||
void CnsiWebProg::AddWebProgLstnr(PRUint32 theFlag)
|
||||
void CnsiWebProg::AddWebProgLstnr(PRUint32 theFlag, PRInt16 displayMode)
|
||||
{
|
||||
nsCAutoString flagName(NS_LITERAL_CSTRING("xxxx"));
|
||||
|
||||
ConvertWPFlagToString(theFlag, flagName);
|
||||
|
||||
// addWebProgListener
|
||||
nsCOMPtr<nsIWebProgress> qaWebProgress;
|
||||
qaWebProgress = GetWebProgObject();
|
||||
nsCOMPtr<nsIWebProgressListener> listener(NS_STATIC_CAST(nsIWebProgressListener*, qaBrowserImpl));
|
||||
rv = qaWebProgress->AddProgressListener(listener, theFlag);
|
||||
// StoreWebProgFlag(theFlag);
|
||||
RvTestResult(rv, "nsIWebProgress::AddProgressListener() test", 1);
|
||||
RvTestResult(rv, "nsIWebProgress::AddProgressListener() test", displayMode);
|
||||
RvTestResultDlg(rv, "nsIWebProgress::AddProgressListener() test", true);
|
||||
FormatAndPrintOutput("WebProgressListener flag = ", flagName, 1);
|
||||
FormatAndPrintOutput("WebProgressListener flag = ", flagName, displayMode);
|
||||
}
|
||||
|
||||
void CnsiWebProg::RemoveWebProgLstnr()
|
||||
void CnsiWebProg::RemoveWebProgLstnr(PRInt16 displayMode)
|
||||
{
|
||||
// removeWebProgListener
|
||||
nsCOMPtr<nsIWebProgress> qaWebProgress;
|
||||
qaWebProgress = GetWebProgObject();
|
||||
nsCOMPtr<nsIWebProgressListener> listener(NS_STATIC_CAST(nsIWebProgressListener*, qaBrowserImpl));
|
||||
rv = qaWebProgress->RemoveProgressListener(listener);
|
||||
RvTestResult(rv, "nsIWebProgress::RemoveProgressListener() test", 1);
|
||||
RvTestResult(rv, "nsIWebProgress::RemoveProgressListener() test", displayMode);
|
||||
RvTestResultDlg(rv, "nsIWebProgress::RemoveProgressListener() test");
|
||||
}
|
||||
|
||||
void CnsiWebProg::GetTheDOMWindow()
|
||||
void CnsiWebProg::GetTheDOMWindow(PRInt16 displayMode)
|
||||
{
|
||||
// getTheDOMWindow
|
||||
nsCOMPtr<nsIWebProgress> qaWebProgress;
|
||||
qaWebProgress = GetWebProgObject();
|
||||
nsCOMPtr<nsIDOMWindow> qaDOMWindow;
|
||||
rv = qaWebProgress->GetDOMWindow(getter_AddRefs(qaDOMWindow));
|
||||
RvTestResult(rv, "nsIWebProgress::GetDOMWindow() test", 1);
|
||||
RvTestResult(rv, "nsIWebProgress::GetDOMWindow() test", displayMode);
|
||||
RvTestResultDlg(rv, "nsIWebProgress::GetDOMWindow() test");
|
||||
if (!qaDOMWindow)
|
||||
QAOutput("Didn't get DOM Window object.", 2);
|
||||
QAOutput("Didn't get DOM Window object.", displayMode);
|
||||
}
|
||||
|
||||
void CnsiWebProg::GetIsLoadingDocTest(PRInt16 displayMode)
|
||||
{
|
||||
PRBool docLoading;
|
||||
qaWebProgress = GetWebProgObject();
|
||||
rv = qaWebProgress->GetIsLoadingDocument(&docLoading);
|
||||
RvTestResult(rv, "nsIWebProgress::GetisLoadingDocument() test", displayMode);
|
||||
RvTestResultDlg(rv, "nsIWebProgress::GetisLoadingDocument() test");
|
||||
FormatAndPrintOutput("GetisLoadingDocument return value = ", docLoading, displayMode);
|
||||
}
|
||||
|
||||
void CnsiWebProg::ConvertWPFlagToString(PRUint32 theFlag,
|
||||
|
@ -193,6 +200,7 @@ void CnsiWebProg::RetrieveWebProgFlag()
|
|||
ConvertWPFlagToString(theFlag, flagName);
|
||||
FormatAndPrintOutput("WebProgressListener flag = ", flagName, 2);
|
||||
}
|
||||
|
||||
void CnsiWebProg::OnStartTests(UINT nMenuID)
|
||||
{
|
||||
CWebProgDlg myDialog;
|
||||
|
@ -204,14 +212,17 @@ void CnsiWebProg::OnStartTests(UINT nMenuID)
|
|||
break ;
|
||||
case ID_INTERFACES_NSIWEBPROGRESS_ADDPROGRESSLISTENER :
|
||||
if (myDialog.DoModal() == IDOK)
|
||||
AddWebProgLstnr(myDialog.m_wpFlagValue);
|
||||
AddWebProgLstnr(myDialog.m_wpFlagValue, 2);
|
||||
break ;
|
||||
case ID_INTERFACES_NSIWEBPROGRESS_REMOVEPROGRESSLISTENER :
|
||||
RemoveWebProgLstnr();
|
||||
RemoveWebProgLstnr(2);
|
||||
break ;
|
||||
case ID_INTERFACES_NSIWEBPROGRESS_GETDOMWINDOW :
|
||||
GetTheDOMWindow();
|
||||
GetTheDOMWindow(2);
|
||||
break ;
|
||||
case ID_INTERFACES_NSIWEBPROGRESS_ISLOADINGDOCUMENT :
|
||||
GetIsLoadingDocTest(2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -252,10 +263,11 @@ void CnsiWebProg::RunAllTests(void)
|
|||
theFlag = nsIWebProgress::NOTIFY_ALL;
|
||||
break;
|
||||
}
|
||||
AddWebProgLstnr(theFlag);
|
||||
RemoveWebProgLstnr();
|
||||
AddWebProgLstnr(theFlag, 1);
|
||||
RemoveWebProgLstnr(1);
|
||||
}
|
||||
GetTheDOMWindow();
|
||||
GetTheDOMWindow(1);
|
||||
GetIsLoadingDocTest(1);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -70,13 +70,14 @@ public:
|
|||
nsCOMPtr<nsIWebBrowser> qaWebBrowser;
|
||||
CBrowserImpl *qaBrowserImpl;
|
||||
nsIWebProgress * GetWebProgObject();
|
||||
void AddWebProgLstnr(PRUint32);
|
||||
void RemoveWebProgLstnr(void);
|
||||
void GetTheDOMWindow(void);
|
||||
void AddWebProgLstnr(PRUint32, PRInt16);
|
||||
void RemoveWebProgLstnr(PRInt16);
|
||||
void GetTheDOMWindow(PRInt16);
|
||||
void GetIsLoadingDocTest(PRInt16);
|
||||
|
||||
void ConvertWPFlagToString(PRUint32, nsCAutoString&);
|
||||
void StoreWebProgFlag(PRUint32);
|
||||
void RetrieveWebProgFlag();
|
||||
void RetrieveWebProgFlag(void);
|
||||
|
||||
void OnStartTests(UINT nMenuID);
|
||||
void RunAllTests(void);
|
||||
|
@ -97,6 +98,9 @@ public:
|
|||
// Generated message map functions
|
||||
protected:
|
||||
|
||||
private:
|
||||
nsCOMPtr<nsIWebProgress> qaWebProgress;
|
||||
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -273,6 +273,7 @@
|
|||
#define ID_VERIFYBUGS_170274 33003
|
||||
#define ID_TESTS_NSIIOSERVICENEWURI 33005
|
||||
#define ID_TESTS_NSIPROTOCOLHANDLERNEWURI 33006
|
||||
#define ID_INTERFACES_NSIWEBPROGRESS_ISLOADINGDOCUMENT 33007
|
||||
#define ID_CLIPBOARDCMD_PASTE 42789
|
||||
#define ID_CLIPBOARDCMD_COPYSELECTION 42790
|
||||
#define ID_CLIPBOARDCMD_SELECTALL 42791
|
||||
|
@ -289,7 +290,7 @@
|
|||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_3D_CONTROLS 1
|
||||
#define _APS_NEXT_RESOURCE_VALUE 153
|
||||
#define _APS_NEXT_COMMAND_VALUE 33007
|
||||
#define _APS_NEXT_COMMAND_VALUE 33008
|
||||
#define _APS_NEXT_CONTROL_VALUE 1033
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
|
|
Двоичные данные
embedding/qa/testembed/testembed.aps
Двоичные данные
embedding/qa/testembed/testembed.aps
Двоичный файл не отображается.
|
@ -484,6 +484,8 @@ BEGIN
|
|||
|
||||
MENUITEM "GetDOMWindow", ID_INTERFACES_NSIWEBPROGRESS_GETDOMWINDOW
|
||||
|
||||
MENUITEM "IsLoadingDocument", ID_INTERFACES_NSIWEBPROGRESS_ISLOADINGDOCUMENT
|
||||
|
||||
END
|
||||
POPUP "nsIWebBrowserFind"
|
||||
BEGIN
|
||||
|
|
Загрузка…
Ссылка в новой задаче