From 3ecfa8deb8176c4f0a36a778a82e74e1190d6f6e Mon Sep 17 00:00:00 2001 From: "depstein%netscape.com" Date: Thu, 24 Jan 2002 22:18:53 +0000 Subject: [PATCH] added some code to the listeners git-svn-id: svn://10.0.0.236/trunk@112744 18797224-902f-48f8-a5cc-f745e15eee43 --- .../qa/testembed/BrowserImplHistoryLstnr.cpp | 2 +- .../qa/testembed/BrowserImplWebPrgrsLstnr.cpp | 26 ++++++++++++++----- mozilla/embedding/qa/testembed/nsiHistory.cpp | 15 ++++++----- 3 files changed, 30 insertions(+), 13 deletions(-) diff --git a/mozilla/embedding/qa/testembed/BrowserImplHistoryLstnr.cpp b/mozilla/embedding/qa/testembed/BrowserImplHistoryLstnr.cpp index db45d4eed5f..4701031294b 100644 --- a/mozilla/embedding/qa/testembed/BrowserImplHistoryLstnr.cpp +++ b/mozilla/embedding/qa/testembed/BrowserImplHistoryLstnr.cpp @@ -144,7 +144,7 @@ NS_IMETHODIMP CBrowserImpl::OnHistoryPurge(PRInt32 theNumEntries, PRBool *notify *notify = PR_TRUE; FormatAndPrintOutput("OnHistoryPurge() notification = ", *notify, 1); - FormatAndPrintOutput("OnHistoryGotoIndex() theNumEntries = ", theNumEntries, 2); + FormatAndPrintOutput("OnHistoryPurge() theNumEntries = ", theNumEntries, 2); return NS_OK; } diff --git a/mozilla/embedding/qa/testembed/BrowserImplWebPrgrsLstnr.cpp b/mozilla/embedding/qa/testembed/BrowserImplWebPrgrsLstnr.cpp index b89da4f1658..b0846dea76f 100644 --- a/mozilla/embedding/qa/testembed/BrowserImplWebPrgrsLstnr.cpp +++ b/mozilla/embedding/qa/testembed/BrowserImplWebPrgrsLstnr.cpp @@ -84,10 +84,13 @@ NS_IMETHODIMP CBrowserImpl::OnProgressChange(nsIWebProgress *progress, nsIReques if (nProgressMax == 0) nProgressMax = LONG_MAX; - if (curSelfProgress > maxSelfProgress) + if (curSelfProgress == maxSelfProgress) { QAOutput("nsIWebProgLstnr::OnProgressChange(): Self progress complete!", 1); + FormatAndPrintOutput("OnProgressChange(): curSelfProgress value = ", curSelfProgress, 1); + FormatAndPrintOutput("OnProgressChange(): maxSelfProgress value = ", maxSelfProgress, 1); + // web progress DOMWindow test WebProgDOMWindowTest(progress, "OnProgressChange()", 1); } @@ -95,7 +98,11 @@ NS_IMETHODIMP CBrowserImpl::OnProgressChange(nsIWebProgress *progress, nsIReques if (nProgress > nProgressMax) { nProgress = nProgressMax; // Progress complete + QAOutput("nsIWebProgLstnr::OnProgressChange(): Progress Update complete!", 1); + + FormatAndPrintOutput("OnProgressChange(): curTotalProgress value = ", nProgress, 1); + FormatAndPrintOutput("OnProgressChange(): maxTotalProgress value = ", nProgressMax, 1); } m_pBrowserFrameGlue->UpdateProgress(nProgress, nProgressMax); @@ -252,9 +259,9 @@ NS_IMETHODIMP CBrowserImpl::OnLocationChange(nsIWebProgress* aWebProgress, else QAOutput("Good result for GetSpec()."); - FormatAndPrintOutput("The location url = ", uriSpec, 1); + FormatAndPrintOutput("OnLocationChange(): The location url = ", uriSpec, 1); -// RequestName(aRequest, stringMsg); +// RequestName(aRequest, stringMsg); // because of crash bug bugzilla 86521 PRBool isSubFrameLoad = PR_FALSE; // Is this a subframe load if (aWebProgress) { @@ -290,10 +297,10 @@ CBrowserImpl::OnStatusChange(nsIWebProgress* aWebProgress, RequestName(aRequest, stringMsg); - // status result test - FormatAndPrintOutput("OnStatusChange(): Status = ", aStatus, 1); + // status result test (id number) + FormatAndPrintOutput("OnStatusChange(): Status id = ", aStatus, 1); - // web progress DOMWindow test + // web progress DOMWindow test (typically the host name) WebProgDOMWindowTest(aWebProgress, "OnStatusChange(): web prog DOM window test", 1); m_pBrowserFrameGlue->UpdateStatusBarText(aMessage); @@ -315,6 +322,13 @@ CBrowserImpl::OnSecurityChange(nsIWebProgress *aWebProgress, RequestName(aRequest, stringMsg); + if (state & STATE_IS_SECURE) + QAOutput("OnSecurityChange():STATE_IS_SECURE. All docs & subdocs are https."); + else if (state & STATE_IS_BROKEN) + QAOutput("OnSecurityChange():STATE_IS_BROKEN. Mixed: some docs are https."); + else if (state & STATE_IS_INSECURE) + QAOutput("OnSecurityChange():STATE_IS_INSECURE. Nothing is https."); + // web progress DOMWindow test WebProgDOMWindowTest(aWebProgress, "OnSecurityChange()", 1); diff --git a/mozilla/embedding/qa/testembed/nsiHistory.cpp b/mozilla/embedding/qa/testembed/nsiHistory.cpp index 63e85c7fc63..d5ca526fff6 100644 --- a/mozilla/embedding/qa/testembed/nsiHistory.cpp +++ b/mozilla/embedding/qa/testembed/nsiHistory.cpp @@ -87,7 +87,7 @@ void CNsIHistory::OnStartTests(UINT nMenuID) // option selected from menu. PRInt32 numEntries = 5; PRInt32 theIndex; - PRInt32 theMaxLength = 1; + PRInt32 theMaxLength = 100; CString shString; @@ -110,8 +110,10 @@ void CNsIHistory::OnStartTests(UINT nMenuID) QAOutput("theSessionHistory object wasn't created. No session history tests performed.", 2); return; } - else + else { QAOutput("theSessionHistory object was created.", 2); + theSessionHistory->GetCount(&numEntries); + } theSessionHistory->GetEntryAtIndex(0, PR_FALSE, getter_AddRefs(theHistoryEntry)); if (!theHistoryEntry) @@ -169,7 +171,7 @@ void CNsIHistory::RunAllTests() PRInt32 numEntries = 5; PRInt32 theIndex; - PRInt32 theMaxLength = 1; + PRInt32 theMaxLength = 100; CString shString; @@ -190,9 +192,10 @@ void CNsIHistory::RunAllTests() QAOutput("theSessionHistory object wasn't created. No session history tests performed.", 2); return; } - else + else { QAOutput("theSessionHistory object was created.", 2); - + theSessionHistory->GetCount(&numEntries); + } // test count attribute in nsISHistory.idl GetCountTest(theSessionHistory, &numEntries); @@ -414,7 +417,7 @@ void CNsIHistory::RunAllHistoryEntryTests() { PRInt32 numEntries = 5; PRInt32 theIndex; - PRInt32 theMaxLength = 1; + PRInt32 theMaxLength = 100; CString shString;