diff --git a/embedding/qa/testembed/BrowserImplWebPrgrsLstnr.cpp b/embedding/qa/testembed/BrowserImplWebPrgrsLstnr.cpp index add273ce37a..b312392bbc7 100644 --- a/embedding/qa/testembed/BrowserImplWebPrgrsLstnr.cpp +++ b/embedding/qa/testembed/BrowserImplWebPrgrsLstnr.cpp @@ -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) { diff --git a/embedding/qa/testembed/QaUtils.cpp b/embedding/qa/testembed/QaUtils.cpp index 43b9afc1748..8540261486f 100644 --- a/embedding/qa/testembed/QaUtils.cpp +++ b/embedding/qa/testembed/QaUtils.cpp @@ -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);