зеркало из https://github.com/mozilla/pjs.git
Better error checking in QaUtils and webProgLstnr methods. Not part of the build.
This commit is contained in:
Родитель
6544ca9be9
Коммит
0a26e05e50
|
@ -253,17 +253,10 @@ NS_IMETHODIMP CBrowserImpl::OnLocationChange(nsIWebProgress* aWebProgress,
|
|||
|
||||
QAOutput("Entering nsIWebProgLstnr::OnLocationChange().");
|
||||
|
||||
nsresult rv;
|
||||
nsCAutoString uriString;
|
||||
rv = location->GetSpec(uriString);
|
||||
if (NS_FAILED(rv))
|
||||
QAOutput("Bad result for GetSpec().");
|
||||
else
|
||||
QAOutput("Good result for GetSpec().");
|
||||
|
||||
FormatAndPrintOutput("OnLocationChange(): The location url = ", uriString, 1);
|
||||
// test nsIURI parameter
|
||||
GetTheUri(location, 1);
|
||||
|
||||
// RequestName(aRequest, stringMsg); // because of crash bug bugzilla 86521
|
||||
RequestName(aRequest, stringMsg);
|
||||
|
||||
PRBool isSubFrameLoad = PR_FALSE; // Is this a subframe load
|
||||
if (aWebProgress) {
|
||||
|
|
|
@ -268,13 +268,17 @@ void RequestName(nsIRequest *request, nsCString &stringMsg, int displayMethod)
|
|||
{
|
||||
nsresult rv;
|
||||
|
||||
rv = request->GetName(stringMsg);
|
||||
if (!request) {
|
||||
QAOutput("ERROR. nsIRequest object is Null. RequestName test fails.", displayMethod);
|
||||
return;
|
||||
}
|
||||
else
|
||||
rv = request->GetName(stringMsg);
|
||||
|
||||
if(NS_SUCCEEDED(rv))
|
||||
FormatAndPrintOutput("nsIRequest: The request name = ", stringMsg.get(), displayMethod);
|
||||
else
|
||||
QAOutput("nsIRequest: We didn't get the request name.", displayMethod);
|
||||
|
||||
}
|
||||
|
||||
void WebProgDOMWindowTest(nsIWebProgress *progress, const char *inString,
|
||||
|
@ -290,7 +294,12 @@ void WebProgDOMWindowTest(nsIWebProgress *progress, const char *inString,
|
|||
totalStr2 = inString;
|
||||
totalStr2 += ": nsIWebProgress:DOMWindow attribute test";
|
||||
|
||||
rv = progress->GetDOMWindow(getter_AddRefs(theDOMWindow));
|
||||
if (!progress) {
|
||||
QAOutput("ERROR. nsIWebProgress object is Null. WebProgDOMWindowTest fails.", displayMethod);
|
||||
return;
|
||||
}
|
||||
else
|
||||
rv = progress->GetDOMWindow(getter_AddRefs(theDOMWindow));
|
||||
if (!theDOMWindow)
|
||||
QAOutput(totalStr1.get(), displayMethod);
|
||||
else
|
||||
|
@ -307,6 +316,11 @@ void WebProgIsDocLoadingTest(nsIWebProgress *progress, const char *inString,
|
|||
totalStr = inString;
|
||||
totalStr += ": nsIWebProgress:IsDocumentLoading attribute test";
|
||||
|
||||
if (!progress) {
|
||||
QAOutput("ERROR. nsIWebProgress object is Null. WebProgIsDocLoadingTest fails.", displayMethod);
|
||||
return;
|
||||
}
|
||||
else
|
||||
rv = progress->GetIsLoadingDocument(&docLoading);
|
||||
RvTestResult(rv, totalStr.get(), displayMethod);
|
||||
FormatAndPrintOutput("nsIWebProgress: isDocumentLoading return value = ", docLoading, displayMethod);
|
||||
|
|
Загрузка…
Ссылка в новой задаче