Added nsIProtocolHandler->NewURI() test to the Tests menu.

a=asa for checkins not part of the default build.


git-svn-id: svn://10.0.0.236/trunk@130689 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
depstein%netscape.com
2002-09-28 22:09:28 +00:00
parent 5bb07d1ca4
commit f909bc6a35
6 changed files with 48 additions and 3 deletions

View File

@@ -97,6 +97,7 @@ BEGIN_MESSAGE_MAP(CTests, CWnd)
ON_COMMAND(ID_TESTS_ADDURICONTENTLISTENER_OPENURI, OnTestsAddUriContentListenerByOpenUri)
ON_COMMAND(ID_TESTS_NSNEWCHANNEL, OnTestsNSNewChannelAndAsyncOpen)
ON_COMMAND(ID_TESTS_NSIIOSERVICENEWURI, OnTestsIOServiceNewURI)
ON_COMMAND(ID_TESTS_NSIPROTOCOLHANDLERNEWURI, OnTestsProtocolHandlerNewURI)
ON_COMMAND(ID_TOOLS_REMOVEGHPAGE, OnToolsRemoveGHPage)
ON_COMMAND(ID_TOOLS_REMOVEALLGH, OnToolsRemoveAllGH)
ON_COMMAND(ID_TOOLS_TESTYOURMETHOD, OnToolsTestYourMethod)
@@ -608,6 +609,46 @@ void CTests::OnTestsIOServiceNewURI()
}
}
// *********************************************************
void CTests::OnTestsProtocolHandlerNewURI()
{
nsCOMPtr<nsIIOService> ioService(do_GetIOService(&rv));
if (!ioService) {
QAOutput("We didn't get the IOService object.", 2);
return;
}
if (myDialog.DoModal() == IDOK)
{
nsCAutoString theStr, retStr;
nsCOMPtr<nsIURI> theOriginalURI;
nsIURI *theReturnURI = nsnull;
nsCOMPtr<nsIProtocolHandler> protocolHandler;
theStr = myDialog.m_urlfield;
rv = ioService->GetProtocolHandler("http", getter_AddRefs(protocolHandler));
RvTestResult(rv, "ioService->GetProtocolHandler() test", 2);
rv = qaWebNav->GetCurrentURI(getter_AddRefs(theOriginalURI));
if (!protocolHandler) {
QAOutput("We didn't get the protocolHandler object.", 2);
return;
}
rv = protocolHandler->NewURI(theStr, nsnull, theOriginalURI, &theReturnURI);
if (!theOriginalURI)
QAOutput("We didn't get the original nsIURI object.", 2);
else if (!theReturnURI)
QAOutput("We didn't get the output nsIURI object.", 2);
RvTestResult(rv, "protocolHandler->NewURI() test", 2);
retStr = GetTheUri(theReturnURI, 1);
// simple string compare to see if input & output URLs match
if (strcmp(myDialog.m_urlfield, retStr.get()) == 0)
QAOutput("The in/out URIs MATCH.", 1);
else
QAOutput("The in/out URIs don't MATCH.", 1);
}
}
// *********************************************************
// *********************************************************
// TOOLS to help us

View File

@@ -118,6 +118,7 @@ protected:
afx_msg void OnTestsAddUriContentListenerByOpenUri();
afx_msg void OnTestsNSNewChannelAndAsyncOpen();
afx_msg void OnTestsIOServiceNewURI();
afx_msg void OnTestsProtocolHandlerNewURI();
afx_msg void OnInterfacesNsifile();
afx_msg void OnToolsRemoveGHPage();
afx_msg void OnToolsRemoveAllGH();

View File

@@ -70,7 +70,6 @@ CNsIRequest::~CNsIRequest()
}
/////////////////////////////////////////////////////////////////////////////
// CNsIRequest message handlers
// ***********************************************************************
@@ -89,7 +88,7 @@ Element ReqTable[] = {
{"http://www.aol.com/", 0, 1, 0, 0, 0, 1, 1},
{"https://www.yahoo.com/", 1, 1, 1, 1, 0, 1, 1},
{"data:text/plain;charset=iso-8859-7,%be%fg%be",
1, 1, 1, 1, 0, 1, 1},
1, 1, 1, 1, 0, 1, 1},
{"file://C|/Program Files/", 1, 1, 1, 1, 0, 1, 1},
{"ftp://ftp.netscape.com/", 1, 1, 1, 1, 0, 1, 1},
{"ftp://ftp.mozilla.org/", 0, 0, 0, 0, 1, 0, 0},

View File

@@ -272,6 +272,7 @@
#define ID_VERIFYBUGS_169617 33002
#define ID_VERIFYBUGS_170274 33003
#define ID_TESTS_NSIIOSERVICENEWURI 33005
#define ID_TESTS_NSIPROTOCOLHANDLERNEWURI 33006
#define ID_CLIPBOARDCMD_PASTE 42789
#define ID_CLIPBOARDCMD_COPYSELECTION 42790
#define ID_CLIPBOARDCMD_SELECTALL 42791
@@ -288,7 +289,7 @@
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_3D_CONTROLS 1
#define _APS_NEXT_RESOURCE_VALUE 153
#define _APS_NEXT_COMMAND_VALUE 33006
#define _APS_NEXT_COMMAND_VALUE 33007
#define _APS_NEXT_CONTROL_VALUE 1033
#define _APS_NEXT_SYMED_VALUE 101
#endif

View File

@@ -168,6 +168,9 @@ BEGIN
END
MENUITEM "NSNewChannel/AyncOpen", ID_TESTS_NSNEWCHANNEL
MENUITEM "nsIIOService->NewURI()", ID_TESTS_NSIIOSERVICENEWURI
MENUITEM "nsIProtocolHandler->NewURI()",
ID_TESTS_NSIPROTOCOLHANDLERNEWURI
END
POPUP "&Interfaces"
BEGIN